Node.JS Structured document with markdown to HTML translator
- Mobile Device Responsive
- Directory-Oriented
- Real-time compiler
- Improve stylesheet to readable layout
- Syntax hilighter in code block
Install markmd tools to your project
npm install markmd --save
To make API document, just call markmd
(put it in your package scripts)
npm run markmd
README.md
will be your home page. For sub-category, all markdown file should be stored in docs
folder. All image file should be stored in docs-img
folder.
Example
├─ README.md
├─ /docs
| ├─ Alpha.md
| ├─ Bravo.md
| └─ Charlie.md
└─ /docs-img
├─ foo.jpg
└─ bar.jpg
This will be compiled to static HTML structure like this
├─ index.html
└─ /docs
├─ Alpha.html
├─ Bravo.thml
├─ Charlie.html
└─ /docs-img
├─ foo.jpg
└─ bar.jpg
Make configuration by create markmd.json
{
"source": "custom-docs",
"destination": "exported-docs",
"image": "custom-img",
"version": true
}
Options
option | description | default |
---|---|---|
source | Different document folder name | "docs" |
destination | Different exported folder name, by default | "apidoc/des" |
image | Different image folder name | "docs-img" |
version | Use version structuring | false |
fakeApidocConfig | Generate fake apidoc.json | false |
For multi-version API document, just put "version": true
into configuration file (described above). Versioning folder should be like this
Example
├─ README.md
└─ /docs
├─ /v1
| └─ fetch.md
├─ /v1.1
| ├─ fetch.md
| └─ delete.md
└─ /v2
└─ migration.md
For real-time compiling, just add --watch
or -w
option to the command
markmd --watch