Skip to content
Branch: master
Go to file
Code

Latest commit

w-vi committed c6dd052 Jan 1, 2020
fix: api-elements content type is an element not string
Retrieving assets was failing because content type is stored as an element with
content and not directly as string.

Files

Permalink
Failed to load latest commit information.

README.org

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
You can’t perform that action at this time.