klipse-github-docs-generator
v0.3.8
Published
Generates HTML pages with Klipse snippets from GitHub markdown
Downloads
1,973
Readme
Klipse GitHub Docs Generator ·
This is a minimalistic tool to generate HTML pages with Klipse snippets from GitHub markdown.
Examples:
This tool is still rough around the edges. Feel free to contribute improvements!
Usage
First of all you need to have a GitHub markdown file with the documentation that includes the snippets that you want to klipsify. See here for an example. The essential part is having code snippets in the markdown that can be evaluated in a browser — like this:
1 + 2
// 3
Click here to evaluate the above in the browser.
Import statements do not work and you should have those marked in a different language. Like this:
import from 'some-awesome-library'
Install klipse-github-docs-generator
Install klipse-github-docs-generator
as a dev dependency:
npm i --save-dev klipse-github-docs-generator
klipse-github-docs.config.js
To configure the generator the project root needs to have a file named
klipse-github-docs.config.js
, which must be a JavaScript file that must
contain a single function that returns an array of configuration objects. See
here
for an example.
Generate docs
To generate docs
you run the command:
npx klipse-github-docs-generator
You can also implement your own npm scripts to e.g. watch files to rebuild docs and reload browser to make editing feedback faster.