Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/synesenom/code-doc
A small JS module to copy the content of script tags into code blocks for documentations
https://github.com/synesenom/code-doc
Last synced: about 2 months ago
JSON representation
A small JS module to copy the content of script tags into code blocks for documentations
- Host: GitHub
- URL: https://github.com/synesenom/code-doc
- Owner: synesenom
- Created: 2018-02-19T14:54:59.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-01T23:10:57.000Z (over 6 years ago)
- Last Synced: 2024-10-12T14:55:59.671Z (2 months ago)
- Language: JavaScript
- Homepage: https://synesenom.github.io/code-doc
- Size: 124 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# code-doc
A small JS module to copy the content of script tags into code blocks for documentations# usage
Create adiv
with the idcode-doc
:
```
```And add the class `doc` to each `script` tag that you want to copy:
```// Your awesome code
```
Then code-doc will populate the div with the content from the script tags.
# api
All API methods return the module itself in order to call them with chaining.
If you want to have the first line of each code block as a heading, call
```
codedoc.heading();
```Also, if any additional callback should be triggered (such as highlighting after the code blocks are populated),
set it with `callback(func)``:
```
codedoc.callback(func);
```
This will trigger the function `func` once the blocks are ready.To re-run the code generation, simply call
```
codedoc.run();
```