matrix-doc/scripts
Richard van der Hoff b0ea6038c6 Move jekyll back out of matrix-doc again
Having the jekyll assets here is a mistake, because they need to be versioned
separately to the spec: we keep old versions of the spec, but they sometimes
need to be restyled to match the latest website.
2017-08-03 15:49:17 +01:00
..
continuserv Add continuserv index 2016-10-14 17:57:07 +01:00
contrib Add a nix-shell environment suitable for building 2016-08-30 21:26:35 -07:00
css Enable syntax highlighting for example http requests 2015-10-26 17:25:33 +00:00
speculator Serve the api docs from the speculator 2016-10-03 12:36:46 +01:00
README.md Add a nix-shell environment suitable for building 2016-08-30 21:26:35 -07:00
dump-swagger.py Use matrix.org for swagger UI 2016-10-14 17:56:26 +01:00
gendoc.py Hardcode client major version r0 2017-08-02 21:58:52 +01:00
generate-matrix-org-assets Move jekyll back out of matrix-doc again 2017-08-03 15:49:17 +01:00
swagger-http-server.py swagger-http-server: fix port param 2017-04-19 16:10:53 +01:00

README.md

Generating the HTML for the specification

Requirements:

  • docutils (for converting RST to HTML)
  • Jinja2 (for templating)
  • PyYAML (for reading YAML files)

Nix[2] users can enter an environment with the appropriate tools and dependencies available by invoking nix-shell contrib/shell.nix in this directory.

To generate the complete specification along with supporting documentation, run: python gendoc.py

The output of this will be inside the "scripts/gen" folder.

Matrix.org only ("gen" folder has matrix.org tweaked pages): ./matrix-org-gendoc.sh /path/to/matrix.org/includes/nav.html

Generating the Swagger documentation

Swagger[1] is a framework for representing RESTful APIs. We use it to generate interactive documentation for our APIs.

Swagger UI reads a JSON description of the API. To generate this file from the YAML files in the api folder, run: ./dump-swagger.py

By default, dump-swagger will write to scripts/swagger/api-docs.json.

To make use of the generated file, there are a number of options:

[1] http://swagger.io/ [2] https://nixos.org/nix/