Commit graph

602 commits

Author SHA1 Message Date
Kegan Dougal
f1adad5fb3 Add more logging with file prefixes
This makes the handoff between gendoc and batesian clearer in the logs.
2015-09-23 15:10:55 +01:00
Kegan Dougal
064a2c9172 Use argparse and log functions for gendoc.py
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`.
2015-09-23 14:59:57 +01:00
Kegsay
14e77b09ab Merge pull request #59 from matrix-org/spec-restructure-modules
Add spec build targets; restructure spec
2015-09-23 14:38:25 +01:00
Kegan Dougal
1da64db302 Use relative depths for groups instead of absolute ones
This means the group can be agnostic to how deeply nested it is,
improving reusability of groups.
2015-09-23 14:29:37 +01:00
Kegan Dougal
29bae15790 Fix typo 2015-09-23 11:30:07 +01:00
Kegan Dougal
5115346297 Add instant_messaging module; modify batesian section rules
Previously, all `m.room.*` events were wodged into `{{room_events}}` which
isn't great when you want to pull specific ones out. Batesian had a 1:1
mapping of `render_foo()` to a section `{{foo}}`, and having to constantly
add functions for new types is a PITA. Batesian now supports returning a
`dict` instead of a section `string` where the keys are the `{{foo}}` and
the value is what will be inserted. Also add conflicting section key checks
to avoid multiple definitions of the same `{{foo}}`. Define dicts for
event schemata and swagger HTTP APIs.

Using this new feature, split out the instant messaging stuff from the events
section, and replace `{{room_events}}` with a list of specific events e.g.
`{{m_room_member_event}}`.
2015-09-23 10:48:49 +01:00
Kegan Dougal
5b134119bd Add presence module; fix relative title bug
If a relative title appeared after an HTTP API table, it
would insert the wrong level because it thought that part
of the table was a title.
2015-09-23 09:59:54 +01:00
Kegan Dougal
b49cb57fe5 Move events sections to CS API 2015-09-22 17:32:31 +01:00
Kegan Dougal
16693a644a Various review fixes 2015-09-22 16:59:49 +01:00
Kegan Dougal
b21859836d Print stdout of build.py in verbose mode 2015-09-22 16:11:16 +01:00
Kegan Dougal
388aeefac0 Remove obsolete key 2015-09-22 16:07:19 +01:00
Kegan Dougal
b0eb985523 Merge branch 'master' into spec-restructure-modules 2015-09-22 16:04:41 +01:00
Kegsay
895ffcfcde Merge pull request #56 from matrix-org/markjh/document_v1_rooms_api
Document the getters for the /rooms/{roomId} APIs
2015-09-22 16:03:45 +01:00
Kegan Dougal
056b5eba22 Partially handle representing top-level array responses
If an HTTP API returned a top-level array response, the templating system
would fail to create a table for it. This is now partially fixed by pulling
out the type of the elements (no recursion is done to populate nested tables)
2015-09-22 16:01:22 +01:00
Kegan Dougal
0c0ac3e814 Fix common event fields template to use subtitle char 2015-09-22 14:07:23 +01:00
Kegan Dougal
e8cdfcbba2 Rename spec files to not have numbers everywhere; update targets.yaml 2015-09-22 14:01:55 +01:00
Kegan Dougal
f71763b0d3 Implement relative title styles
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.
2015-09-22 13:08:15 +01:00
Mark Haines
98d91d0c2b Make the example room id more "random" so that people are less likely to think that it is supposed to be human readable 2015-09-21 17:31:35 +01:00
Mark Haines
f60190086a Describe the behaviour of /rooms/{roomId}/member when the user has left the room 2015-09-21 17:30:10 +01:00
Kegan Dougal
067363c629 Get the desired title levels right; print out the actual level used to stdout 2015-09-21 17:21:08 +01:00
Mark Haines
ba6c7d267c SPEC-216: Document the behaviour of the room getters when the user has left the room 2015-09-21 17:21:01 +01:00
Mark Haines
615a9575cb SPEC-216: Clarify when the room getters will return 403 2015-09-21 17:12:29 +01:00
Mark Haines
cb41adee70 Fix the swagger host to be "localhost:8008" so that it can be used in a "Try it now" setup against localhost 2015-09-21 17:10:23 +01:00
Kegan Dougal
d5e0115e42 Merge branch 'master' into spec-restructure-modules 2015-09-21 16:55:24 +01:00
Kegan Dougal
65ce95249f cat the spec according to the build target. Remove old checks as they are now obsolete since we don't care about the filename 2015-09-21 16:54:30 +01:00
Mark Haines
2efadea583 Merge branch 'master' into markjh/document_v1_rooms_api 2015-09-21 16:35:31 +01:00
Kegan Dougal
8590cc84b5 Process and extract targets in gendoc.py 2015-09-21 15:33:28 +01:00
Kegsay
83ee385543 Merge pull request #55 from matrix-org/markjh/codehighlighting
Turn on code highlighting for HTTP api responses
2015-09-21 15:23:13 +01:00
Mark Haines
a64125772f Merge pull request #58 from matrix-org/markjh/jenkins
Add the jenkins command to git so that we can update it
2015-09-21 15:22:38 +01:00
Mark Haines
2c31731262 Add the jenkins command to source control so that we can update
it without having to fiddle with the jenkins UI.

It also allow us to move files without breaking the CI since we
won't be hard coding the locations of scripts in the jenkins UI.
2015-09-21 15:19:09 +01:00
Mark Haines
738b24d028 Merge pull request #57 from matrix-org/markjh/example_checker
Python script for checking that the examples match the event schema.
2015-09-21 15:07:57 +01:00
Mark Haines
8974b2b67b Skip files that start with ".", e.g. vim swp files. 2015-09-21 15:05:10 +01:00
Mark Haines
6ba9b29b3b Report all the errors in schemas/check_examples, not just the first error. 2015-09-21 15:04:03 +01:00
Kegan Dougal
568982ee2e Represent nested deps in targets.yaml along with title styles
This will allow us to programatically position .rst snippets *anywhere*
which will for once and for all remove the horrid title level mismatch bugs.

We require this in order to allow people to re-shuffle the spec without
having to adjust the spec itself (e.g. 2 targets with different levels of
nesting).
2015-09-21 14:49:54 +01:00
Kegan Dougal
703f913a47 Add a 'targets.yaml' files in /specification
We're well beyond the point now where a simple `cat` of .rst files to "build"
the spec is practical. We may want to slice and dice the spec in different
ways to address various cross-cutting concerns. To this end, there is now a
'targets' file which contains the "build targets" for the spec, which contains
the sorting order for the .rst files. For now, we just have a single
target: 'main'.
2015-09-21 14:31:57 +01:00
Kegan Dougal
f520ac9d82 Create a modules folder to group together similar parts of the spec 2015-09-21 14:25:52 +01:00
Kegan Dougal
c77ef1a2cc Add stub files feature_profiles and modules 2015-09-21 14:17:31 +01:00
Kegan Dougal
f2c952ec58 Reshuffle spec into sections roughly right as per PR #52 2015-09-21 14:13:18 +01:00
Mark Haines
52640eb205 Add a python script for checking that the examples match the event
schema.

Does the same checks as check.sh, but is a *lot* faster making it
suitable for using as a pre-commit hook.

I don't suggest replacing check.sh since it's good to check that the
schema works with multiple implementations of jsonschema.
2015-09-21 13:02:37 +01:00
Mark Haines
6a2c4d27fc Update the docs for room v1 api 2015-09-18 17:58:44 +01:00
Mark Haines
f33c0846c3 Merge remote-tracking branch 'origin/master' into markjh/document_v1_rooms_api 2015-09-18 17:38:03 +01:00
Mark Haines
6b5b8432b3 Turn on code highlighting for HTTP api responses and add a
code highlighting stylesheet for the specification.
2015-09-18 17:26:10 +01:00
Mark Haines
d2e39095fe Merge pull request #54 from matrix-org/markjh/swagger_examples
Add script to check the example responses match the schema.
2015-09-18 16:37:07 +01:00
Mark Haines
f827765ba1 Make to code to skip checking swagger responses which don't have an
application/json example clearer.
2015-09-18 16:35:27 +01:00
Mark Haines
9896f98e2b Search for yaml swagger files if check_examples.py is run without
arguments.
2015-09-18 16:21:48 +01:00
Mark Haines
7c2ccb1aeb Merge remote-tracking branch 'origin/master' into markjh/swagger_examples 2015-09-18 16:11:26 +01:00
Mark Haines
299a4356d4 Add script to check that the example responses in the swagger matches
the examples.
2015-09-18 16:10:21 +01:00
Kegsay
5fbd534713 Merge pull request #51 from matrix-org/daniel/gendoc
Print errors to stderr
2015-09-18 15:50:56 +01:00
Kegsay
f1da162a00 Merge pull request #53 from matrix-org/markjh/event-schema
Allow relative references to schema to work in python and node.
2015-09-18 15:50:13 +01:00
Mark Haines
7ac5c3766c Merge remote-tracking branch 'origin/master' into markjh/event-schema
Conflicts:
	templating/matrix_templates/units.py
2015-09-18 15:49:36 +01:00