github-style-page
Converting markdown content into HTML file with Github styles (GFW).
Installation
npm install github-style-page
Quick Start
var githubStylePage = ; ; ;
API
var githubStylePage = ;
githubStylePage(path, targetDir [, options], callback)
- path: the path where the markdown file.
- targetDir: the directory path where the converted file will be saved.
- options: deal with some optional parameters, see options for detail.
- callback: a function to be executed when converting is complete.
Note: if
targetDir
set to null, the converted content will not be saved as a file, but will be passed to the callback.
Below is an example:
; ;
githubStylePage(markdownString, targetDir [, options], callback)
Provide a markdown string exactly.
Note: set
isContent
to true to tellgithub-style-page
current is a markdown string.
Below is an example:
;
Options
vars
Template variables. Make sure that all variables used in the template where the customizeTemplatePath
have been passed by the vars
.
isContent
Indicate that currently is a markdown string.
;
template
A string to indicate the template will be used to render the markdown content.
Currently built-in templates:
- simple the default template theme.
- project NPM project style.
simple
Screen shot:
project
Below is an project
example, note that pkg
should be provided and at least contains name
and version
:
;
Screen shot:
If the above templates does not meet your needs, you can customize one and add it in this list. Then create a Pull Request without hesitate.
customizeTemplatePath
Provide a customize template path to render the parsed markdown content.
Note: if provided, the
template
option will take no effect.
;
markedOptions
Configuration for markdown parser, see marked#options for detail.
Default value:
gfm: true tables: true breaks: false
Below is an example:
;
fileName
Specify the name of the converted file will be saved.
;
Testing
npm test
License
MIT, see the LICENSE file for detail.