Commit 34968e05 authored by Jarrod's avatar Jarrod 💬

Add machine's `extendedDescription` and markdown support

parent 2f310470
var pug = require('pug');
var path = require('path');
var fs = require('fs');
var md = require('markdown-it')();
/*
* Generate and output files somewhere
* Can we add npm version/travis/gitlab/coverage badges somehow? That'd be cool
......@@ -37,6 +38,13 @@ module.exports = function(pkg, pack, outDir, mpdocpkg) {
Object.keys(pack).forEach((key) => {
let def = pack[key].getDef();
Object.keys(def.inputs).forEach((i) => {
if (def.inputs[i].extendedDescription) {
def.inputs[i].extendedDescription = md.render(def.inputs[i].extendedDescription)
}
});
let outfile = path.join(outDir, def.identity + '.html');
let compiled = machineTpl({
name,
......
......@@ -19,6 +19,7 @@
"license": "WTFPL",
"dependencies": {
"commander": "^2.19.0",
"markdown-it": "^8.4.2",
"npm-api": "^0.4.12",
"pug": "^2.0.3"
}
......
......@@ -31,6 +31,9 @@ block body
p
strong Example  
= JSON.stringify(input.example)
if input.extendedDescription
!= input.extendedDescription
//- pre= JSON.stringify(input, null, 4)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment