// BUILD_INCLUDE("./includes/replace.txt")
File replace04.txt is to be included in output file.
const bp = new BuildProcess();
const opt = {
match: {
kind: "buildIncludeSlash"
},
fence: {
start: "^^^^",
end: "^^^^"
},
breakstring: {
width: 70,
flags: "word"
},
comment: {
type: "jsDoc"
}
}
const results = bp.buildInclude('','./includes/test.txt', opt);
/**
* The quick, brown fox jumps over a lazy dog. DJs flock by when 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 whangs jumpy veldt fox.Bright vixens jump; dozy fowl
* quack. Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing
* daft Jim. Sex-charged fop blew my junk TV quiz.
^^^^text
There is Fenced text here with custom Fence
It is indeed possible to create a custom fence.
^^^^
* How quickly daft 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 bed. Flummoxed by
* job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk.A
* very bad quack might jinx zippy fowls. Few quips galvanized the mock jury
* box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra,
* and my wolves quack!Blowzy red vixens fight for a quick jump. Joaquin
* Phoenix was gazed by MTV for luck. A wizard’s job is to vex chumps quickly
* in fog. Watch "Jeopardy! ", Alex Trebek's fun TV quiz game. Woven silk
* pyjamas exchanged for blue quartz.
*/
The various options of fence
allow for the processing of fenced sections in input file.
Fences are used to omit section of a build_include replacement from being processed.
Thus the fenced section is included verbatium unless options are set to explicity exclude fences from output.
fence?start=```
Start of Fence.
Can be string value such as:
"```"
--or-- regular expression such as
"/```(?:(?:$)|(?:[\r\n]+))/"
When constructing a regular expressiong it must start with /
and end with /
; Otherwise, it will be treated as a string.
Do not include options after regular expression.
start
and end
are ignored if type
is set.
fence?end=```
End of Fence.
Can be string value such as:
"```"
--or-- regular expression such as
"/```(:?(?:$)|(?:[\r\n]+))/"
When constructing a regular expressiong it must start with /
and end with /
; Otherwise, it will be treated as a string.
Do not include options after regular expression.
start
and end
are ignored if type
is set.
The option comments
allow for input file content to be treated as comments in the output.
{comment: {type: "jsdoc" }}
or inline comment?type=jsdoc
The first line is /**
Pads the left side of each line with * and a single space.
The last lie is */
Example:
/**
* my multi line comments
* comments continue on this line
*/
See: Enum values for commentkind for possible types.
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: 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.
{breakstring: {flag: "word"}}
or inline breakstring?flags=word
Determines that lines are not to be broken on a word.
{match:{kind: "buildIncludeSlash" }}
// BUILD_INCLUDE(filePath)
// BUILD_INCLUDE(filePath)[options]
// BUILD_INCLUDE(filePath)
[options]
See Also: Class MatchBuildIncludeSlash
Generated using TypeDoc