Code Monkey home page Code Monkey logo

snowcrash's Introduction

logo

Snow Crash Build Status

API Blueprint Parser

Snow Crash is the reference API Blueprint parser built on top of the Sundown Markdown parser.

API Blueprint is Web API documentation language. You can find API Blueprint documentation on the API Blueprint site.

Status

Install

OS X using Homebrew:

$ brew install --HEAD \
  https://raw.github.com/apiaryio/snowcrash/master/tools/homebrew/snowcrash.rb

Other systems refer to build notes.

Use

C++ library

#include "snowcrash.h"

mdp::ByteBuffer blueprint = R"(
# My API
## GET /message
+ Response 200 (text/plain)

        Hello World!
)";

snowcrash::ParseResult<snowcrash::Blueprint> ast;
snowcrash::parse(blueprint, 0, ast);

std::cout << "API Name: " << ast.node.name << std::endl;

Refer to Blueprint.h for the details about the Snow Crash AST and BlueprintSourcemap.h for details about Source Maps tree. See Snow Crash bindings for using the library in other languages.

Command line tool

$ cat << 'EOF' > blueprint.apib
# My API
## GET /message
+ Response 200 (text/plain)

        Hello World!
EOF

$ snowcrash blueprint.apib 
_version: 2.1
metadata:
name: "My API"
 ...

Refer to AST Serialization Media Types for the details on serialized media types. See parse feature for the details on using the snowcrash command line tool.

Build

  1. Clone the repo + fetch the submodules:

    $ git clone --recursive git://github.com/apiaryio/snowcrash.git
    $ cd snowcrash
  2. Build & test Snow Crash:

    $ ./configure
    $ make test

    To include integration tests (using Cucumber) use the --include-integration-tests flag:

    $ ./configure --include-integration-tests
    $ make test

We love Windows too! Please refer to Building on Windows.

Snow Crash command line tool

  1. Build snowcrash:

    $ make snowcrash
  2. Install & use snowcrash:

    $ sudo make install
    $ snowcrash --help

Bindings

Snow Crash bindings in other languages:

Contribute

Fork & Pull Request

If you want to create a binding for Snow Crash please refer to the Writing a Binding article.

License

MIT License. See the LICENSE file.

snowcrash's People

Contributors

zdne avatar pksunkara avatar alikh31 avatar kuangmarkeleven avatar klokane avatar kuba-kubula avatar kylef avatar abtris avatar almad avatar andreasrs avatar bensleveritt avatar honzajavorek avatar lfaraone avatar fosrias avatar ryansb avatar samuelmarks avatar tnewmandenso avatar wilmoore avatar

Watchers

Bruce White avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.