This is a node.js API Blueprint formatter for producing HTML documents.
It uses protagonist and ejs to do all the dirty work.
For more info on writing API documentation, read up on the API Blueprint specification.
Here's a small sample:
FORMAT: 1A
HOST: https://api.example.com/v1
# Example API
A simple API example
# Group People
This section describes the People endpoint
## Person [/people/{id}]
Represent a particular Person
+ Parameters
+ id (required, string, `123`) ... The id of the Person.
+ Model (application/json)
```
{"first_name":"Samuel","last_name":"Adams","birthdate":"09-27-1722"}
```
### Retrieve Person [GET]
Return the information for the Person
+ Response 200 (application/json)
[Person][]
$ ./node_modules/yours-truly/bin/yours-truly INPUT_FILE.md [OUTPUT_FILE.html]
- Create your API markdown file, e.g.
blueprint.md
- Run
./node_modules/yours-truly/bin/yours-truly blueprint.md
- Pipe the output somewhere
- Done!
- Create your API markdown file, e.g.
blueprint.md
- Run
./node_modules/yours-truly/bin/yours-truly blueprint.md blueprint.html
- Done!
- Trying to view the output HTML file in your browser directly from the filesystem will not display correctly.
var yt = require('yours-truly'),
html = yt('/path/to/blueprint.md');
If the GO language is more your thing, you might want to check out these projects
-
github.com/subosita/iglo : Original inspiration of this project
-
github.com/peterhellberg/hiro : Uses iglo to output HTML to a file