mdocu
v0.0.52
Published
A documentation generator for markdown flavoured pages.
Downloads
33
Readme
MDocu (work in progress)
MDocu is a NodeJS documentation generator capable of converting a bulk of .md files into a static webapp.
Installing the CLI
Npm or Yarn
To use the CLI, install MDocu with Npm or Yarn globally.
npm install mdocu -g
yarn global add mdocu
CLI Commands
compile
mdocu compile "/output-dir" "/pages-dir" -n "Name of the project"
new
Create a new directory by the given name and creates examples pages, a configuration file and finally compiles.
mdocu new "Name of the project"
init
Initializes a new project in the current working directory.
mdocu init "Name of the project"
version
Show Cli version information.
mdocu --version
Writing your first page
MDocu follows a simple naming convention that controls the order and name of your pages. Therefor it's necassary to keep in mind that MDocu only looks for files that follow that convention, let's take a look at the following examples of valid and invalid filenames:
Valid filenames
01-introduction.md
02-getting-started.md
03-about-the-author.md
Invalid filenames
getting-started.md
getting_started.md
01-getting_started.md
getting-started
Configuration
The module has the following configuration options:
| Property | Type | Default | Explanation | | ------------- | --------- | ------------- | --------------------------------------------------------- | | Path | string | null | Path where to should look for .md files | | outDir | string | null | Path where the compiled pages should appear | | name | string | 'MDocu' | (optional) Project name that appears throughout the app | | locale | string | 'en' | (optional) The language of your writings | | debug | boolean | true | (optional) Display log information, warnings and errors | | version | string | '0.0.0' | (optional) Current version of your project |
Javascript implementation
To extend it's functionality or have more control over MDocu, you can use it as a javascript module.
Es6
import { Mdocu } from 'mdocu';
Mdocu.setup({
name: 'Demo documentation',
path: './demo/md',
outDir: './demo/docs'
}).compile()
Es5
const lib = require('mdocu');
lib.Mdocu.setup({
name: 'Demo documentation',
path: './demo/md',
outDir: './demo/docs'
}).compile()