0
0
Fork 0
Commit Graph

336 Commits

Author SHA1 Message Date
Daniel Wagner-Hall 1f5b6271f2 Generate swagger-ui output for client-server API
Depends on:
https://github.com/matrix-org/matrix-doc/pull/212
https://github.com/matrix-org/matrix-doc/pull/208
https://github.com/matrix-org/matrix-doc/pull/207
for the actual rendered output to not throw javascript errors at runtime.
2015-12-07 12:45:13 +00:00
Richard van der Hoff d1d3d27e2f Merge pull request #216 from matrix-org/rav/fix_speculator_redirects
Add a host and scheme to Location headers in redirects
2015-12-07 10:26:38 +00:00
Richard van der Hoff f31a053995 Add a host and scheme to Location headers in redirects
Our apache reverse-proxy can't correctly rewrite relative Location headers, so
add the Host from the request into the Location.
2015-12-06 18:26:56 +00:00
Matthew Hodgson 78e04d662e add moi :( 2015-12-04 18:32:01 +00:00
Richard van der Hoff 1b7548d460 Make the speculator serve the spec from drafts branches. 2015-12-04 17:03:33 +00:00
Daniel Wagner-Hall 2f3a00fe34 Consistently spell homeserver as homeserver 2015-12-02 19:23:33 +00:00
Daniel Wagner-Hall 1ce3357927 continuserv: serve multiple paths 2015-12-02 14:57:28 +00:00
Daniel Wagner-Hall 97fd1fdd62 Embed client and server release numbers
Note that this also removes the changelog - I'm going to re-add the
changelog differently soon.
2015-12-01 17:08:02 +00:00
Daniel Wagner-Hall ebed3b60bd Add trailing slashes to links 2015-12-01 15:58:15 +00:00
Daniel Wagner-Hall a4668c1d8c Fix typo 2015-12-01 14:21:20 +00:00
Daniel Wagner-Hall c4eaf7458f 302 to spec/head/index.html rather than serving it on /spec/head
Otherwise relative links are broken
2015-12-01 14:19:31 +00:00
Daniel Wagner-Hall 6c66bfc755 Flatten out v1 and v2_alpha directories
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.
2015-11-30 11:22:57 +00:00
Daniel Wagner-Hall e401d3e262 Merge pull request #184 from matrix-org/daniel/splitspec
Split spec into page-per-section
2015-11-27 16:46:06 +00:00
Daniel Wagner-Hall 30ed918633 speculator: Allow spec viewing for multi-page spec 2015-11-27 16:45:53 +00:00
Daniel Wagner-Hall e171acf01f Split spec into page-per-section 2015-11-27 16:45:47 +00:00
Daniel Wagner-Hall f0c99a6925 Generate API docs from swagger 2015-11-27 15:03:22 +00:00
Richard van der Hoff 2aa4773cc1 Make the speculator serve up errors as plain text
... so that they are legible.
2015-11-27 12:01:03 +00:00
Daniel Wagner-Hall ec31c0f518 speculator: allow styling like matrix.org 2015-11-26 12:04:37 +00:00
Daniel Wagner-Hall cc4869e68a Merge pull request #174 from matrix-org/daniel/speculatorhardening
Several improvements to speculator to prepare it for actually being used by the masses, not just us devs
2015-11-23 18:35:55 +00:00
Daniel Wagner-Hall c432396079 Add comment 2015-11-23 17:26:32 +00:00
Daniel Wagner-Hall 866fa58276 Rename 2015-11-23 17:22:53 +00:00
Daniel Wagner-Hall e045f28b44 Pull out constant for permissions
Also, drop permissions from 0755 to 0700
2015-11-23 17:20:54 +00:00
Oddvar Lovaas 24356d864e Merge pull request #176 from matrix-org/daniel/gendoc
Tweaks to spec generation for matrix.org
2015-11-23 10:28:51 +00:00
Daniel Wagner-Hall 4ac85997f5 Fix check 2015-11-19 18:16:02 -05:00
Daniel Wagner-Hall da93317a78 Take dir not files as args 2015-11-19 18:13:40 -05:00
Daniel Wagner-Hall ca3a9e3562 exec gendoc outside of script 2015-11-19 17:38:54 -05:00
Daniel Wagner-Hall e041033048 Rename file 2015-11-19 17:38:49 -05:00
Daniel Wagner-Hall 8586744771 Add anchors to spec
This is currently done by a script on the prod serving machine.

We might as well keep the matrix.org spec and dev spec as similar as
possible.
2015-11-19 16:41:58 -05:00
Daniel Wagner-Hall 6f1d00097b Only bother trying to fetch if we need to 2015-11-19 16:15:13 -05:00
Daniel Wagner-Hall 8872e17f93 Fall back to last known HEAD sha if fetch fails 2015-11-19 16:14:22 -05:00
Daniel Wagner-Hall dd53847211 Include command stderr in error text 2015-11-19 16:11:19 -05:00
Daniel Wagner-Hall 9ad64b02d1 speculator: guard against concurrent git commands 2015-11-19 15:41:15 -05:00
Daniel Wagner-Hall 0f0359d9c1 speculator: Nessle up some more if statements 2015-11-11 15:13:34 +00:00
Daniel Wagner-Hall 740cc66a7c speculator: Fetch before deciding head is fresh 2015-11-11 14:01:45 +00:00
Daniel Wagner-Hall 27ffe7bacd Don't serve rst diffs as HTML 2015-11-10 15:35:10 +00:00
Daniel Wagner-Hall c3608b3a69 Merge branch 'master' into daniel/continuservconcurrency
Conflicts:
	scripts/continuserv/main.go
2015-11-09 16:11:34 +00:00
Daniel Wagner-Hall bbf9e229a7 continuserv: guard concurrent accesses to wg 2015-11-06 16:09:09 +00:00
Daniel Wagner-Hall 1be5b856bd Preserve text/plain for errors
Newlines are nice
2015-11-06 16:05:07 +00:00
Daniel Wagner-Hall 7f6eafdce5 continuserv: set Content-Type header 2015-11-06 14:46:55 +00:00
Daniel Wagner-Hall 937ff046d8 Force / to be HTML too 2015-11-05 19:21:16 +00:00
Daniel Wagner-Hall 559747e77a speculator: Sent Content-Type: text/html header
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.
2015-11-05 19:18:28 +00:00
Mark Haines 71874870c8 Enable syntax highlighting for example http requests 2015-10-26 17:25:33 +00:00
Daniel Wagner-Hall 1aeddac319 Cache spec output
Does not cache inability to generate spec. Does not cache diffs or
anything fancy. Just the raw spec generation.
2015-10-26 10:28:14 +00:00
Mark Haines df443c10ac Move css into a css subdirectory.
Add css to put a bar next to blockquotes.
2015-10-23 11:58:06 +01:00
Daniel Wagner-Hall 82d4ea199f Trust Leo 2015-10-22 16:09:01 +01:00
Kegsay e5559e4ea5 Merge pull request #106 from matrix-org/erikj/newline_gendoc_STOP_BEING_CRANKY
gendoc should just add newlines rather than complaining about the lack thereof
2015-10-15 09:56:04 +01:00
Erik Johnston 70704240dc gendoc should just add newlines rather than complaining about the lack thereof 2015-10-14 16:29:18 +01:00
Richard van der Hoff 013b6db895 Add a note on building the speculator
... because the wiki says you need to read the README on how to build it.
2015-10-14 14:42:52 +01:00
Richard van der Hoff 270e1d7aa8 Add richvdh to list of trusted pushers for spectulator
richvdh is awesome, he should have all the permissions.
2015-10-14 14:29:36 +01:00
Oddvar Lovaas 1cfe4f784f special css for spec/howto 2015-10-12 19:57:41 +01:00
Oddvar Lovaas ceebf34fca generate docs with new nav bar 2015-10-12 19:11:35 +01:00
Daniel Wagner-Hall 6922850643 Add missing return 2015-10-09 11:02:27 +01:00
Daniel Wagner-Hall b46f0e30b8 Checkout SHA of origin/master rather than merging 2015-10-09 11:02:00 +01:00
Daniel Wagner-Hall a0cf485919 speculator: Specify merge target 2015-10-09 10:43:27 +01:00
Kegan Dougal 7805ca87df If build.py throws, actually print stdout. Also run jenkins.sh in verbose mode. 2015-10-07 10:34:29 +01:00
Kegsay 8c092e3d11 Merge pull request #74 from matrix-org/module-presence
Presence module
2015-10-02 16:24:53 +01:00
Daniel Wagner-Hall 7df3d9090a Merge pull request #81 from matrix-org/daniel/speculatormerge
speculator: Merge after fetching, so that /spec/head works
2015-10-02 07:33:34 -05:00
Daniel Wagner-Hall 0e8f1b5475 Quote args 2015-10-02 07:33:26 -05:00
Daniel Wagner-Hall a69e03f577 speculator: Report listening port 2015-10-01 19:15:30 -05:00
Daniel Wagner-Hall 30232f20aa speculator: Merge after fetching, so that /spec/head works 2015-10-01 19:13:09 -05:00
Kegan Dougal cc6f256b24 Merge branch 'master' into module-presence
Conflicts:
	specification/modules/presence.rst
2015-10-01 15:46:52 +01:00
Kegsay f74cb4d54c Merge pull request #76 from matrix-org/speculator-speedup
Modify how speculator uses git repos
2015-09-30 15:53:25 +01:00
Kegan Dougal b6f0b67da6 Speed up continuserv
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.
2015-09-30 15:21:32 +01:00
Kegan Dougal ede43fbe9f Modify how speculator uses git repos
Modified so it has a "master" repo and local A/B repos which pull from the
"master". This saves an extra git clone operation per HTTP request.
2015-09-30 14:31:26 +01:00
Kegan Dougal 52f6496cf0 Merge branch 'master' into module-presence 2015-09-30 10:56:17 +01:00
Kegan Dougal a49d5f67f1 Delete rather than comment out the offending CSS 2015-09-30 10:54:06 +01:00
Kegan Dougal 4e1e82f995 Fix paragraph CSS and adjust where paragraphs are in the RST
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.
2015-09-30 10:43:02 +01:00
Kegan Dougal 0a04672d76 Start converting the presence module. Add Rationale admonition. 2015-09-29 17:57:44 +01:00
Daniel Wagner-Hall 083a76096f Support viewing the spec at head 2015-09-29 12:41:07 +01:00
Daniel Wagner-Hall 2434dfaf1c Merge branch 'master' into speculator-htmldiff 2015-09-25 16:13:23 +01:00
Kegan Dougal 6afdfc0771 Add more logging and make logging context clearer
This is now actually useful if you want to debug why your swagger YAML
isn't producing a table you think it should be.
2015-09-23 15:36:13 +01:00
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
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 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 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
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
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
Kegan Dougal 8590cc84b5 Process and extract targets in gendoc.py 2015-09-21 15:33:28 +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
Kegsay 5fbd534713 Merge pull request #51 from matrix-org/daniel/gendoc
Print errors to stderr
2015-09-18 15:50:56 +01:00
Kegan Dougal cf8abdafd4 Fix PR comments 2015-09-18 15:42:49 +01:00
Kegan Dougal ba4998a62b Apparently tabs are A Thing 2015-09-18 15:15:55 +01:00
Kegan Dougal 427e4c8b1b Log port being listened on 2015-09-18 15:15:55 +01:00
Kegan Dougal 1f6b12b3e8 Modify and enforce the file format/structure used
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
2015-09-18 11:43:53 +01:00
Kegan Dougal 06e46c1899 Fix on a better numbering format 2015-09-18 11:20:34 +01:00
Kegan Dougal ef473b4161 Start enforcing title styles
This depends on the number of the file.
2015-09-18 11:05:48 +01:00
Daniel Wagner-Hall 08defafd98 Print errors to stderr
This means that continuserv will actually display them
2015-09-18 10:26:13 +01:00
Kegan Dougal ad26b7f8cb Fix a subtle rendering bug when catting spec sections
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(!)
2015-09-18 10:03:58 +01:00
Kegan Dougal 9c3a333a6d Apparently tabs are A Thing 2015-09-17 15:49:01 +01:00
Kegan Dougal 9b18fd252e Log port being listened on 2015-09-17 15:46:37 +01:00
Daniel Wagner-Hall 21411309e0 Fix chdir path 2015-09-15 16:27:10 +01:00
Mark Haines c3eab1cc3c Set the current working directory in gendoc.py to the script directory as that is where it expects to be run 2015-09-15 11:41:40 +01:00
Daniel Wagner-Hall c55917d99c Add spec diff to index page 2015-09-14 11:08:16 +01:00
Daniel Wagner-Hall 521d625aac Fix typo 2015-09-14 11:06:57 +01:00
Daniel Wagner-Hall d9013cab5f speculator: Add HTML diffing
I started fiddling with re-implementing the perl script in Go to add
some new functionality (and avoid the Perl), but it's not yet usable
2015-09-14 11:03:54 +01:00
Daniel Wagner-Hall d251f791fb speculator: Document / 2015-09-11 17:15:33 +01:00
Daniel Wagner-Hall f9ef934625 Merge branch 'master' into speculator-list
Conflicts:
	scripts/speculator/main.go
2015-09-11 15:31:32 +01:00
Kegsay e4f4670260 Merge pull request #44 from matrix-org/speculator-errs
speculator: Don't ignore errors
2015-09-11 15:30:15 +01:00
Daniel Wagner-Hall b6dab0009d speculator: Don't ignore errors 2015-09-11 14:43:26 +01:00
Daniel Wagner-Hall 20f0284155 speculator: Unified diff for rst diff 2015-09-11 14:40:52 +01:00
Daniel Wagner-Hall ba780a589a speculator: Add list-pull-request functionality 2015-09-11 14:40:08 +01:00
Daniel Wagner-Hall fef97802b7 Merge pull request #39 from matrix-org/speculator
speculator: Tool to preview spec pull requests
2015-09-11 12:43:33 +01:00
Daniel Wagner-Hall bf318ffcd5 Add HTTP endpoints to README 2015-09-11 12:42:41 +01:00
Daniel Wagner-Hall ca7dd49dc6 speculator: Add /healthz endpoint 2015-09-10 17:14:53 +01:00
Daniel Wagner-Hall 708f281270 Add comments about auth 2015-09-10 17:09:44 +01:00
Kegsay c427c579cb Merge pull request #37 from matrix-org/continuserv
continuserv: Server to live serve local updates to the spec
2015-09-10 16:17:33 +01:00
Daniel Wagner-Hall c29aef362e Error on failure of Watcher.Add 2015-09-10 15:45:21 +01:00
Daniel Wagner-Hall 6ac519d9dc Log on file updates 2015-09-10 14:25:37 +01:00
Daniel Wagner-Hall 6e86cb34d2 continuserv: Adding README 2015-09-10 14:25:23 +01:00
Daniel Wagner-Hall 34091038f3 speculator: Tool to preview spec pull requests
Not the prettiest thing in the world, and horribly unperformant, but
useful :)
2015-09-10 14:19:06 +01:00
Daniel Wagner-Hall cdc06a8bf1 Document --nodelete 2015-09-10 13:53:38 +01:00
Daniel Wagner-Hall a74fb54053 Correct comment 2015-09-10 13:44:41 +01:00
Daniel Wagner-Hall ad595aea45 Optionally don't delete intermediate rst files
Useful for debugging
Hackily hackily implemented :)
2015-09-10 13:21:08 +01:00
Daniel Wagner-Hall e30272733b continuserv: Make port flag-specified 2015-09-10 11:29:16 +01:00
Daniel Wagner-Hall c4acee3bcb continuserv: Live serves updates to the spec 2015-09-10 11:16:31 +01:00
Daniel Wagner-Hall 0414ff4cc3 Output error if command fails 2015-09-07 16:27:18 +01:00
Kegan Dougal e572cc662a Restructure the first few sections.
Remove unecessary sections; put presnece/profile sections on the right level.
Move Living Standard warning to the top of the Introduction section.
2015-06-02 16:27:52 +01:00
Kegan Dougal bb9537b824 Add a CHANGELOG. Modify table CSS.
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.
2015-06-01 17:48:16 +01:00
Kegan Dougal f9710a6e17 Add help blurb to gendoc.py 2015-05-28 14:16:57 +01:00
Kegan Dougal 5b31c442f5 Completely split up the templating system from the Matrix Spec template code.
The two are now linked together in build.py by specifying the input module.
Updated gendoc.py to specify the right module.
2015-05-26 16:20:15 +01:00
Kegan Dougal 96671ce833 Use the templating system to set {{git_version}}. Restructure sections code.
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.
2015-05-26 14:33:32 +01:00
Kegan Dougal dc5c01607b Sort out table layout and rejig where state_key is placed. 2015-05-26 10:40:04 +01:00
Kegan Dougal 02c44a889e Remove stuff from 20_events.rst and replace with {{room_events}}. Update gendoc to call build.py for template vars. 2015-05-20 15:40:06 +01:00
Matthew Hodgson d40f6c1d7c lots of fixes based on kegan's review of https://github.com/matrix-org/matrix-doc/pull/13 2015-03-19 14:20:58 +01:00
Matthew Hodgson 598e9b3113 big reshuffle:
* 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.
2015-03-16 00:14:03 -04:00
Kegan Dougal a6fa4e53fb Update gendoc.py
Copy howto to tmp/ so the $GIT_VERSION can be dropped in.
2015-02-20 11:25:05 +00:00
Kegan Dougal 505c804426 Update scripts to look in the right places. Update jsfiddles to be more obvious in the HOWTO. 2015-02-20 10:49:36 +00:00
Kegsay 6af1627b51 Minor tweak for matrix.org example 2015-02-19 17:16:59 +00:00
Kegan Dougal 1388612c48 Add a README, spell matrix correctly. 2015-02-19 16:53:54 +00:00
Kegan Dougal 4b0e858529 Add $GIT_VERSION to the spec which is replaced by the gendoc script. 2015-02-19 16:32:45 +00:00
Kegan Dougal df448df813 Redo gendoc script. 2015-02-19 16:00:21 +00:00
Matthew Hodgson 3c16dbd63b it's 2015 2015-01-14 20:54:25 +00:00
Matthew Hodgson 9de59e3777 move gendoc to matrix-doc and make it work. rename tutorials section to match matrix.org structure 2014-10-17 02:33:35 +01:00