Skip to content

w-vi/apib-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Blueprint Emacs major mode

https://travis-ci.org/w-vi/apib-mode.svg?branch=master https://melpa.org/packages/apib-mode-badge.svg

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

Installation

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))

Usage

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*.

Keybindings

KeyFunctionDescription
C-c C-x papib-parseParse the API Blueprint
C-c C-x vapib-validateValidate the API Blueprint
C-c C-x japib-get-jsonPrint all generated JSON bodies
C-c C-x sapib-get-json-schemaPrint all generated JSON Schemas