doclite

0.0.0 • Public • Published

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

Package Sidebar

Install

npm i doclite

Weekly Downloads

2

Version

0.0.0

License

none

Unpacked Size

4.23 kB

Total Files

3

Last publish

Collaborators

  • r24y
  • ryaninvents