A simple documentation tool.
npm install --save-dev @nhevia/simple-docs
- Add sdoc as a package.json script:
"scripts": {
"docs": "sdoc"
}
- Use a comment block at the start of any file with
sdoc
preffix:
/*sdoc
This is the main component
*/
// your code
- Run
npm run docs
. It will indentify documentation blocks in your project and generates an output file (sdoc.md
by default, on root folder):
Since the generated file is markdown, it is supported inside documentation blocks.
/*sdoc
This is the **main** component
*/
-f <filename>, --file <filename>
Set the output file name:sdoc -f docs-components
|sdoc --file docs-components
-ni, --no-index
Set the output file name.sdoc -ni
|sdoc --no-index
Most major documentation libraries have tools that are beyond the current necessities for personal projects.
I needed a really simple tool to generate documentation for my scripts. Insert a comment block at the beggining of the file describing it and its usage and that's it.
Note that if you're working in a team with multiple people, there are better, more tested and reliable alternatives.
Pull requests are more than welcome.
Copyright © 2020 Nicolas Hevia This project is MIT licensed