Markdown Manifest
Uses a regular markdown form to produce muxrpc manifests and cli usage descriptions.
The form:
# api-name Api short description. Api long, multiline description (optional).Api long, multiline description (optional).Api long, multiline description (optional). ## method-name: type Method short description. ```bashbash usage ``` -- ```jsjs usage ``` -- Method long, multiline description .Method long, multiline description .Method long, multiline description .
Example:
# example-api Example API, v1.0.0. This is an example API, written by Paul Frazee.It's not a real API, but it would work with muxrpc. ## ping: async Pings a target machine. ```bashping {target string} [-n number]``` -- ```jsping
The api:
var mdm = mdm/* => { ping: 'async', listen: 'source'}*/ mdm /* => Example API, v1.0.0. This is an example API, written by Paul Frazee.It's not a real API, but it would work with muxrpc. Commands: - ping Pings a target machine. - listen Listens for pings.*/ mdm/* => Example API, v1.0.0. This is an example API, written by Paul Frazee.It's not a real API, but it would work with muxrpc. Commands: - foo.ping Pings a target machine. - foo.listen Listens for pings.*/ mdm /* => Example API, v1.0.0. This is an example API, written by Paul Frazee.It's not a real API, but it would work with muxrpc. Commands: - ping Pings a target machine. - listen Listens for pings.*/ mdm/* =>Pings a target machine. ping {target string} [-n number] - target: string, an IPv4/IPv6 address- opts: - n: optional number, how many times to ping Sends ICMP ping messages to the given target.Will wait 1 second between pings.*/ mdm // standard HTML output
Command-line usage:
:~/mdmanifest⭐ ./mdm.js manifest ./test/valid-example.md
{
"ping": "async",
"listen": "source"
}
:~/mdmanifest⭐ ./mdm.js html ./test/valid-example.md
<h1>example-api</h1>
<p>Example API, v1.0.0.</p>
...
:~/mdmanifest⭐ ./mdm.js usage ./test/valid-example.md
Example API, v1.0.0.
This is an example API, written by Paul Frazee.
It's not a real API, but it would work with muxrpc.
Commands:
ping Pings a target machine.
listen Listens for pings.
:~/mdmanifest⭐ ./mdm.js usage ./test/valid-example.md ping
Pings a target machine.
ping {target string} [-n number]
- target: string, an IPv4/IPv6 address
- opts:
- n: optional number, how many times to ping
Sends ICMP ping messages to the given target.
Will wait 1 second between pings.