Options
All
  • Public
  • Public/Protected
  • All
Menu

Comment Type Jsdoc Remove Padding

Comment Type Jsdoc Remove Padding

BUILD_INCLUDE

// BUILD_INCLUDE("./includes/replace01.txt")[comment?type=jsdoc&padleft=0,text?padleft=0]

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 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.
 *
 *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.
 */

File replace01.txt is to be included in output file.

Comment in jsDoc style and remove padding between * and start of lines.

Options

[comment?type=jsdoc&padleft=0,text?padleft=0]

Comment

The option comments allow for input file content to be treated as comments in the output.

Comment Type JsDoc

{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.

Comment Padleft

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

Text

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

Text Padleft
{text: {
  padding: {
    padleft: 4
      }
    }
}

inline text?padleft=num
where as num is any whole number number, pads the left side of each line with a number of spaces equal to the value of num. --or--
text?padleft=text where as text is a string value, pads the left 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?padleft=\t\t, would add two tabs as left padding.
If padleft is a string value then be aware some strings require escaping.
See: Escaping Parameters

Option

comment?padleft=0
Setting padleft to a value of 0 actually removes any padding between * and the input file line contents. This may not be perferable in most cases. The value can be increased to created more spaces other than the default of 1.

{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