0.0.0 • Published 6 years ago

doclite v0.0.0

Weekly downloads
3
License
-
Repository
-
Last release
6 years ago

doclite

Minimal docsite generator.

npm

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:

Above source code, with light syntax highlighting, and links

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 text
  • start, end: Position in source
  • type: String identifying the token type