JSON Schema tooling: scaffold, verify, and generate documentation against JSON Schema documents.
JSON Schema provides a great way to describe an API. prmd provides tools for bootstrapping a description like this, verifying its completeness, and generating documentation from the specification.
The JSON Schema usage conventions expected by prmd are described in /docs/schemata.md.
To learn more about JSON Schema in general, start with this excellent guide and supplement with the specification.
Add this line to your application's Gemfile:
gem 'prmd'And then execute:
$ bundleOr install it yourself as:
$ gem install prmdCombine takes the path to a directory of schemas and combines them onto stdout. If -m or --meta is supplied, it will override defaults/metadata:
$ prmd combine <directory>Doc takes the path to a directory of schemas and outputs their documentation onto stdout. If -m or --meta is supplied, it will override defaults/metadata:
$ prmd doc <directory_or_schema>Prepend file to the documentation output:
$ prmd doc -p header.md,overview.md <directory or schema>Init optionally takes a resource as it's first argument and generates a new schema file to stdout (generically or using the resource name provided). If -m or --meta is supplied, it will override defaults/metadata:
$ prmd init
$ prmd init <resource_name>Verify takes a path to a directory of schemas or a particular schema file and checks to see if it matches expectations:
$ prmd verify <directory_or_schema>Combining commands works too:
$ prmd combine <directory> | prmd verify | prmd doc > schema.md- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request