Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds API Blueprint #313

Merged
merged 6 commits into from
Jun 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ RspecApiDocumentation.configure do |config|

# An array of output format(s).
# Possible values are :json, :html, :combined_text, :combined_json,
# :json_iodocs, :textile, :markdown, :append_json, :slate
# :json_iodocs, :textile, :markdown, :append_json, :slate,
# :api_blueprint
config.format = [:html]

# Location of templates
Expand Down Expand Up @@ -170,6 +171,7 @@ end
* **json_iodocs**: Generates [I/O Docs](http://www.mashery.com/product/io-docs) style documentation.
* **textile**: Generates an index file and example files in Textile.
* **markdown**: Generates an index file and example files in Markdown.
* **api_blueprint**: Generates an index file and example files in [APIBlueprint](https://apiblueprint.org).
* **append_json**: Lets you selectively run specs without destroying current documentation. See section below.

### append_json
Expand Down Expand Up @@ -204,7 +206,32 @@ rake docs:generate:append[spec/acceptance/orders_spec.rb]

This will update the current index's examples to include any in the `orders_spec.rb` file. Any examples inside will be rewritten.

### api_blueprint

This [format](https://apiblueprint.org) (APIB) has additional functions:

* `route`: APIB groups URLs together and then below them are HTTP verbs.

```ruby
route "/orders", "Orders Collection" do
get "Returns all orders" do
# ...
end

delete "Deletes all orders" do
# ...
end
end
```

If you don't use `route`, then param in `get(param)` should be an URL as
states in the rest of this documentation.

* `attribute`: APIB has attributes besides parameters. Use attributes exactly
like you'd use `parameter` (see documentation below).

## Filtering and Exclusion

rspec_api_documentation lets you determine which examples get outputted into the final documentation.
All filtering is done via the `:document` metadata key.
You tag examples with either a single symbol or an array of symbols.
Expand Down
Loading