Options
All
  • Public
  • Public/Protected
  • All
Menu

Fence Comment Text Simple

Fenced, Comment, Text simple Example

File replace03.txt is to be included in output file. File replace03.txt contains fences and enpty lines.
In this example fences are excluded from any extra processing and included verbatim in the output.

Input

/**
 * [[include:includes/repalce03.md]]
 */
export interface IKeyValue<T> {
  [key: string]: T;
}

Options

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

Config

const bp = new BuildProcess();
const opt = {
  match: {
    kind: 'bracketIncludeMulti',
    path: './fixtures/'
  },
  comment: {
    type: 'singleAsterisk'
  },
  text: {
    indent: true
  },
  fence: 'strict'
};
const results = bp.buildInclude('','./src/interfaces.ts', opt);

Output

/**
  * Represents a generic item with a string key value
  * 
  * Example:
  * 
```ts
const lst: IKeyValuec<string> = {
    src: 'https://someUrl.come/js/myjs.js',
    scrolling: 'yes',
    type: 'text/javascript'
};
for (const key in lst) {
    if (lst.hasOwnProperty(key)) {
    const value = lst[key];
    console.log(key, value);
    }
}
console.log('src: ', lst['src']);
console.log('type: ', lst.type);
```
  */
export interface IKeyValue<T> {
  [key: string]: T;
}

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

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