Skip to content

Instantly share code, notes, and snippets.

@zdne
Last active January 4, 2016 03:08
Show Gist options
  • Save zdne/8559416 to your computer and use it in GitHub Desktop.
Save zdne/8559416 to your computer and use it in GitHub Desktop.

How to convert a legacy Apiary Blueprint to API Blueprint using CLI

CLI Tools Required

Install following CLI tools:

  1. Apiary Blueprint Parser

    $ npm install apiary-blueprint-parser

    NOTE: Requires local installation of Node.js (>0.8)

  2. Apiary Blueprint AST Convertor

    $ gem install apiary_blueprint_convertor
  3. Matter Compiler

    $ gem install matter_compiler

Convert an Apiary Blueprint

Given a legacy Apiary bluerpint file legacy_blueprint.apib run the following

$ node_modules/apiary-blueprint-parser/bin/blueprint-parser legacy_blueprint.apib | apiary_blueprint_convertor | matter_compiler --format json > new_blueprint.md

Notes

Not tested on Windows.

@jrep
Copy link

jrep commented Jan 30, 2014

This pipeline does not insert FORMAT: 1A at the top. Shouldn't it?

@zdne
Copy link
Author

zdne commented Feb 7, 2014

@jrep

I have just released matter_compiler v0.3.0 which introduce the --set-blueprint-format option.

$ matter_compiler no-format.yaml 
# My API

and

$ matter_compiler no-format.yaml --set-blueprint-format
FORMAT: 1A

# My API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment