@@ -5,44 +5,44 @@ This repository contains the Matrix Specification, rendered at [spec.matrix.org]
5
5
Developers looking to use Matrix should join [ #matrix-dev: matrix .org] ( https://matrix.to/#/#matrix-dev:matrix.org )
6
6
on Matrix for help.
7
7
8
- Spec authors and proposal writers are welcome to join [ #matrix-spec: matrix .org] ( https://matrix.to/#/#matrix-spec:matrix.org ) .
8
+ Spec authors and proposal writers are welcome to join [ #matrix-spec: matrix .org] ( https://matrix.to/#/#matrix-spec:matrix.org ) .
9
9
We welcome contributions! See [ CONTRIBUTING.rst] ( ./CONTRIBUTING.rst ) for details.
10
10
11
11
## Structure
12
12
13
13
The Matrix spec is compiled with [ Hugo] ( https://gohugo.io/ ) (a static site generator) with the following structure:
14
14
15
- * ` /assets ` : assets that need postprocessing using [ Hugo Pipes] ( https://gohugo.io/hugo-pipes/introduction/ ) .
15
+ * ` /assets ` : assets that need postprocessing using [ Hugo Pipes] ( https://gohugo.io/hugo-pipes/introduction/ ) .
16
16
For example, Sass files would go here.
17
17
18
- * ` /content ` : files that will become pages in the site go here. Typically these are Markdown files with some YAML front
19
- matter indicating, [ among other things] ( https://gohugo.io/content-management/front-matter/ ) , what layout should be
20
- applied to this page. The organization of files under ` /content ` determines the organization of pages in the built
18
+ * ` /content ` : files that will become pages in the site go here. Typically these are Markdown files with some YAML front
19
+ matter indicating, [ among other things] ( https://gohugo.io/content-management/front-matter/ ) , what layout should be
20
+ applied to this page. The organization of files under ` /content ` determines the organization of pages in the built
21
21
site.
22
22
23
- * ` /data ` : this can contain TOML, YAML, or JSON files. Files kept here are directly available to template code as
24
- [ data objects] ( https://gohugo.io/templates/data-templates/ ) , so templates don't need to load them from a file and
23
+ * ` /data ` : this can contain TOML, YAML, or JSON files. Files kept here are directly available to template code as
24
+ [ data objects] ( https://gohugo.io/templates/data-templates/ ) , so templates don't need to load them from a file and
25
25
parse them. This is also where our Swagger/OpenAPI definitions and schemas are.
26
26
27
- * ` /layouts ` : this contains [ Hugo templates] ( https://gohugo.io/templates/ ) . Some templates define the overall layout of
27
+ * ` /layouts ` : this contains [ Hugo templates] ( https://gohugo.io/templates/ ) . Some templates define the overall layout of
28
28
a page: for example, whether it has header, footer, sidebar, and so on.
29
- * ` /layouts/partials ` : these templates can be called from other templates, so they can be used to factor out
30
- template code that's used in more than one template. An obvious example here is something like a sidebar, where
31
- several different page layouts might all include the sidebar. But also, partial templates can return values: this
29
+ * ` /layouts/partials ` : these templates can be called from other templates, so they can be used to factor out
30
+ template code that's used in more than one template. An obvious example here is something like a sidebar, where
31
+ several different page layouts might all include the sidebar. But also, partial templates can return values: this
32
32
means they can be used like functions, that can be called by multiple templates to do some common processing.
33
33
* ` /layouts/shortcodes ` : these templates can be called directly from files in ` /content ` .
34
34
35
35
* ` /static ` : static files which don't need preprocessing. JS or CSS files could live here.
36
36
37
- * ` /themes ` : you can use just Hugo or use it with a theme. Themes primarily provide additional templates, which are
38
- supplied in a ` /themes/$theme_name/layouts ` directory. You can use a theme but customise it by providing your own
39
- versions of any of the theme layouts in the base ` /layouts ` directory. That is, if a theme provides
40
- ` /themes/$theme_name/layouts/sidebar.html ` and you provide ` /layouts/sidebar.html ` , then your version of the
37
+ * ` /themes ` : you can use just Hugo or use it with a theme. Themes primarily provide additional templates, which are
38
+ supplied in a ` /themes/$theme_name/layouts ` directory. You can use a theme but customise it by providing your own
39
+ versions of any of the theme layouts in the base ` /layouts ` directory. That is, if a theme provides
40
+ ` /themes/$theme_name/layouts/sidebar.html ` and you provide ` /layouts/sidebar.html ` , then your version of the
41
41
template will be used.
42
42
43
43
It also has the following top-level file:
44
44
45
- * ` config.toml ` : site-wide configuration settings. Some of these are built-in and you can add your own. Config settings
45
+ * ` config.toml ` : site-wide configuration settings. Some of these are built-in and you can add your own. Config settings
46
46
defined here are available in templates. All these directories above are configurable via ` config.toml ` settings.
47
47
48
48
Additionally, the following directories may be of interest:
@@ -59,34 +59,40 @@ Additionally, the following directories may be of interest:
59
59
Please read [ CONTRIBUTING.rst] ( ./CONTRIBUTING.rst ) before authoring a change to the spec. Note that spec authoring takes
60
60
place after an MSC has been accepted, not as part of a proposal itself.
61
61
62
- 1 . Install the extended version (often the OS default) of Hugo: < https://gohugo.io/getting-started/installing >
62
+ 1 . Install the extended version (often the OS default) of Hugo:
63
+ < https://gohugo.io/getting-started/installing > . Note that at least Hugo
64
+ v0.74 is required.
65
+
66
+ Alternatively, use the Docker image at https://hub.docker.com/r/klakegg/hugo/ .
63
67
2 . Run ` git submodule update --init --recursive ` for good measure.
64
68
3 . Run ` npm i ` to install the dependencies. Note that this will require NodeJS to be installed.
65
69
4 . Run ` npm run get-proposals ` to seed proposal data. This is merely for populating the content of the "Spec Change Proposals"
66
70
page and is not required.
67
- 5 . Run ` hugo serve ` to run a local webserver which builds whenever a file change is detected. If watching doesn't appear
68
- to be working for you, try ` hugo serve --disableFastRender ` instead.
71
+ 5 . Run ` hugo serve ` (or `docker run --rm -it -v $(pwd):/src -p 1313:1313
72
+ klakegg/hugo serve`) to run a local webserver which builds whenever a file
73
+ change is detected. If watching doesn't appear to be working for you, try
74
+ adding ` --disableFastRender ` to the commandline.
69
75
6 . Edit the specification 🙂
70
76
71
- We use a highly customized [ Docsy] ( https://www.docsy.dev/ ) theme for our generated site, which uses Bootstrap and Font
72
- Awesome. If you're looking at making design-related changes to the spec site, please coordinate with us in
77
+ We use a highly customized [ Docsy] ( https://www.docsy.dev/ ) theme for our generated site, which uses Bootstrap and Font
78
+ Awesome. If you're looking at making design-related changes to the spec site, please coordinate with us in
73
79
[ #matrix-docs: matrix .org] ( https://matrix.to/#/#matrix-docs:matrix.org ) before opening a PR.
74
80
75
81
## Building the specification
76
82
77
- If for some reason you're not a CI/CD system and want to render a static version of the spec for yourself, follow the above
78
- steps for authoring changes to the specification and instead of ` hugo serve ` run ` hugo -d "spec" ` - this will generate the
79
- spec to ` /spec ` . If you'd like to serve the spec off a path instead of a domain root (eg: ` /unstable ` ), add ` --baseURL "/unstable" `
83
+ If for some reason you're not a CI/CD system and want to render a static version of the spec for yourself, follow the above
84
+ steps for authoring changes to the specification and instead of ` hugo serve ` run ` hugo -d "spec" ` - this will generate the
85
+ spec to ` /spec ` . If you'd like to serve the spec off a path instead of a domain root (eg: ` /unstable ` ), add ` --baseURL "/unstable" `
80
86
to the ` hugo -d "spec" ` command.
81
87
82
- For building the swagger definitions, create a python3 virtualenv and activate it. Then run ` pip install -r ./scripts/requirements.txt `
83
- and finally ` python ./scripts/dump-swagger.py ` to generate it to ` ./scripts/swagger/api-docs.json ` . To make use of the generated file,
88
+ For building the swagger definitions, create a python3 virtualenv and activate it. Then run ` pip install -r ./scripts/requirements.txt `
89
+ and finally ` python ./scripts/dump-swagger.py ` to generate it to ` ./scripts/swagger/api-docs.json ` . To make use of the generated file,
84
90
there are a number of options:
85
91
86
92
* It can be uploaded from your filesystem to an online editor/viewer such as [ on the swagger website] ( http://editor.swagger.io/ ) .
87
93
* You can run a local HTTP server by running ` ./scripts/swagger-http-server.py ` , and then view the documentation via an
88
94
online viewer; for example, at < http://petstore.swagger.io/?url=http://localhost:8000/api-docs.json > .
89
- * You can host the swagger UI yourself. See < https://github.com/swagger-api/swagger-ui#how-to-run > for advice on how to
95
+ * You can host the swagger UI yourself. See < https://github.com/swagger-api/swagger-ui#how-to-run > for advice on how to
90
96
do so.
91
97
92
98
## Issue tracking
0 commit comments