@gasket/plugin-docsify

View collated docs with Docsify

Usage no npm install needed!

<script type="module">
  import gasketPluginDocsify from 'https://cdn.skypack.dev/@gasket/plugin-docsify';
</script>

README

@gasket/plugin-docsify

Use Docsify to serve a website view of the collated docs from @gasket/plugin-docs.

Installation

New apps

gasket create <app-name> --plugins @gasket/plugin-docs,@gasket/plugin-docsify

Existing apps

npm i @gasket/plugin-docs @gasket/plugin-docsify

Modify plugins section of your gasket.config.js:

module.exports = {
  plugins: {
    add: [
+      '@gasket/plugin-docs',
+      '@gasket/plugin-docsify'
    ]
  }
}

Now, when you run npx gasket docs in your app, a nice Docsify website will be launched in your browser.

Configuration

To be set in under docsify in the gasket.config.js.

  • theme - (string) Name of the theme. Default is styles/gasket.css. Can be set to name of docsify themes, a URL, or CSS file.
  • port - (number) Port to serve the docs from. Default is 3000.
  • config - (object) Any Docsify config properties, expect for functions types which are not currently supported. Default has auth2top and relativePath set to true, with maxLevel at 3.
  • stylesheets (string[]) - Optional additional stylesheet URLs to load.
  • scripts (string[]) - Optional additional scripts files, which can include docsify plugins.

Example

This example uses the dark theme, and enables the Google Analytics plugin by adding the script and config.

// gasket.config.js

module.exports = {
  docsify: {
    theme: 'dark',
    config: {
      ga: 'UA-XXXXX-Y'
    },
    scripts: [
      '//unpkg.com/docsify/lib/plugins/ga.min.js'
    ]
  }
}

License

MIT