-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate current API tool documentation (#2169)
* Combine api tool documentation and create basic doc structure. * Update links to point to consolidated API document * Employ technical writing best practices * Add a link to API Blueprint * Fix link syntax * Fix build * Turn vale off for "Apiary" This may or may not work See errata-ai/vale#340 * Revert "Turn vale off for "Apiary"" This reverts commit 7afc314. * Add exception * Update link text --------- Co-authored-by: Sam Wright <[email protected]>
- Loading branch information
1 parent
53c1a42
commit a5c1c23
Showing
9 changed files
with
123 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
======================= | ||
API documentation tools | ||
======================= | ||
|
||
Specialized descriptive languages help when writing API documentation. | ||
Some of our favorite descriptive languages include: | ||
|
||
* :ref:`blueprint` | ||
* Swagger | ||
|
||
When specifying a descriptive language for your API, you'll also need tools to create engaging | ||
documents. Several tools work best with our favorite descriptive languages: | ||
|
||
* :ref:`apiary-overview` | ||
* Aglio | ||
* :doc:`Sphinx </guide/tools/sphinx>` | ||
|
||
.. _apiary-overview: | ||
|
||
Apiary | ||
~~~~~~ | ||
|
||
Apiary is a service that allows you to edit and host documentation online. | ||
|
||
Hosting Apiary docs | ||
------------------- | ||
|
||
Apiary provides a service for creating and hosting API documentation described in the :ref:`blueprint` | ||
or Swagger format. Once the API description is complete, Apiary generates interactive documentation in a | ||
three column layout. Example requests and responses are shown for every endpoint in multiple | ||
programming languages. It also enables the user to make requests to your live API. | ||
|
||
.. _apiary-building-docs: | ||
|
||
Building Apiary docs | ||
-------------------- | ||
|
||
To build Apiary docs locally, follow these steps: | ||
|
||
1. `Install the Apiary CLI Tools. <https://help.apiary.io/tools/apiary-cli/>`_ | ||
2. Navigate to the directory containing your ``.apib`` file. | ||
3. Run the following to validate your ``.apib`` file and create the HTML file:: | ||
|
||
apiary preview --path="myfile.apib" --output="myfile.html" | ||
|
||
4. View the document in your browser. | ||
|
||
.. _blueprint: | ||
|
||
API Blueprint | ||
~~~~~~~~~~~~~ | ||
|
||
API Blueprint is a high-level language for describing web APIs. The goal of the API Blueprint format | ||
is to support the design-first philosophy for REST APIs; however, the format also works for | ||
documenting existing APIs. The files are saved with a `.apib` extension. | ||
|
||
The syntax combines Markdown syntax and Markdown Syntax for Object Notation (MSON). Markdown is a | ||
lightweight text formatting syntax and `MSON <https://github.com/apiaryio/mson>`_ is an extension | ||
of Markdown for describing data objects. | ||
|
||
Getting started with API Blueprint | ||
---------------------------------- | ||
|
||
The quickest way to get started with API Blueprint is to use `Apiary <https://apiary.io/>`_ to edit and view your | ||
documentation by following these steps: | ||
|
||
1. Sign up for an account `on Apiary. <https://login.apiary.io/register>`_ | ||
2. Follow the `API Blueprint Tutorial. <https://apiblueprint.org/documentation/tutorial.html>`_ to describe an API. | ||
|
||
Writing API Blueprint docs | ||
-------------------------- | ||
|
||
The structure for an ``.apib`` file is:: | ||
|
||
Metadata | ||
API Name | ||
Resource Group | ||
Resource | ||
Action | ||
Action | ||
Resource | ||
Resource Group | ||
Data Structures | ||
|
||
``Metadata``: | ||
describes the API Blueprint version | ||
|
||
``API Name``: | ||
your API name | ||
|
||
``Resource Groups``: | ||
describes a collection of related API endpoints | ||
|
||
``Resources``: | ||
describes a specific API endpoint | ||
|
||
``Actions``: | ||
describes specific HTTP verb actions to an endpoint | ||
|
||
``Data Structures``: | ||
describes data used in your API requests/responses. By defining them in a separate section, they | ||
can easily be reused. | ||
|
||
Building API Blueprint docs | ||
--------------------------- | ||
|
||
The two most popular tools for generating documents from API Blueprints are :ref:`Apiary <apiary-building-docs>` and | ||
`Aglio <https://github.com/danielgtaylor/aglio>`_. | ||
|
||
Testing API docs | ||
~~~~~~~~~~~~~~~~ | ||
|
||
When specifying an API in a descriptive language, you don't have to manually | ||
validate your documents. Tools like Dredd can test your documentation against the live API. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ level: error | |
scope: heading | ||
match: $sentence | ||
exceptions: | ||
- Apiary | ||
- API | ||
- API Blueprint | ||
- ARID | ||
|