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.
[fence?type=multiflex,comment?type=singleAsterisk,text?indent=true]
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.
Determines the type of Fence to Apply.
Can be any fenceKind such as strict
type=multiFlex
Applys combined fencing options.
See: Fence Type MultiFlex
The option comments
allow for input file content to be treated as comments in the output.
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.
The option text
allow for input file content to be manipulated in several ways before being outputed.
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.
module.exports = function (grunt) {
grunt.initConfig({
build_include: {
default: {
options: {
match: {
kind: 'bracketIncludeMulti',
path: './fixtures/'
},
comment: {
type: 'singleAsterisk'
},
text: {
indent: true
},
fence: 'strict'
},
src: './src/interfaces.ts',
dest: './scratch/js/interfaces.ts'
}
}
});
grunt.loadNpmTasks('grunt-build-include');
grunt.registerTask('default', ['build_include:default']);
};
/**
* 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;
}
Generated using TypeDoc