Options
All
  • Public
  • Public/Protected
  • All
Menu

Fence Comment And Text Options

Fenced, Comment, Text Example

BUILD_INCLUDE

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

File replace02.txt is to be included in output file. File replace02.txt contains fences and enpty lines.
When fences are removed it may result in extra lines that are not the most desired output.
When you need to remove empty lines and or white space lines you can use the text whiteSpaceLine options.
See example: Comment Remove Fenced And White Space Lines

Config

const bp = new BuildProcess();
const opt = {
  match: {
    kind: "bracketIncludeMulti"
  }
};
const results = bp.buildInclude('','./includes/replace2.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)  
 * 
 *     
 */

Options

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

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.

{match:{kind: "bracketIncludeMulti" }}

Matches the following

[[include:filepath]]
[[include:filepath]](options)  
* [[include:filepath]]  
* [[include:filepath]](options)  
// [[include:filepath]]  
// [[include:filepath]](options)

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

Generated using TypeDoc