Commit 8294d5d7 authored by Jarrod's avatar Jarrod 💬

changes

parent 63104801
......@@ -21,7 +21,12 @@ module.exports = function(pkg, pack, outDir, mpdocpkg) {
var machineTpl = pug.compileFile(path.join(__dirname, '../templates/machine.pug'));
// For each pack, run the templater and output the file somewhere
let name = mp.name
.replace(/^machinepack-/, '')
.replace(/-[a-z]/i, (found) => { return found.charAt(1).toUpperCase() });
let index = packTpl({
name,
pkg,
pack,
mp,
......@@ -34,6 +39,7 @@ module.exports = function(pkg, pack, outDir, mpdocpkg) {
let def = pack[key].getDef();
let outfile = path.join(outDir, def.identity + '.html');
let compiled = machineTpl({
name,
pkg,
pack,
mp,
......
......@@ -5,6 +5,10 @@ html
meta(name='viewport', content='width=device-width, initial-scale=1')
title= mp.name + ' ' + mp.version
link(rel='stylesheet', href='./style.css')
link(rel='stylesheet', href='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/default.min.css')
script(src='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js')
script hljs.initHighlightingOnLoad();
style .content pre code { margin: 0; background: transparent; }
body
section.hero.is-info
......
......@@ -8,6 +8,24 @@ block body
p= machine.description
h2 Usage
pre
code.javascript
= 'const ' + name + ' = require(\'' + mp.name + '\');'
br
br
if machine.sync
| let output =
= ' '+ name +'.' + method + '('
= machine.args.join(', ')
| );
else
| let output = await
= ' '+ name +'.' + method + '('
= machine.args.join(', ')
| );
br
= '// '
= JSON.stringify(machine.exits.success.outputExample)
h3 Inputs
each input, name in machine.inputs
......@@ -35,4 +53,5 @@ block body
pre= JSON.stringify(machine, null, 4)
h4 Source Code
pre= machine.fn
pre
code= machine.fn
......@@ -15,7 +15,7 @@ block body
h3 Methods
each key in Object.keys(pack)
p
a(href='./' + pack[key].getDef().identity + '.html')= '.' + key + '()'
a(href='./' + pack[key].getDef().identity + '.html')= '.' + key + '('+ pack[key].getDef().args.join(', ') +')'
|  
= pack[key].getDef().description
//- pre= JSON.stringify(pack[key], 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