Getting started
Installation
Install the docs-docgen-cli
globally with npm
to run docgen
CLI anywhere on your computer.
npm i -g docs-docgen-cli
The docgen
program is now available anywhere on your computer. Check it's available by executing:
docgen -V
# 1.0.3
Usage
-
Create
company.products.json
products list file with a list of product details. -
Invoke
docgen CLI
with the products list file.npx docs-docgen-cli company.products.json
-
Notice the generated files:
website/docs/index.md
website/docs/<product-slug>/index.md
website/products.outline.yaml
-
Invoke
skelo CLI
with theproducts.outline.yaml
npx skelo ./website/products.outline.yaml -d ./website/docs -s ./website/sidebars.js
-
The Docusaurus local development server will show the documentation structure. Include the following in the
docusaurus.config.js
file:// scroll down to the themeConfig
// under the navbar property, find the items property
/// ...
items: [
{
"to": "/docs",
"label": "Documentation"
},
//...
]
Product list file
You list the company products in a products list file - a .json file that contains an array whose items are eithe a non-empty string or an object. The object needs a label property whose value is a non-empty string. Common additional object properties include productId, description, and path.
Products list file example:
[
"Product Name as String",
{
"label": "Product Name as Object",
"description": "The label property is a non-empty string"
},
{
"label": "Product Three",
"productId": "p3",
"description": "This product uses the p3 folder. The default value for productId property is the slug based on label value."
},
{
"label": "Product Four",
"path": "additional/folders/before/product-folder",
"description": "The product documentation is at additional/folders/before/product-folder/product-four"
}
]