0.4.6 • Published 5 years ago

@vcl/doc-gen v0.4.6

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

VCL Documentation Generator

A documentation generator for the VCL based on a set of modules or an entry point package.json and its recursive dependencies. In most cases you want the doc-gen to use a single package.json listing all dependencies from your project. The output will look like the VCL's module browser.

Under the Hood

The main purpose of this module is to generate a JSON data structure in which all information is held. Modules considered need to have a vcl property in the package.json file according to the structure explained here.

Each module's documentation file (default is README.md) is picked and copied into the JSON structure as well as the meta data from package.json.

The JSON data is rendered into a browsable documentation based on HTML by the vcl-doc-client module.

Usage

CLI

npm -g i @vcl/doc-gen
cd someProject
vcl-doc-gen --entry ./package.json --output doc.html

Arguments

All arguments are optional.

OptionDefaultDescription
--nameVCL DocumentationBrowser Title & Main heading
--outputvcl-documentation.htmlOutput HTML file
--entry./package.jsonEntry file.
--basePathcurrent working dir

See Options for a more detailed description.

Local CLI

npm install --save-dev @vcl/doc-gen
./node_modules/.bin/vcl-doc-gen

Generate HTML

var docGenerator = require('@vcl/doc-gen');

docGenerator.generateHtml({
  name: 'VCL Documentation',
  entryPackage: './package.json',
  output: './documentation.html'
});

Generate JSON

var docGenerator = require('@vcl/doc-gen');

docGenerator.generate({
  name: 'VCL Documentation',
  entryPackage: './package.json',
  output: './doc.json'
});

Options

name

The name of the documentation. When using vcl-doc-client this will be displayed in the header and set as the page title.

Default: name: 'VCL Documentation'

entryPackage

The package that the doc-gen should parse to find all VCL dependencies and generate the documentation from.

Example: entryPackage: './package.json'

packages

You can put a list of paths to additional packages here or use this as an alternative to the entryPackage option and set your packages manually.

Example: packages: ['../vcl-test', './some/package']

output

The file to output the finished JSON doc.

Default: output: './doc.json'

removeTopHeading

With this option, all level 1 headings from the package readme files are removed. Defaults to true, because most packages have the package name as the first heading and the vcl-doc-client does already display the package name above the readme.

Default: removeTopHeading: true

basePath

The base path.

Example: basePath: './my-project'

0.4.6

5 years ago

0.4.5

5 years ago

0.4.2

6 years ago

0.4.0

6 years ago

0.4.0-beta.3

6 years ago

0.4.0-beta.1

6 years ago

0.4.0-beta.0

6 years ago

0.4.0-1

6 years ago

0.4.0-0

6 years ago

0.3.0-4

6 years ago

0.3.0-3

6 years ago

0.3.0-2

6 years ago

0.3.0-1

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

8 years ago