-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for custom template files, add avanced example.
- Loading branch information
1 parent
7147a64
commit 0ff290b
Showing
48 changed files
with
3,014 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
examples/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// This file contains all available settings. | ||
// | ||
|
||
var mdoc = require('mdoc'); | ||
|
||
mdoc.run({ | ||
|
||
// === required settings === // | ||
|
||
inputDir : '../basic/content', | ||
outputDir : 'doc', | ||
|
||
|
||
// === basic settings === // | ||
|
||
baseTitle : 'mdoc example advanced settings', | ||
//indexContenPath : '../basic/index.mdown', | ||
|
||
|
||
// === advanced settings === // | ||
|
||
templatePath : 'custom_template', | ||
|
||
//indexContent will take precedence over `indexContentPath` | ||
indexContent : '<h1>Custom Template</h1><p>Example of a custom template and advanced settings.</p>', | ||
|
||
mapOutName : function(outputName) { | ||
//change file output name | ||
return outputName.replace('.html', '_doc.html'); | ||
}, | ||
|
||
mapTocName : function(fileName, tocObject){ | ||
//change the name displayed on the sidebar and on the index TOC | ||
return fileName.replace('_doc.html', ''); | ||
}, | ||
|
||
// pattern that matches files that should be parsed | ||
// this is the default value... | ||
include : '*.mdown,*.md,*.markdown', | ||
|
||
// pattern that matches files that shouldn't be parsed | ||
exclude : 'array.*', | ||
|
||
filterFiles : function(fileInfo) { | ||
// return `false` to remove files and `true` to keep them | ||
return (/math/).test(fileInfo.input); | ||
} | ||
|
||
}); |
Oops, something went wrong.