Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Changing the theme (template) of the documentation

Javier "Ciberman" Mora edited this page Aug 14, 2019 · 6 revisions

Included templates

docs_gm includes one integrated default template called docs_gm-basic.

You can also change the name of the template to use (the template package must be installed globally). For example, if you have a template named docs_gm-awesome-template, you can write this in your configuration file:

"template": "awesome-template",

Another alternative is to set the values using the console:

docs_gm generate --template awesome-template

Check the help for the generate command with docs_gm generate --help to see all the possible values that can be overwritten in the console.

Custom templates

You can create custom HTML templates and use them with docs_gm. Refer to this page for how to create a custom template.

Using custom templates from NPM (recommended)

If you want to download a custom template made by another, simply find the template you want to use (Must be published as an npm package) and install it globally with:

npm install --global docs_gm-my-template-name

Then you can use "template": "my-template-name" from your docs_gm.json file, or change it from the console with:

docs_gm generate --template=my-template-name

Using custom templates locally from a folder

To use a custom template from a folder locally, create a folder named templates and place all the custom templates folder inside. Example:

  • templates
    • super-template
      • template.json
    • another-custom-template
      • template.json
    • foo-template-name
      • template.json

Then, change in your docs_gm.json file, the templatesFolder path to point to your templates folder. Remember, if you are on Windows, you must escape the backslash \\. Example:

    "templatesFolder": "C:\\my\\path\\template\\",

Then, you can change the Template name and design name to use your custom template:

    "template": "super-template",