docma-template-zebra
v2.3.1
Published
Zebra - Default template for Docma. https://github.com/onury/docma
Downloads
12,334
Readme
This is the default template for Docma; with a side-bar symbols menu, search and navigation features; and a beautiful layout.
Usage
- Make sure you have the latest Docma installed.
- Although Zebra is installed together with Docma, you can still install/update this template via npm:
npm i docma-template-zebra -D
- Set
template.path
to"default"
or"zebra"
or omit it in your build configuration (docma.json). - Configure and set
template.options
as described below.
Template Options
Template specific options that can be used when building your documentation with Zebra.
Navigation Menu
Linked labels that build the navigation menu on the top bar of the document. Each item is an arbitrary Object with the following properties.
Usage with Docma
Template options are defined within the build configuration. i.e. in a docma.json
file.
{
"template": {
// Docma Template to be used.
// Either a path, module name or "default"
"path": "zebra",
// Zebra template-specific options
"options": {
"title": {
"label": "My Library",
"href": "/base/"
},
"logo": {
"dark": "img/dark-logo.png",
"light": "img/light-logo.png"
},
"sidebar": {
"enabled": true,
"outline": "tree",
"collapsed": false,
"toolbar": true,
"itemsFolded": false,
"itemsOverflow": "crop",
"badges": true,
"search": true,
"animations": true
},
"symbols": {
"autoLink": true,
"params": "list",
"enums": "list",
"props": "list",
"meta": false
},
"contentView": {
"bookmarks": "h1,h2,h3",
"faLibs": "solid,regular,brands"
},
"navbar": {
"enabled": true,
"dark": false,
"animations": true,
"menu": [
{
"label": "Docs",
"iconClass": "fas fa-book",
"href": "./"
},
{
"label": "Demos",
"iconClass": "fas fa-mouse-pointer",
"href": "?content=demos"
},
{
"label": "Download",
"iconClass": "fas fa-cloud-download-alt",
"items": [
{
"label": "v0.5.0-pre",
"href": "https://github.com/user/repo/archive/v0.7.0-pre.zip"
},
{ "separator": true },
{
"label": "v1.0.0",
"href": "https://github.com/user/repo/archive/v1.0.0.zip"
}
]
},
{
"label": "GitHub",
"iconClass": "fab fa-github",
"href": "https://github.com/user/repo",
"target": "_blank"
}
]
}
}
},
// other build configuration options
// src, dest, app, jsdoc, markdown, debug, etc...
}
Then you can build your documentation with these customized template options.
Docma.create()
.build('path/to/docma.json')
.then(() => {
console.log('Documentation is built successfully.');
})
.catch(err => {
console.log(err);
});
...or build via CLI:
docma -c path/to/docma.json
Changelog
See CHANGELOG.
Note: If you're upgrading from Zebra v1.x to v2.x, there are some breaking changes.
License
MIT.
Emoji shortcuts used in source markdown files are parsed into twemoji. Graphics and icons licensed under CC-BY 4.0. See FontAwesome license.