Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/llafuente/docr
Small javascript to markdown documentation tool
https://github.com/llafuente/docr
Last synced: 1 day ago
JSON representation
Small javascript to markdown documentation tool
- Host: GitHub
- URL: https://github.com/llafuente/docr
- Owner: llafuente
- Created: 2014-10-01T15:37:26.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-12-21T07:38:02.000Z (about 7 years ago)
- Last Synced: 2024-11-07T06:43:07.392Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.markdown
Awesome Lists containing this project
README
# docr
Small javascript to markdown documentation tool
## usage
```bash
npm install -g docrdocr file|pattern [ file|pattern] [--prepend file] [--append file] [--intro]
pattern Linux will expand wildcards so remember to escape
them "\*"
prepend can be repeated many times
append can be repeated many times
intro if the file has an intro (comment at the very
beginning of the file) it will be used
```Documentation will be printed to stdout.
# examples
```bash
# multiple files
docr index.js lib/xxx.js# globbing support
docr lib/*
```# File compatibility
`docr` is very simple. Do not support prototype or even objects. It's made some modules i have that has recursive require(s).
As you may know, when you have recursive require the easiest way to solve it is to write you module like this.
```js
module.exports = {
power: power
}function _private_function() {
// this function won't be documented because starts with "_"
}/**
* Give me some power!
*
* @param {Number} a
* @param {Number} b
* @return {Number}
*/
function power(a, b) {
return Math.power(a, b);
}
````docr` will generate documentation for any function that has a *doc-block*. To be coherent function name must be the same as exports.
# jsDoc support.
* description
* @param
* @note
* @return
* @example (partial support)new
* @name String
Force the function name in the documentation.
# projects that use docr
* [esprima-ast-utils](https://github.com/llafuente/esprima-ast-utils)
* [mongoose-versioner](https://github.com/llafuente/mongoose-versioner)