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/.
This commit is contained in:
Richard van der Hoff 2022-11-08 17:27:44 +00:00 committed by GitHub
parent 1945589acf
commit b07fe504ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 21 additions and 165 deletions

View file

@ -0,0 +1 @@
Stop rendering the subsections of the Client-Server API and Room Versions specs as their own separate pages.

View file

@ -1,6 +1,3 @@
---
type: module
---
### Client Config ### Client Config

View file

@ -1,6 +1,3 @@
---
type: module
---
### Server Administration ### Server Administration

View file

@ -1,6 +1,3 @@
---
type: module
---
### Content repository ### Content repository

View file

@ -1,6 +1,3 @@
---
type: module
---
### Device Management ### Device Management

View file

@ -1,6 +1,3 @@
---
type: module
---
### Direct Messaging ### Direct Messaging

View file

@ -1,6 +1,3 @@
---
type: module
---
### End-to-End Encryption ### End-to-End Encryption

View file

@ -1,6 +1,3 @@
---
type: module
---
### Event Context ### Event Context

View file

@ -1,6 +1,3 @@
---
type: module
---
### Event replacements ### Event replacements

View file

@ -1,6 +1,3 @@
---
type: module
---
### Guest Access ### Guest Access

View file

@ -1,6 +1,3 @@
---
type: module
---
### Room History Visibility ### Room History Visibility

View file

@ -1,6 +1,3 @@
---
type: module
---
### Ignoring Users ### Ignoring Users

View file

@ -0,0 +1,3 @@
---
headless: true
---

View file

@ -1,6 +1,3 @@
---
type: module
---
### Instant Messaging ### Instant Messaging

View file

@ -1,6 +1,3 @@
---
type: module
---
### User and room mentions ### User and room mentions

View file

@ -1,6 +1,3 @@
---
type: module
---
### Moderation policy lists ### Moderation policy lists

View file

@ -1,6 +1,3 @@
---
type: module
---
### OpenID ### OpenID

View file

@ -1,6 +1,3 @@
---
type: module
---
### Presence ### Presence

View file

@ -1,6 +1,3 @@
---
type: module
---
### Push Notifications ### Push Notifications

View file

@ -1,6 +1,3 @@
---
type: module
---
### Fully read markers ### Fully read markers

View file

@ -1,6 +1,3 @@
---
type: module
---
### Receipts ### Receipts

View file

@ -1,6 +1,3 @@
---
type: module
---
### Reference relations ### Reference relations

View file

@ -1,6 +1,3 @@
---
type: module
---
### Reporting Content ### Reporting Content

View file

@ -1,6 +1,3 @@
---
type: module
---
### Rich replies ### Rich replies

View file

@ -1,6 +1,3 @@
---
type: module
---
### Room Previews ### Room Previews

View file

@ -1,6 +1,3 @@
---
type: module
---
### Room Upgrades ### Room Upgrades

View file

@ -1,6 +1,3 @@
---
type: module
---
### Server Side Search ### Server Side Search

View file

@ -1,6 +1,3 @@
---
type: module
---
### Secrets ### Secrets

View file

@ -1,6 +1,3 @@
---
type: module
---
### Send-to-Device messaging ### Send-to-Device messaging

View file

@ -1,6 +1,3 @@
---
type: module
---
### Server Access Control Lists (ACLs) for rooms ### Server Access Control Lists (ACLs) for rooms

View file

@ -1,6 +1,3 @@
---
type: module
---
### Server Notices ### Server Notices

View file

@ -1,7 +1,4 @@
---
type: module
weight: 340 weight: 340
---
### Spaces ### Spaces

View file

@ -1,6 +1,3 @@
---
type: module
---
### SSO client login/authentication ### SSO client login/authentication

View file

@ -1,6 +1,3 @@
---
type: module
---
### Sticker Messages ### Sticker Messages

View file

@ -1,6 +1,3 @@
---
type: module
---
### Room Tagging ### Room Tagging

View file

@ -1,6 +1,3 @@
---
type: module
---
### Third party invites ### Third party invites

View file

@ -1,6 +1,3 @@
---
type: module
---
### Third Party Networks ### Third Party Networks

View file

@ -1,6 +1,3 @@
---
type: module
---
### Threading ### Threading

View file

@ -1,6 +1,3 @@
---
type: module
---
### Typing Notifications ### Typing Notifications

View file

@ -1,6 +1,3 @@
---
type: module
---
### Voice over IP ### Voice over IP

View file

@ -0,0 +1,3 @@
---
headless: true
---

View file

@ -1,6 +1,3 @@
---
toc_hide: true
---
The types of state events that affect authorization are: The types of state events that affect authorization are:

View file

@ -1,6 +1,3 @@
---
toc_hide: true
---
Servers MUST NOT strictly enforce the JSON format specified in the Servers MUST NOT strictly enforce the JSON format specified in the
[appendices](/appendices#canonical-json) for the reasons [appendices](/appendices#canonical-json) for the reasons

View file

@ -1,6 +1,3 @@
---
toc_hide: true
---
Events sent into rooms of this version can have formats which are different Events sent into rooms of this version can have formats which are different
from their normal schema. Those cases are documented here. from their normal schema. Those cases are documented here.

View file

@ -1,6 +1,3 @@
---
toc_hide: true
---
Upon receipt of a redaction event, the server must strip off any keys Upon receipt of a redaction event, the server must strip off any keys
not in the following list: not in the following list:

View file

@ -1,6 +1,3 @@
---
toc_hide: true
---
##### `m.room.power_levels` events accept values as strings ##### `m.room.power_levels` events accept values as strings

View file

@ -1,6 +1,3 @@
---
toc_hide: true
---
The room state *S(E)* after an event *E* is defined in terms of the The room state *S(E)* after an event *E* is defined in terms of the
room state *S(E)* before *E*, and depends on whether *E* is a state room state *S(E)* before *E*, and depends on whether *E* is a state

View file

@ -1,7 +1,5 @@
--- ---
toc_hide: true
--- ---
{{< added-in this=true >}} In room versions 1 and 2, events need a {{< added-in this=true >}} In room versions 1 and 2, events need a
signature from the domain of the `event_id` in order to be considered signature from the domain of the `event_id` in order to be considered
valid. This room version does not include an `event_id` over federation valid. This room version does not include an `event_id` over federation

View file

@ -1,7 +1,5 @@
--- ---
toc_hide: true
--- ---
{{% added-in this=true %}} In room versions 1 and 2, redactions were {{% added-in this=true %}} In room versions 1 and 2, redactions were
explicitly part of the [authorization rules](/rooms/v1/#authorization-rules) explicitly part of the [authorization rules](/rooms/v1/#authorization-rules)
under Rule 11. As of room version 3, these conditions no longer exist as under Rule 11. As of room version 3, these conditions no longer exist as

View file

@ -1,6 +1,3 @@
---
toc_hide: true
---
Events in rooms of this version have the following structure: Events in rooms of this version have the following structure:

View file

@ -1,7 +1,5 @@
--- ---
toc_hide: true
--- ---
{{% added-in this=true %}} The event ID is the [reference {{% added-in this=true %}} The event ID is the [reference
hash](/server-server-api#calculating-the-reference-hash-for-an-event) of hash](/server-server-api#calculating-the-reference-hash-for-an-event) of
the event encoded using a variation of [Unpadded the event encoded using a variation of [Unpadded

View file

@ -1,6 +1,3 @@
---
toc_hide: true
---
When validating event signatures, servers MUST enforce the When validating event signatures, servers MUST enforce the
`valid_until_ts` property from a key request is at least as large as the `valid_until_ts` property from a key request is at least as large as the

View file

@ -1,6 +1,3 @@
---
toc_hide: true
---
Servers MUST strictly enforce the JSON format specified in the Servers MUST strictly enforce the JSON format specified in the
[appendices](/appendices#canonical-json). This translates to a [appendices](/appendices#canonical-json). This translates to a

View file

@ -1,6 +1,3 @@
---
toc_hide: true
---
Upon receipt of a redaction event, the server must strip off any keys Upon receipt of a redaction event, the server must strip off any keys
not in the following list: not in the following list:

View file

@ -1,6 +1,3 @@
---
toc_hide: true
---
Events must be signed by the server denoted by the `sender` property. Events must be signed by the server denoted by the `sender` property.

View file

@ -1,5 +1,4 @@
--- ---
toc_hide: true
--- ---
{{% added-in this=true %}} `m.room.member` events now keep `join_authorised_via_users_server` {{% added-in this=true %}} `m.room.member` events now keep `join_authorised_via_users_server`

View file

@ -6,8 +6,6 @@
* include `div#toc` for the ToC * include `div#toc` for the ToC
* start the sidebar at the root (homepage) since for us that is the Matrix * start the sidebar at the root (homepage) since for us that is the Matrix
overview page overview page
* omit module pages, which we don't want to be directly accessible
(we only use them as raw material for the client-server spec)
*/}} */}}
@ -41,7 +39,6 @@
<li class="td-sidebar-nav__section-title"> <li class="td-sidebar-nav__section-title">
<a href="{{ $s.RelPermalink }}" class="align-left pl-0 pr-2{{ if not $show }} collapsed{{ end }}{{ if $active}} active{{ end }} td-sidebar-link td-sidebar-link__section indent-{{$indent}}">{{ $s.LinkTitle }}</a> <a href="{{ $s.RelPermalink }}" class="align-left pl-0 pr-2{{ if not $show }} collapsed{{ end }}{{ if $active}} active{{ end }} td-sidebar-link td-sidebar-link__section indent-{{$indent}}">{{ $s.LinkTitle }}</a>
{{ $pages := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true }} {{ $pages := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true }}
{{ $pages = where $pages "Type" "!=" "module"}}
{{ $pages := $pages | first 50 }} {{ $pages := $pages | first 50 }}
{{ if gt (len $pages) 0 }} {{ if gt (len $pages) 0 }}
<ul> <ul>

View file

@ -9,5 +9,8 @@
{{ $name := .Params.name }} {{ $name := .Params.name }}
{{ $page := .Site.GetPage (path.Join .Page.File.Dir "modules" (printf "%s%s" $name ".md"))}} {{ with .Site.GetPage "client-server-api/modules" }}
{{ $page.Content }} {{ with .Resources.GetMatch (printf "%s%s" $name ".md") }}
{{ .Content }}
{{ end }}
{{ end }}

View file

@ -17,10 +17,13 @@
{{ $name := .Params.name }} {{ $name := .Params.name }}
{{ $withVersioning := .Params.withVersioning }} {{ $withVersioning := .Params.withVersioning }}
{{ $page := .Site.GetPage (path.Join .Page.File.Dir "fragments" (printf "%s%s" $name ".md"))}} {{ with .Site.GetPage "rooms/fragments" }}
{{ $content := $page.Content }} {{ with .Resources.GetMatch (printf "%s%s" $name ".md") }}
{{ if not $withVersioning }} {{ $content := .Content }}
{{ $content = (replace $content "[New in this version]" "") }} {{ if not $withVersioning }}
{{ $content = (replace $content "[Changed in this version]" "") }} {{ $content = (replace $content "[New in this version]" "") }}
{{ end }} {{ $content = (replace $content "[Changed in this version]" "") }}
{{ end }}
{{ $content | safeHTML }} {{ $content | safeHTML }}
{{ end }}
{{ end }}