docway
v0.0.3
Published
Generate documents for a project.
Downloads
7
Readme
docway
Table of Contents
Features
- Plugin based. Which means we hope you just need to require suitable plugins.
- Tools and libraries exposed. Which means you can customize your own templates or collectors easily.
- Sample standard. We try to make a simple sample standard which we can make sample easily to read, download, run...
Installation
npm i docway --save
Install on global
npm i docway -g
Quick CLI Example
check cli options [show]
- run sample
$ ./node_modules/.bin/docway -h
Usage: docway
--config [config js file]
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
quick start [download] [show]
const packageCollector = require('docway/collectors/node/package');
const simpleDocTemplate = require('docway/templates/simple/docTemplate.js');
const path = require('path');
module.exports = {
template: simpleDocTemplate,
target: path.join(__dirname, './README.md'),
content: {
topic: 'Quick start test project.',
features: [
'This is feature 1',
'This is feature 2'
],
licensePath: './LICENSE'
},
collectors: [{
name: 'module',
collector: packageCollector,
data: path.join(__dirname, './package.json')
}],
subDocuments: []
};
- run sample
$ ./node_modules/.bin/docway --config ./doc.js
[success] finished to build documents.
- view the effect: README.md
See more CLI samples: common CLI samples
Quick API Example
quick start [show]
const {
compile
} = require('docway');
compile({
template: ({
title
}) => `## ${title}`,
content: {
title: 'test'
}
}).then((doc) => {
console.log(doc);
});
- run sample
$ node quickStart.js
[success] finished to build documents.
## test
See more API samples: common API samples
License
docway is MIT licensed
Document was generated by docway.