Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@mocha/docdash

mochajs2.6kApache-2.04.0.1

A JSDoc template for Mocha, forked from docdash

jsdoc, template

readme

@mocha/docdash

npm package

A JSDoc template for Mocha's API documentation, forked from docdash.

Designed to work with 11ty.

Install

$ npm install @mocha/docdash jsdoc@^3.0.0 @11ty/eleventy@^0.10.0 -D

Usage

In your project's package.json file, add a new script, e.g.:

"script": {
  "generate-docs": "jsdoc -c jsdoc.json"
}

In your JSDoc configuration file file, add a template option:

"opts": {
  "template": "node_modules/@mocha/docdash"
}

Options

@mocha/docdash supports the following options:

{
  "mocha-docdash": {
    "static": [false|true],         // Display the static members inside the navbar
    "sort": [false|true],           // Sort the methods in the navbar
    "sectionOrder": [               // Order the main section in the navbar (default order shown here)
      "Classes",
      "Modules",
      "Externals",
      "Events",
      "Namespaces",
      "Mixins",
      "Tutorials",
      "Interfaces"
    ],
    "disqus": "",                   // Shortname for your disqus (subdomain during site creation)
    "openGraph": {                  // Open Graph options (mostly for Facebook and other sites to easily extract meta information)
      "title": "",                  // Title of the website
      "type": "website",            // Type of the website
      "image": "",                  // Main image/logo
      "site_name": "",              // Site name
      "url": ""                     // Main canonical URL for the main page of the site
    },
    "meta": {                       // Meta information options (mostly for search engines that have not indexed your site yet)
      "title": "",                  // Also will be used as postfix to actualy page title, prefixed with object/document name
      "description": "",            // Description of overal contents of your website
      "keyword": ""                 // Keywords for search engines
    },
    "search": [false|true],         // Display seach box above navigation which allows to search/filter navigation items
    "collapse": [false|true],       // Collapse navigation by default except current object's navigation of the current page
    "wrap": [false|true],           // Wrap long navigation names instead of trimming them
    "typedefs": [false|true],       // Include typedefs in menu
    "navLevel": [integer],          // depth level to show in navbar, starting at 0 (false or -1 to disable)
    "private": [false|true],        // set to false to not show @private in navbar
    "removeQuotes": [none|all|trim],// Remove single and double quotes, trim removes only surrounding ones
    "scripts": [],                  // Array of external (or relative local copied using templates.default.staticFiles.include) js or css files to inject into HTML,
    "menu": {                       // Adding additional menu items after Home
      "Project Website":{          // Menu item name
        "href":"https://myproject.com", //the rest of HTML properties to add to manu item
        "target":"_blank",
        "class":"menu-item",
        "id":"website_link"
      },
      "Forum":{
        "href":"https://myproject.com.forum",
        "target":"_blank",
        "class":"menu-item",
        "id":"forum_link"
      }
    }
  }
}

Place them anywhere inside your jsdoc.json file.

Example Config

See this example config file.

License

Licensed under the Apache License, version 2.0. (see Apache-2.0).

changelog

Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by auto-changelog.

v4.0.1

  • remove 11ty from peerDependencies #15
  • use node 16 on netlify #16

v4.0.0

24 October 2021

  • chore: update dev- and peerDeps #14
  • refactor!: drop support for Node 10 #13
  • test(CI): update Node and actions versions #12
  • update 11ty peer dependency #11
  • build(v4.0.0): release 0265d51

v3.0.1

26 August 2020

  • [style] break-word on screen max-width: 680px #8
  • project cleanup #7
  • Release v3.0.1 af1a112
  • add auto-changelog for naive changelog updates a9f8f9f
  • add netlify configuration de06109

v3.0.0

23 July 2020

v2.1.3

27 April 2020

  • Use light color scheme on Mocha API document #3
  • Adjust white space for view on mobile #4
  • Use light color scheme for colorblind people 304275e
  • Take a light theme from google-code-prettify d445485
  • “v2.1.3” d9110db

v2.1.2

15 August 2019

  • Remove dead link to html5shiv 5392aa4

v2.1.1

6 June 2019

v2.1.0

1 March 2019

  • remove unnecessary files from published package #52
  • add support for addition of header scripts via configuration 117928a
  • Release v2.1.0 da4816f
  • Merge commit 'ea3582e41cd2472a597b6dc275c667e8f99f3737' b85872e

v2.0.1

8 January 2019

  • fix some dependency issues 9283e2e
  • remove garbage from published package 98d331e
  • Release v2.0.1 e72991c

v2.0.0

8 January 2019

  • use npm ci for install on Travis-CI; update package-lock.json 9aad734
  • add package-lock.json e25d118
  • Fork docdash to mocha-docdash f8ccdd0

1.2.0

26 January 2020

  • Styles for headers inside user markdown #64
  • Update the Options JSON in README.md #74
  • Hide static/private method depending of the config #72
  • Host fonts locally #63
  • Make the theme work on small screens #62
  • Change second font to Source Sans Pro dcfa41e
  • Include other font type support 5476db4
  • [version] 1.2.0 cc43865

1.1.1

21 May 2019

  • Add js to scroll nav so that the link to the current page is shown #60
  • We need to rehide menus for search capabilities c3b1724
  • When expanding collapsed nav sections, match on exact name 70f9dad
  • Adding back exact match f69a2b6

1.1.0

30 March 2019

  • Remove jQuery #54
  • Allow aliasing event names #59
  • Fix search e39bbc2
  • Add IE support for NodeList.forEach 3dd6396
  • [version] 1.1.0 5baf863

1.0.3

20 February 2019

  • remove unnecessary files from published package #52
  • Fix error when including tutorials #51
  • broken string, spelling typo #49
  • correct eol abc55f5
  • Update to be on par with JSDoc features a12fa91
  • [scripts] auto update pages via CI 89a1b97

1.0.2

3 January 2019

1.0.1

1 December 2018

  • Remove line-height: 160% #46
  • Added hall-of-fame to README #44
  • Support ordering of the main navbar sections #34
  • Add require for module:constructors #15
  • Added support for @hidecontainer (jsdoc 3.5) #41
  • Fix crash when @example is empty #36
  • removes arbitrary width property #30
  • Fix issue with node 8.5 #26
  • Update publish.js to check example is not undefined #21
  • Added menu search and collapse options as well as numerous other meta data options and disqus support #20
  • fix title line height #17
  • Allow inclusion of custom CSS #1
  • Allow removing single and double quotes from pathnames 0449de5
  • Add option to filter through navigation items 6907ae5
  • Added support for @hidecontainer (jsdoc 3.5.0) 21e0602

v1.0.1

20 April 2018

  • add package-lock.json e25d118
  • Fork docdash to mocha-docdash f8ccdd0
  • rename package to @mocha/docdash 6a79051

1.0.0

1 December 2018

  • Support ordering of the main navbar sections #34
  • Add require for module:constructors #15
  • Added support for @hidecontainer (jsdoc 3.5) #41
  • Fix crash when @example is empty #36
  • removes arbitrary width property #30
  • Fix issue with node 8.5 #26
  • Update publish.js to check example is not undefined #21
  • Added menu search and collapse options as well as numerous other meta data options and disqus support #20
  • fix title line height #17
  • Allow inclusion of custom CSS #1
  • Allow removing single and double quotes from pathnames 0449de5
  • Add option to filter through navigation items 6907ae5
  • Added support for @hidecontainer (jsdoc 3.5.0) 21e0602

v1.0.0

14 April 2018

  • Add viewport meta tag #23
  • make throws style same as return style #14
  • makes sure that images don't mess up the viewport #12
  • Add sort option #6
  • Add static option #11 #10
  • Add gh-page sample #5
  • Typo in README.md #2
  • Add fixtures d0fe9de
  • First push 5e51138
  • Fork docdash to mocha-docdash f8ccdd0