docolatte

Bittersweet theme for JSDoc 3

Usage no npm install needed!

<script type="module">
  import docolatte from 'https://cdn.skypack.dev/docolatte';
</script>

README

docolatte npm package

:chocolate_bar: Bittersweet theme for JSDoc 3

screenshot class
screenshot methods
screenshot source
screenshot mobilescreenshot mobile menu

(The sample codes in the screenshots are derived from docdash/fixtures)

All screenshots

Features

  • Responsive
  • Focused on legibility
  • Colorful, but not distracting
  • Customizable options for branding your project

Keyboard-only Search & Navigation

screenshot search demo

Interactive TOC (Table of Contents)

screenshot navigation demo

Install

$ npm i --save-dev docolatte

Usage

Specify the path to docolatte ( normally: node_modules/docolatte ) as the JSDoc template with -t option of jsdoc command:

$ jsdoc entry-file.js -t node_modules/docolatte

Or set the path to opts.template in your JSDoc configuration file:

{
  "opts": {
    "template": "node_modules/docolatte",
  }
}

Customize

Docolatte supports some configuration options to customize the HTML output.

{
  "templates": {
    "docolatte": {
      "branding": {
        "title": "My Project",
        "link":  "https://example.com/project/",
        "icon":  "home",
        "font": {
          "size":   "1.5em",
          "family": "Helvetica, sans-serif"
        }
      },
      "code": {
        "theme": "tomorrow-night"
      },
      "meta": {
        "lang": "en",
        "title": "My Project",
        "description": "Welcome to my project.",
        "keywords": "awesome, cool",
        "author": "John Programmer",
        "favicon": "icon.png"
      },
      "footer": {
        "copyright": "(c) 2020 John Programmer"
      }
    }
  }
}
  • docolatte
    • branding
      • title — Title of the entire site. Used in the top left header
      • link — Link URL in the header
      • icon — Icon for the link in the header (default: "home"). See: feathericons.com
      • font
        • size — Font size of the title
        • family — Font family of the title
    • code
      • theme — Theme for code blocks (default: "tomorrow-night-eighties"). See: themes
    • meta
      • langlang attribute of <html> (default: "en")
      • title — Content of <title> element (defaults to branding.title)
      • descriptioncontent attribute of <meta name="description">
      • keywordscontent attribute of <meta name="keywords">
      • authorcontent attribute of <meta name="author">
      • favicon — Favicon image URL. Use array for multiple files
    • footer
      • copyright — Copyright text. Used in the footer
      • hide — Whether to hide the entire footer ( true | false )
  • default — All the options for the JSDoc's default theme are also compatible with docolatte

More options are planned to be implemented in the future.

Thanks

Docdash — Lodash inspired JSDoc 3 template/theme

License

docolatte is licensed under the Apache License 2.0.