A file-system based documentation library with lots of features.
npm install the-documentator---
- Front matter
- Handlebars
- Markdown
- Anchor links
- Attributes
- Emojis
- Tables
- Font Awesome
- Animate.css
- Tailwindcss
- JS Beautify
npm install -g the-documentatorcd /path/to/my/filesthe-documentator . --data mydata/books --assets myassets/css
See command line options
the-documentator --help
Or instantiate it into a file:
`` javascript
const Docs = require('the-documentator');
const docOptions = {
// Context will bring in package.json
context: Pkg,
dirname: __dirname,
routes: {
// Data files to bring into context
dataPaths: ['./data'],
// Incase a user wants to handle his own views
viewPath: 'views',
// Static assets. Can set via command line
assetPaths: ['../../my/other/app'],
// Path to documentation
docsPath: args.path + '/*/.{md,html}',
// Entry file
homeFile: './README.md'
},
// Open in browser or not
open: true,
// Watch for file changes
watch: true,
// Set the port
port: args.port || 3210
};
// Returns a Hapi server
const server = Docs(docOptions);
`
And start creating your documentation!
The app brings in html and md files and processes them using markdown-it. First, it parses files through handlebars, then it parses the markdown, the parses it again through handlebars via hapi/vision. In both instances, both package.json and anything you pass in docOptions.routes.dataPaths will be available as a variable in handlebars.
Any directories you pass into docOptions.routes.assetPaths will be used to call from the filesystem via /assets/{*path} url. The node_modules folder for the documentator package is avaiable in path, so you can access its npm packages directly.
- Tests
- Complete CLI
- Create watch functionalityhapi/nes
- Hook up frontend websocket using and trigger reloads when watchinghandlebars
- Allow overriding config optionsinit
- Create subprogram that copies handlebars` config and files to current working directory