This is the source code for the Goteo's API documentation
This documentation is mostly automated by reading the [swagger specs]({{ site.api_spec }}) from the api.
Swagger JSON files are needed to generate the documentation, they can be retrieved with the command generate_examples.sh:
./generate_examples.sh -u user:key -a https://api.goteo.org/v1/They'll be copied to the _json folder
For compilation we use Jekyll, install dependencies as the explain in Github and start a live preview with this command:
jekyll serveCompilation uses the downloaded JSON files in the _json folder. A custom plugin, _plugins/swagger_parser.rb, automatically parses the downloaded JSON files and adds its content to the Markdown templates.
Two task are configure for Rake:
-
Generates documentation as static, off-line HTML files into the
_simpledirectory:JEKYLL_ENV=simple rake doc:simple
-
And the automatic publication to the
gh-pagesbranch in Github (official documentation):rake doc:publish