This repo was forked from docdash for the purpose of styling the documentation for AsyncAF.
There are some minor changes compared with the original docdash as laid out below.
The main feature added is that this fork minifies the HTML/CSS/JS output files. AsyncAF/docdash utilizes html-minifier
for this task. Click below to see the minifier settings that depart from the normal defaults.
{
collapseBooleanAttributes: true,
collapseWhitespace: true,
maxLineLength: 32 * 1024,
minifyCSS: true,
minifyJS: true,
removeAttributeQuotes: true,
removeComments: true,
removeOptionalTags: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
sortAttributes: true,
sortClassName: true
}
If you need to add any custom scripts or stylesheets you can include them in the docdash
property of your jsdoc.conf.js
or jsdoc.conf.json
file:
// jsdoc.conf.js
// ...
docdash: {
scripts: [
'/scripts/script1.js',
'/scripts/script2.js'
],
styles: [
'/styles/stylesheet1.css',
'/styles/stylesheet2.css'
]
}
// ...
You can also specify a metadata description and metadata for open graph. For example:
// jsdoc.conf.js
// ...
docdash: {
meta: {
description: 'Async/Await Fun'
},
openGraph: {
title: 'AsyncAF - Documentation',
type: 'website',
image: 'https://www.example.com/your-image',
site_name: 'AsyncAF',
url: 'https://async-af.js.org/'
}
}
// ...
Add favicons to your site in the docdash.icons
property. If you need to make some, I'd recommend this favicon generator for an easy time.
// jsdoc.conf.js
// ...
docdash: {
icons: { // paths are from the root of your site
appleTouchIcon: '/apple-touch-icon.png',
favicon32x32: '/favicon-32x32.png',
favicon16x16: '/favicon-16x16.png',
manifest: '/site.webmanifest',
msTileColor: '#2d89ef',
themeColor: '#ffffff'
}
}
// ...
Other than that, the only real difference between this repo and the original docdash is layout and styling. Check out the CHANGELOG to see all the changes, or take a look at the AsyncAF docs built using this template.
If you like the way the template looks, you can use it in your own project as follows:
$ npm install -D AsyncAF/docdash jsdoc
Warning: this will install AsyncAF/docdash from github as I haven't published this fork to npm.
Create a jsdoc.conf.js
configuration file following the documentation here or here.
To use the AsyncAF/docdash template, just make sure you point to the template in opts
:
// jsdoc.conf.js
...
opts: {
template: 'node_modules/docdash',
},
...
Then write an npm script in your package.json
:
...
"scripts": {
"docs": "jsdoc -c jsdoc.conf.js",
},
...
Just run: $ npm run docs
Or, if you're using the CLI: $ jsdoc -t node_modules/docdash
(end of AsyncAF/docdash notes)
(original docdash README)
A clean, responsive documentation template theme for JSDoc 3.
See http://clenemt.github.io/docdash/ for a sample demo. 🚀
$ npm install docdash
Clone repository to your designated jsdoc
template directory, then:
$ jsdoc entry-file.js -t path/to/docdash
In your projects package.json
file add a new script:
"script": {
"generate-docs": "node_modules/.bin/jsdoc -c jsdoc.json"
}
In your jsdoc.json
file, add a template option.
"opts": {
"template": "node_modules/docdash"
}
See the config file for the fixtures or the sample below.
{
"tags": {
"allowUnknownTags": false
},
"source": {
"include": "../js",
"includePattern": ".js$",
"excludePattern": "(node_modules/|docs)"
},
"plugins": [
"plugins/markdown"
],
"opts": {
"template": "assets/template/docdash/",
"encoding": "utf8",
"destination": "docs/",
"recurse": true,
"verbose": true
},
"templates": {
"cleverLinks": false,
"monospaceLinks": false
}
}
Docdash supports the following options:
{
"docdash": {
"static": [false|true], // Display the static members inside the navbar
"sort": [false|true] // Sort the methods in the navbar
}
}
Place them anywhere inside your jsdoc.json
file.
Licensed under the Apache License, version 2.0. (see Apache-2.0).