subosito / iglo

API blueprint's formatter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iglo

API blueprint's formatter.

Build Status

Status

DEPRECATED. Please use https://github.com/subosito/snowboard instead.

Writing API documentation

For writing API documentation, the iglo using API Blueprint syntax. You can read about its specification.

Here's the example:

FORMAT: 1A
HOST: https://api.example.com/v1

# Hello API

A simple API demo

# Group People

This section describes about the People

## Person [/people/{id}]

Represent particular Person

+ Parameters

    + id (required, string, `123`) ... The id of the Person.

+ Model (application/json)

    ```
    {"name":"Gesang","birthdate":"01-09-1917"}
    ```

### Retrieve Person [GET]

Return the information for the Person

+ Request (application/json)

    + Headers

        ```
        Authorization: Basic AbcdeFg=
        ```

+ Response 200 (application/json)

    [Person][]

Demo

Make sure you have iglo installed in the GOPATH

$ cd $GOPATH
$ go get github.com/subosito/iglo

Serving as HTTP

You can go to the examples/api-server directory and then run the main.go.

$ cd examples/api-server
$ go run main.go

Then visit http://localhost:8080/ to see the output.

Or, you can just visit this demo page :)

Exporting as HTML file

You can go to the examples/api-exporter directory and then run the main.go.

$ cd examples/api-exporter
$ go run main.go -out "api-output.html"

Now you have HTML generated output in the api-output.html.

Dependencies

The iglo ParseMarkdown requires drafter to be installed. Refer to the drafter page for the installation details.

Related Projects

About

API blueprint's formatter

License:MIT License


Languages

Language:Go 100.0%