pinet
v1.2.1
Published
Yet another jsdocs template module
Downloads
54
Maintainers
Readme
Pinet
Yet another documentation template for jsdocs
Install
npm i -D pinet
Custom Tags
Pinet comes with some custom tag support you can use, within your jsdoc config simply tell it to use pinets tags.js like so:
"plugins": [
"node_modules/pinet/tags.js"
],
Currently category
and sig/signatue
tags are supported here. Feel free to open an issue to request other custom tags you may want to see!
Changelogs
You can also choose to have your changelog listed within the links of your documentation, simply provide the path to the changelog
"changelog": "./CHANGELOG.md",
Pinet will then go find, and parse the markdown into html to display on your site
See It In Action
You can check out kyanites documentation which is using the pinet templating engine to build its docs.
Check it out here: https://kyanite.dusty.codes/
Options
title
-String
: This is the title of the pages for your docsgenSources
-Boolean
: Set this totrue
if you want sources files to be generated and linked in your documentationlinks
-Array
: An array of objects to add to the nav, each object needs aname
andlink
propertylang
-String
: The value to set thelang
attribute to on thehtml
tagcustomTags
-Array
: An array of strings which should be the tag names you want pinet to considermeta
-Array
: An array of meta objects each object is built out into a meta element the properties provided will be turned into attributes
[!NOTE] As of v1.2.0 Pinet now also supports the usage of the verbose option found in the
opts
section of jsdocs Right now this is just a step tracker to possibly help figure out where parsing fails
Example:
{
"pinet": {
"title": "Testing -- Documentation",
"links": [
{
"name": "Github",
"link": "https://github.com/dhershman1/kyanite"
}
],
"genSources": true,
"lang": "en",
"changelog": "./CHANGELOG.md",
"customTags": [
"category",
"signature"
],
"meta": [
{
"name": "viewport",
"content": "width=device-width, initial-scale=1.0"
},
{
"charset": "UTF-8"
}
]
}
}
Usage
Setup a jsdoc.json file with your options and settings. It is Highly recommended you provide not only the source folders for your js files but also a path to the readme
and package.json
so that small bits of information can be properly stored
Than use the jsdoc cli and point it to your config json:
node_modules/.bin/jsdoc -c jsdoc.json
This will generate a new set of files to give you html rendered documentation
Templating Engine
The actual engine behind Pinet, is importable for your own use as well. You can bring it in and use it to generate all kinds of html and functionality.
import { compile, p, text } from 'pinet'
compile('span', { data: 'testing' }, [
p({}, [text('Hello!')])
]) // => <span data="testing"><p>Hello!</p></span>