Commit graph

65 commits

Author SHA1 Message Date
Kévin Commaille
3adbfa30da
Look for examples in all possible locations (#2076)
We used to only look for examples in a few (sometimes arbitrary) places, and we didn't support showing several examples in most cases. This is intended to fix this. In the process we try to deduplicate code to make sure that we use the same logic everywhere.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-03-05 09:44:59 +00:00
Kévin Commaille
6f1e64cb12
Generate changelog release info with Hugo rather than when generating changelog (#2033) 2024-12-23 17:46:52 +00:00
Kévin Commaille
c16788f991
Remove trailing slash on void HTML elements (#2009)
According to the W3C's HTML validator, trailing slashes in void-element have no effect,
and might interact badly in some cases.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-11-20 18:21:25 -05:00
Kévin Commaille
69e162e5fe
Fix author links in the proposals lists (#1997)
Links were broken since the upgrade of the hugo version.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-11-20 12:33:22 +00:00
Kévin Commaille
9882d95775
Improve the quality of the rendered diagrams (#1999)
The first commit allows to lazy-load the diagrams, which should improve the loading time of the CS API on mobile. In the process it also improves the alt text of the images.

The second commit serves the diagrams as high-resolution WebPs. Encoding a high resolution diagram as WebP gives a file of approximately the same size as the lower resolution PNG. For maximum compatibility we also serve them as a lower resolution WebP and a fallback PNG. WebP was chosen because it is one of the export formats of draw.io/diagrams.net, and it is widely available in modern browsers.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-11-19 21:41:45 +00:00
Johannes Marbach
285cd2bda2
Sort VoIP events semantically (#1967) 2024-10-15 17:22:40 +01:00
Kévin Commaille
69d7dbf703
Remove span element from added-in and changed-in shortcodes (#1972) 2024-10-14 18:04:36 +01:00
Kévin Commaille
48afe4faa5
Remove withVersioning parameter of rver-fragment shortcode. (#1971) 2024-10-14 18:00:49 +01:00
Kévin Commaille
1e47d7ec48
Remove boxes/added-in-paragraph shortcode (#1970) 2024-10-14 17:57:33 +01:00
Johannes Marbach
c8ad740ba4
Use relative permalink to redirect to latest changelog (#1956) 2024-09-30 17:29:55 +01:00
Johannes Marbach
00af39ecca
Provide MD checklists for the changelog (#1937)
* Output changelog checklists

Fixes: #1682
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2024-09-27 13:00:00 +01:00
Kévin Commaille
e2cb3a739a
Fix ToC of spec proposals (#1885)
* Fix ToC of spec proposals

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-06-20 16:20:16 +00:00
Kévin Commaille
3af77f0cb4
Fix the table of content for room versions (#1884)
* Fix ToC for room versions pages

Like for the cs-module shortcode, use .RenderShortcodes
instead of .Content for the rver-fragment shortcode,
so the headings are detected by Hugo.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Change the way "this version" is detected in added-in and changed-in shortcodes

Now that we use .RenderShortcodes in the rver-fragment shortcode,
we cannot remove the output of these shortcodes dynamically
because they are replaced by a temporary placeholder due to Hugo's internals.

Instead, since the `this` parameter was only used for room version,
we always use the `v` parameter and compare with the version
provided in the page's front matter.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add version front matter for v11

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Update changelogs/room_versions/newsfragments/1884.clarification

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Travis Ralston <travpc@gmail.com>
2024-06-20 15:47:09 +00:00
Kévin Commaille
18628dc5d7
Allow to specify a prefix for generated HTML IDs of API endpoints (#1882)
* Allow to specify a prefix for generated HTML IDs of API endpoints

Allows to deduplicate IDs of duplicate endpoints

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-06-20 15:39:50 +00:00
Kévin Commaille
5fbfdd6821
Fix generated HTML (#1880)
* Add tr as child of thead in HTML tables

It is invalid HTML for th to be the direct children of thead

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Remove unnecessary HTML code end tag

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Avoid nesting p HTML elements

A p HTML element cannot contain other block elements,
so the "parent" element is closed when the first "child" one is opened.

We need to use Page.RenderString with options
to force Hugo to keep the wrapping p elements
even if the content contains a single paragraph.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add missing HTML details end tags

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Replace HTML a self-closing tag with start and end tags

The a element start and end tags are mandatory.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Replace obsolete HTML name attribute with id

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-06-20 09:42:40 +01:00
Kévin Commaille
784b8984f3
Generate ToC with Hugo rather than JavaScript (#1851)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-06-11 22:24:23 +01:00
Kévin Commaille
a0bc6e7f83
Add anchors in definition shortcode (#1802)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-04-30 16:52:23 +01:00
Kévin Commaille
e82829d4a2
Make resolve-allof partial recursive (#1787)
Makes it easier to use, like resolve-refs. It just needs to be called once.

Fixes an issue with m.call.* events not displaying the common fields

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2024-04-17 09:29:34 +01:00
Kévin Commaille
2678370f2c
Simplify uses of resolve-refs partial (#1773)
* Use the resolve-refs partial as soon as possible

Call it right after accessing the site.Data,
since it is recursing it will solve all references in the tree.
That way we don't need to wonder where to call it,
we trust the validators that the refs will be used in the right place.

* Enable strict $ref rule in OpenAPI validator

* Document use of $ref to compose examples

* Fix schema path in event-fields shortcode

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-04-09 18:06:53 +01:00
Kévin Commaille
575c84d431
Fix event-group shortcode for changes in resolve-refs partial (#1754)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-03-19 19:02:13 +00:00
Kévin Commaille
4d7e33ec26
Add support for $ref URIs containing fragments in OpenAPI definitions and JSON schemas (#1751)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-03-19 14:50:49 +00:00
Kévin Commaille
e40d9ca186
Fix rendering of m.receipt event in Client-Server API (#1637)
... and other improvements

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-09-27 12:42:14 +00:00
Kévin Commaille
99e2ff4927
Replace all mentions of Swagger by OpenAPI (#1633)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-09-19 18:26:07 +01:00
Kévin Commaille
45b6aaf07a
Upgrade Swagger data to OpenAPI 3.1 (#1310)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-07 13:16:29 +01:00
David Robertson
48459dee9b
Only include titles in summaries (#1549)
I previously made this change for HTTP endpoints in #1446. It seems there are
other places where we have over-sized `<summary>` elements. I would like
to elimintate those too, as grumbled about in
https://github.com/matrix-org/matrix-spec/issues/1358#issuecomment-1325220859
and
https://github.com/matrix-org/matrix-spec/issues/1352#issuecomment-1439033334
2023-05-30 13:22:30 +01:00
Richard van der Hoff
1e393fbf92
Improve error messages emitted by resolve-additional-types (#1303)
I forgot to set the `items` on an array definition, and got an extremely
opaque error. Hopefully this will improve the lives of anyone who makes a
similar mistake in future.
2022-11-17 07:23:12 +00:00
Richard van der Hoff
08fde5f257
Generate unstable changelogs using towncrier (#1340)
Replace the current stack of hugo templates with a towncrier invocation. The main advantage of this is that it means that the "Changes since last release" section is consistent with the changelogs for the actual releases.

This also changes the release process so that the changelog is generated before tagging, which means that the thing tagged v1.5 is actually the v1.5 spec.

Fixes #908.
2022-11-15 23:26:55 +00:00
Richard van der Hoff
bc15d4f9bc
Make definition anchors more unique (#1339)
Stick a `definition-` on the front of the autogenerated anchors for definition
blocks.

This solves a problem where, for example,
https://spec.matrix.org/unstable/application-service-api/#registration could
refer to either the "Registration" section or the `Registration` definition
therein.

(These anchors are relatively recent: they were added in #1191.
2022-11-15 19:15:34 +00:00
Richard van der Hoff
b07fe504ed
Stop rendering CS modules and room version fragments as standalone pages (#1317)
This is actually doing two things:

 * creating `{fragments,modules}/index.md` turns the fragments and modules into
   page resources, rather than pages in their own right. We have to update the
   shortcodes to match.

 * adding `headless: true` means that we don't render the pages.

The net effect is that we don't render pages like
https://spec.matrix.org/v1.4/rooms/fragments/v1-auth-rules/ and
https://spec.matrix.org/v1.4/client-server-api/modules/account_data/.
2022-11-08 17:27:44 +00:00
Hubert Chathi
830f80f56a
Merge pull request #1271 from uhoreg/add_verification_request_msgtype
add in-room m.key.verification.request msgtype
2022-11-02 10:16:42 -04:00
Hubert Chathi
82d2dd4ab0
Merge pull request #1283 from uhoreg/fix_event_subtype
improve display of event subtypes
2022-11-02 10:15:56 -04:00
Hubert Chathi
d0d7bdb807 apply changes from code review 2022-11-01 11:39:15 -04:00
Hubert Chathi
60d9518a63 pass the desired example name to the template 2022-10-28 16:15:04 -04:00
Hubert Chathi
99cd692ed0 improve display of event subtypes 2022-10-12 15:49:21 -04:00
Richard van der Hoff
c4505665e0
Various clarifications to auth rules text (#1270) 2022-10-05 16:54:34 +00:00
Hubert Chathi
191450ea73 add in-room m.key.verification.request msgtype 2022-10-04 17:49:36 -04:00
Travis Ralston
afc0e6a026
Add CORP headers to media repo (#1197)
* Add CORP headers to media repo

MSC: https://github.com/matrix-org/matrix-spec-proposals/pull/3828

* Write weird CSS rules to make added-in work inline in the CS spec

Even though our content doesn't need 2 paragraphs, it's good to have the capability to render it in the future.

* Remove test paragraph

* Refine prose

* spelling is key
2022-08-09 10:44:51 -06:00
Richard van der Hoff
dc4fd9bdd6
Render HTML anchors for definition blocks (#1191)
It's handy to be able to link to these.
2022-08-03 07:28:47 +01:00
Travis Ralston
569e139ac5
Add an "internal changes" changelog section (#1194)
* Add an "internal changes" changelog section

* update changelog number
2022-08-02 19:48:35 -06:00
Richard van der Hoff
ea42cd3c7b
Move various e2e defintions out to yaml files (#1166)
We have code to generate tables, which we should use in the e2e section.
2022-07-19 22:02:48 +01:00
Richard van der Hoff
5f3b34448d
Add HTML ids for object definitions in the formatted specification (#1174)
* Remove redundant call to resolve-allof

All of the callers to resolve-additional-types already call resolve-allof (or
if not, they should), so this is redundant.

* Update `resolve-additional-types` to take a dict

I want to add more params to this, so first make it take a dict.

* `render-object-table`: take a "title" rather than a "caption"

... which means we can use the result from resolve-additional-types directly.

* render-object-table: support adding an anchor to generated tables.

* resolve-additional-types: generate an id for each returned type

* render-event: pass an anchor_base into resolve-additional-types

This means that it will generate an anchor for each type, whihc will then be
passed into render-object-table and used as an `id` for the table.

* render-operation: pass an anchor_base into resolve-additional-types

* newsfiles
2022-07-19 13:25:30 -06:00
Travis Ralston
66a5920804
Remove matrix-doc changelog hack (#1134) 2022-06-16 10:45:45 -06:00
Hubert Chathi
2780055198
clarify federation Authorization header an add destination property (#1067)
* clarify federation Authorization header an add destination property

* add changelogs

* some clarifications

* more clarifications, fixes

* use HTML in the added-in/changed-in shortcodes

* Apply suggestions from code review

Co-authored-by: Travis Ralston <travpc@gmail.com>
2022-05-30 15:33:56 -06:00
Travis Ralston
fd2d5b8a49
Fix a few more instances of matrix-doc being used; Fix changelog support for repo split (#1051)
* Use spec-proposals repo for links in spec text and current changelog

* Make the changelog repo-aware

* Changelog
2022-05-10 08:59:54 -06:00
Andrew Morgan
5a54ca66d1
Replace deprecated Page.Dir with Page.File.Dir (#988) 2022-03-29 15:03:41 +01:00
Travis Ralston
26e0765159
Add guest changes to spec: MSC3069 and MSC3419 (#3605)
* Add MSC3069 support

https://github.com/matrix-org/matrix-doc/pull/3069

* Add MSC3419 support

https://github.com/matrix-org/matrix-doc/pull/3419

* Normalize and fix guest access endpoints list

* Changelogs
2022-01-04 20:29:40 -07:00
Travis Ralston
00169abcdb
Specify module order manually to work around hugo issues (#3612) 2022-01-04 20:29:10 -07:00
Travis Ralston
20bd445602
Add a changelog for the appendices (#3609)
As a document which is versioned, we should have a changelog for it. It might be empty most of the time but oh well.
2022-01-04 20:23:02 -07:00
Richard van der Hoff
92b29cf8e6
Add a changelog directory for room versions (#3504) 2021-11-19 11:00:37 +00:00
Travis Ralston
241e01c332
Fully specify room versions (#3432)
* Fully specify room versions

* Misc typo clarifications

* Try to clarify redactions a bit

* Update content/client-server-api/_index.md

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Update content/rooms/v6.md

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Update content/rooms/v6.md

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Better describe client considerations

* Doc template params

* Move redaction "new stuff" to v3

* Remove unhelpful sentences about "here follows unchanged stuff"

* Simplify event signing text

* Clean up handling redactions sections

* Move v4's event schema to unchanged section

* Update content/rooms/v4.md

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-11-01 08:49:15 -06:00