https://github.com/polytypic/klipse-github-docs-generator
Generates HTML pages with Klipse snippets from GitHub markdown
https://github.com/polytypic/klipse-github-docs-generator
docs github klipse
Last synced: 6 months ago
JSON representation
Generates HTML pages with Klipse snippets from GitHub markdown
- Host: GitHub
- URL: https://github.com/polytypic/klipse-github-docs-generator
- Owner: polytypic
- License: mit
- Created: 2017-05-25T18:45:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-22T09:40:33.000Z (about 6 years ago)
- Last Synced: 2025-05-18T19:48:43.802Z (8 months ago)
- Topics: docs, github, klipse
- Language: CSS
- Homepage:
- Size: 34.2 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Klipse GitHub Docs Generator · [](https://github.com/polytypic/klipse-github-docs-generator) [](https://www.npmjs.com/package/klipse-github-docs-generator)
This is a minimalistic tool to generate HTML pages with
[Klipse](https://github.com/viebel/klipse) snippets from GitHub markdown.
Examples:
* [Fastener](https://polytypic.github.io/fastener/)
* [Partial Lenses Validation](https://calmm-js.github.io/partial.lenses.validation/)
This tool is still rough around the edges. Feel free to contribute
improvements!
[](http://badge.fury.io/js/klipse-github-docs-generator)
[](https://david-dm.org/polytypic/klipse-github-docs-generator) [](https://david-dm.org/polytypic/klipse-github-docs-generator?type=dev)
## 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](https://github.com/polytypic/fastener/blob/master/README.md) for an
example. The essential part is having code snippets in the markdown that can be
evaluated in a browser — like this:
```js
1 + 2
// 3
```
Click
[here](https://polytypic.github.io/klipse-github-docs-generator/index.html#usage)
to evaluate the above in the browser.
Import statements do not work and you should have those marked in a different
language. Like this:
```jsx
import from 'some-awesome-library'
```
### Install `klipse-github-docs-generator`
Install `klipse-github-docs-generator` as a dev dependency:
```bash
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](https://github.com/polytypic/fastener/blob/master/klipse-github-docs.config.js)
for an example.
### Generate docs
To generate `docs` you run the command:
```bash
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.