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.
We're licensing hte spec under ASLv2. Add the LICENSE file, and add the
short-form to as much of the source as is practical right now (adding it to
json source is a massive pita).
Fix the speculator so that it doesn't blow up when it finds subdirs in the gen
directory.
(It doesn't handle the html diff very well in the case that the subdirs don't
match, but it's hard to do much about that)
I want to change the URLs for the spec sections on the website from
<version>/<section>.html to <section>/<version>.html, to better reflect how we
do the versioning.
This puts each bit of spec in its own directory, updates the index to point to
the right place, and fixes continuserv to deal with directories as well as
files.
This will probably require fixes to the speculator too, but I'll have to come
back to that.
Make the argument to dump-swagger.py be the name of the output file rather than
the output dir, and give it a sensible default.
Also, use the absolute path to the output file, so that the output path is
relative to the user's cwd rather than the templating dir.
rather than trying to watch half the filesystem, be a bit more conservative in
what we put watches on. This means that we don't end up dying with "No space on
device" (thanks for that, Linux.)
As a side effect, I got rid of all of the horrible symlinks and just put
in all of the proper relative paths. Because the horrible symlinks were
horrible.
Go is auto-detecting that this is XML (because for some reason we
generate XHTML), and serving it with a Content-Type header text/xml.
This causes the browser to render it as XHTML, which gives interesting
quirks like extra newlines.
This forces the browser to interpret it as HTML.
What we should probably do instead of stop generating XHTML and start
generating HTML. But in the mean time, this will fix the rendering
issues.
Ignore .git directory as that shouldn't affect spec generation. Also, when
we receive writes from the OS, wait a bit before re-generating the spec to
clump together multiple writes rather than re-generating one after another
and waiting for no more writes before serving the request.
The CSS for `nature.css` was such that it was preventing `p` tags from
having sufficient vertical whitespace. This meant that you couldn't insert
any kind of spacing between lengthy sections (they just appeared as new lines).
This PR fixes this so you can actually have some whitespace between paragraphs.
As a result of this change, some parts of the spec appeared to have too much
whitespace. These were often sections which shouldn't have begun a new
paragraph anyway (e.g. a single sentence being an entire paragraph, `TODO`
blocks resulting in new paragraphs). This PR fixes the most offending areas
where we shouldn't have been inserting new paragraphs.
gendoc.py has become more complex such that we actually want to pass things
to it like `--verbose`, `--nodelete`, `--target`, so use `argparse` to do this
like we have `build.py`. Pass through `-v` flags to `build.py`.
Templates don't know at what level they will be inserted. Previously, we
hard-coded the title style which is not compatible with the build target
system. Define a set of styles which will be replaced by the gendoc script
when it encounters them:
'<' : Make this title a sub-heading
'/' : Make this title a heading at the same level
'>' : Make this title a super-heading
The build target system is now basically complete and functioning.
Convert the file format to be of the form ##_##_something.rst where the
first ## is the top-level section number and the second ## is the
second-level section number, e.g. 07_01_push_cs_api.rst means
Section 7.1 - This is now enforced in gendoc.py along with the title line
style that should be used (= for top-level, - for 2nd level) which will
give helpful suggestions if you trip up. This feels much more intuitive
now looking in /specification
Throw in gendoc.py if a spec section doesn't end with \n\n
There needs to be TWO new lines at the end of each spec section else the
title of the next section merges into the last paragraph of the earlier
section. This happens without rst2html producing a warning, and results
in the section heading of a file disappearing(!)
Hook up templating system to read the CHANGELOG for version and changelog info.
Modified nature.css to make it clearer on table headings/sub-headings. Use the
full _matrix/client path on title links to make it clear it is for v1.
Restructured the sections code to be slightly more encapsulated than before.
This will be expanded to more clearly separate the templating system from
the specific implementation of the spec templates.
* try to make 00_basis slightly more accessible and less terse
* move CS API before Events, as it's meaningless to dive into specific events if you haven't been introduced to how the CS API works
* Try to improve the beginning of the CS API by merging back in some of kegan's original v1 content (which has subsequently been deleted somewhere along the line?)
* document m.presence event consistently
* move typing from drafts to spec
* move push stuff from drafts to spec
...and lots of other stuff
move push & typing from drafts into main spec.