Creating Custom Template

Default template is used if no other is provided via options (using --template or -t). For now the only handlebars backend is provided.

There are only two requirements for creating your own template for Doctor Mark Down. Every template should contain index.hbs file and assets folder with all necessary assets.

You can create new template directly in your project. For example create folder documentation_template. Like this:

documentation_template
 |- assets
 |  |- style.css
 |- index.hbs

Really simple index.html can look like for example this:

<!doctype html>
<html>
<head>
  <link rel="stylesheet" href="{{assetsPath}}/style.css">
</head>
<body>
  <nav>
    {{#if navigation}}
        {{{navigation}}}
    {{else}}
        {{{menu}}}
    {{/if}}
  </nav>
  <main>{{{content}}}</main>
</body>
</html>

You can then compile documentation using your custom template by running this commnad within project root directory:

docmd --template documentation_template
# or
docmd --t documentation_template

Api

There are three for parts currently provided by parser - menu, navigation, content and assetPath.

value description
menu Structure of current page with links (based on headlines)
navigation Menu of all ducuments in repository (using --recursive)
content HTML content of currently opened document
assetPath folder where assets are located (relative to currently opened document)