Options
All
  • Public
  • Public/Protected
  • All
Menu

Text Before After With Special Chars

Text Before After With Special Chars

BUILD_INCLUDE

// BUILD_INCLUDE("./scratch/replace01.txt")[text?before=\[\n&after=\n\]&PadRight=\\,breakstring?width=60]

OR

// BUILD_INCLUDE("./scratch/replace01.txt")[text?before=%5B\n&after=\n%5D&PadRight=%5C,breakstring?width=60]

Text padding and break lines using BUILD_INCLUDE

Includes replace01.txt. Special characters are escaped.
See: Escaping Parameters

Options

[text?before=\[\n&after=\n\]&PadRight=\\,breakstring?width=60]
--or--
[text?before=%5B\n&after=\n%5D&PadRight=%5C,breakstring?width=60]

Config

const bp = new BuildProcess();
const opt = {
  match: {
    kind: "buildIncludeSlash"
  }
};
const results = bp.buildInclude('','./includes/replace.txt', opt);

Output

[
The quick, brown fox jumps over a lazy dog. DJs flock by whe\
n MTV ax quiz prog. Junk MTV quiz graced by fox whelps.Bawds\
 jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick \
jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whan\
gs jumpy veldt fox.Bright vixens jump; dozy fowl quack. Quic\
k wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing d\
aft Jim. Sex-charged fop blew my junk TV quiz.How quickly da\
ft jumping zebras vex. Two driven jocks help fax my big quiz\
. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack\
!" my brave ghost pled. Five quacking zephyrs jolt my wax be\
d. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx wav\
es quart jug of bad milk.A very bad quack might jinx zippy f\
owls. Few quips galvanized the mock jury box. Quick brown do\
gs jump over the lazy fox. The jay, pig, fox, zebra, and my \
wolves quack!Blowzy red vixens fight for a quick jump. Joaqu\
in Phoenix was gazed by MTV for luck. A wizard’s job is to v\
ex chumps quickly in fog. Watch "Jeopardy! ", Alex Trebek's \
fun TV quiz game. Woven silk pyjamas exchanged for blue quar\
tz.\
]

Text

The option text allow for input file content to be manipulated in several ways before being outputed.

Text Before

{text: { before: "some value" }} or inlline text?before=some value
Where as some value can be any string. Some string values require escaping to include as literals.
See: Escaping Parameters

Text After

{text: { after: "some value" }} or inlline text?after=some value
Where as some value can be any string. Some string values require escaping to include as literals.
See: Escaping Parameters

Text Padright

text?padright=num where as num is any whole number number, pads the right side of each line with a number of spaces equal to the value of num. --or--
text?padright=text where as text is a string value, pads the right side of each line with the value of text. Spaces at the end of text are valid. \t (tab) is also acceptable such as text?padright=\t\t, would add two tabs as right padding.
If padright is a string value then be aware some strings require escaping.
See: Escaping Parameters

Breakstring

The various options of breakstring allow for the breaking of lines in different ways.
If the width option of breakstring is not set then width defaults to 80.

See: Interface for IOpt.breakstring

Breakstring Width

{breakstring: { width: 80 }} or inline breakstring?Width=80 where as 80 is the number of characters to break on, determines that each line will be broken as close to number characers as possible depending other breakstring options.

Option

before=\[\n or before=%5B\n
Inserts [ followed by a new line. The rest of the input contents will start on the new line.

[

PadRight=\\ or PadRight=%5C
Inserts \ at the end of each line.

after=\n\] or after=\n%5D
Inserts new line and the end of the input contents followed by ]


]

{match:{kind: "buildIncludeSlash" }}

Matches the following

// BUILD_INCLUDE(filePath)
// BUILD_INCLUDE(filePath)[options]
// BUILD_INCLUDE(filePath)  
[options]

See Also: Class MatchBuildIncludeSlash

See Also: IOpt
See Also: regexKind for match kind options.

Generated using TypeDoc