With this module you can mimic the GitHub documentation style to work in a local machine so you don't need to publish your project to GitHub to have a nice documentation.
You can convert GitHub flavored markdown files to html and start a local server to edit and preview them in real-time. Hence, you don't need to authenticate to your GitHub account to use their preview api, you just write your markdown file locally and simply push the project when you're done.
A possible documentation methodology could be to start a local server, a.k.a. your documentation server. You can navigate through your project source files and open them to see their content. You can create new markdown files, edit, live preview, save them and save the generated html files. Therefore, you can edit the documentation via browser and see the html result in real-time.
npm install gfm
//Converts markdown files to htmlvar gfm = ;gfm;
//Starts a local server to live previewvar gfm = ;gfm;
The module can be required and used from the API but it can also be used from CLI if you install it globally:
Usage: gfm [options]Options:-h, --help output usage information-s, --source <path> source file or directory where the markdown filesare localed [.]-g, --generate converts GitHub flavored markdown files tohighlighted html-d, --destination <path> destination file or directory where the html filesare generated [. if source is a directory, removed.md and ended in .html if source is a file]-e, --exclude <paths> excludes files and directories-c, --compact generates single html files without externalresources-l, --live starts a local server to live preview the markdownfiles-p, --port <number> local server port number 
src as source directory and
docs as destination directory:
$ gfm -g -s src -d docs
src as source directory,
docs as destination directory but create single html files for every markdown file (embedded resources):
$ gfm -g -c -s src -d docs
file.md to a compacted
$ gfm -g -c -s file.md
Generate markdown files located at
. and exclude
$ gfm -g -e node_modules,test/README.md
Start a local server with
. as source directory and port 1234:
$ gfm -l -p 1234
The source can be a directory or a file.
The possible settings are:
gfm_reswill be created with all the external dependencies. Default is