doclite
v0.0.0
Published
Minimalist documentation generator
Downloads
2
Readme
doclite
Minimal docsite generator.
What does this do?
It turns your code into a website version, where comments are displayed nicely, and modules link to one another.
Basically, it turns this:
import express from 'express';
// Create the app
const app = express();
/* Set up the initial route */
app.get('/', function (req, res) {
res.send('Hello World');
});
/* Start the server! */
app.listen(3000);
into this:
Getting started
npm install doclite
const Doclite = require('doclite');
Doclite.getTokens(`
// Code to document...
function foo() {
return 1 + 2;
}
`);
API
Doclite.getTokens(src)
Returns an array of objects with the following properties:
value
: Source textstart
,end
: Position in sourcetype
: String identifying the token type