vcl-doc-client

An HTML viewer for the doc generated by vcl/doc-gen

Usage no npm install needed!

<script type="module">
  import vclDocClient from 'https://cdn.skypack.dev/vcl-doc-client';
</script>

README

VCL Documentation Client

This is an HTML viewer for the docs based on a JSON structure such as generated by vcl/doc-gen. The doc fragments are included using shadow DOM.

While it has been created for the VCL it is mostly agnostic and can be used to browse any structured documentation.

Demo

VCL Documentation.

Usage

Use vcl/doc-gen to generate the input for this client. Or generate the documentation.json yourself.

Example

// var doc = {...};
var vclDocClient = require('vcl-doc-client');

vclDocClient.getBuild(doc, function(html) {
  console.log(html);
});

In order to inject custom CSS or JS before the </body> tag, doc.customHTML can be set accordingly.