You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
matrix-spec/scripts/speculator
Richard van der Hoff 1320a86cbe Serve the api docs from the speculator
There are a few parts to this:

* when we generate the spec for a particular git sha, also run the script which
  turns our yaml api descriptions into a swagger json file.

* tweak serveSpec to add another header when serving the generated json.

* add a link to the generated index which will (via js hackery) redirect to our
  hosted swagger UI at http://matrix.org/docs/api/client-server, with a "url"
  query-param pointing at the generated json.

Also, factor makeTempDir out of gitClone, so that we can give clearer log lines.
8 years ago
..
README Cache spec output 9 years ago
htmldiff.pl speculator: Add HTML diffing 9 years ago
main.go Serve the api docs from the speculator 8 years ago

README

speculator allows you to preview pull requests to the matrix.org specification.

It serves the following HTTP endpoints:
 - / lists open pull requests
 - /spec/123 which renders the spec as html at pull request 123.
 - /diff/rst/123 which gives a diff of the spec's rst at pull request 123.
 - /diff/html/123 which gives a diff of the spec's HTML at pull request 123.

The build or run, you need a working `go` installation.
Then fetch dependencies:
 ` go get github.com/hashicorp/golang-lru`

To run it, then run:
 `go run main.go`

To build the binary (which is necessary for deployment to the matrix.org
servers), you must again install `go` and dependencies, and then run:
 `go build`