This should one day be a full fledged Emacs major mode for editing API Blueprint.
apib-mode
is a major mode for editing API Blueprint in Emacs. It
is derived from markdown mode as API Blueprint is a special case of
markdown. It adds couple of useful things when working with API
Blueprint like getting parsing the API Blueprint and validating it.
For this to work though you need to install the drafter executable
first, please see drafter for more information.
Current status:
- Extra highlighting
- Parse and validation functions
- Functions to extract JSON and JSON Schema from the API Blueprint
- Some convenience functions for hooks
- Tested on Emacs 24, 25 and 26
apib-mode
is available on Melpa:
M-x package-install apib-mode
or just download it and put somewhere in your load path.
(autoload 'apib-mode "apib-mode"
"Major mode for editing API Blueprint files" t)
(add-to-list 'auto-mode-alist '("\\.apib\\'" . apib-mode))
It has all the features of markdown mode. Visit markdown-mode to see
the details. To validate your API Blueprint or see the parse result
just C-c C-x v or C-c C-x p respectively. It also provides some
convenience functions: apib-valid-p()
which can
be used in a hook for example, apib-get-json()
and
apib-get-json-schema()
to get all json or json schema assets in
buffer called *apib-assets*
.
Key | Function | Description |
---|---|---|
C-c C-x p | apib-parse | Parse the API Blueprint |
C-c C-x v | apib-validate | Validate the API Blueprint |
C-c C-x j | apib-get-json | Print all generated JSON bodies |
C-c C-x s | apib-get-json-schema | Print all generated JSON Schemas |