Options
All
  • Public
  • Public/Protected
  • All
Menu

Fenced Remove With Comment And White Space Lines

Fenced, Comment, Text Example

BUILD_INCLUDE

/**
 // build_include('./fixtures/md/replace02.txt')[fence?type=multiflex&remove=true,comment?type=singleAsterisk,text?indent=true&whiteSpaceLine=removeAllWs]
 */

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

[fence?type=multiflex&remove=true,comment?type=singleAsterisk,text?indent=true&whiteSpaceLine=removeAllWs]

Config

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

Output

/**
 * # Fence Test
 * ## Repace02
 * `type=multiflex` Apply multiflex fencing options.  
 * Matches the pattern of:  
 * (optional space)(optional `*`)(optional space)(reguired ```(optional type)
 * fenced text
 * (reguired ```)
 * Some match examples:
 * See Also: [flexFence](/modules/_modules_fenceoptions_.html#flexfence)  
 */

Fence

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 Type

Determines the type of Fence to Apply.
Can be any fenceKind such as strict

Fence Type MultiFlex

See: Fence Type MultiFlex

Fence Remove

fence?remove=true true or false - Default: false
Boolean value to determine if fences should be removed from output.
If set to true then fenced sections will be excluded from output.

Comment

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

Comment Type SingleAsterisk

{comment: { type: "singleAsterisk" }} or inline comment?type=singleAsterisk
Pads the left side of each line with * and a single space.
Useful for comment replacement that is required inline.

Example:
If you have the following.

/**
 * [[include:doc/myMarkdown.md]]
 */

The output would be similar to the following.

/**
 * my multi line comments
 * comments continue on this line
 */

See: Enum values for commentkind for possible types.

Text

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

Text Indent

{text: {indent: true}} or inline text?indent=true
The option text?indent or text?indent=true will result in the output including the indent on each line that came before the BUILD_INCLUDE.

Text WhiteSpaceLine removeAllWs

{text: { WhiteSpaceLine: "removeAllWs" }} or inline text?WhiteSpaceLine=removeAllWs
All white space line are removed. This include white space lines and empty lines.
See: enum whiteSpLn

{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