Skip to content

Commit 963ee43

Browse files
Simplify PR template, introduce MD linter (#3051)
* Convert checkboxes to questions Signed-off-by: Kim Brose <[email protected]> * document internal links Signed-off-by: HarHarLinks <[email protected]> * document blog taxonomies Signed-off-by: HarHarLinks <[email protected]> * update PR bot CI from https://github.com/HarHarLinks/pr-template-autoclose Signed-off-by: HarHarLinks <[email protected]> * fix heading depth (MD001 MD003) Signed-off-by: HarHarLinks <[email protected]> * fix code blocks Signed-off-by: HarHarLinks <[email protected]> * fix spaces in link text (MD039) Signed-off-by: HarHarLinks <[email protected]> * fix no newline at end of file (MD047) Signed-off-by: HarHarLinks <[email protected]> * fix bare URLs without angle backets (MD034) Signed-off-by: HarHarLinks <[email protected]> * remove redundant attribute Signed-off-by: HarHarLinks <[email protected]> * linter exception Signed-off-by: HarHarLinks <[email protected]> * lint links and headings with rumdl instead of checklist Signed-off-by: HarHarLinks <[email protected]> * convert signoff checklist to heading Signed-off-by: HarHarLinks <[email protected]> * configure linter to .rumdl.toml explicitly Signed-off-by: HarHarLinks <[email protected]> * bump rumdl action Signed-off-by: HarHarLinks <[email protected]> * Shorten comments in the template Co-authored-by: Thibault Martin <[email protected]> Signed-off-by: Kim Brose <[email protected]> * Remove rumdl default config example comments Co-authored-by: Thibault Martin <[email protected]> Signed-off-by: Kim Brose <[email protected]> * explain more about the pr-bot Signed-off-by: HarHarLinks <[email protected]> * pin rumdl action to v0 Signed-off-by: HarHarLinks <[email protected]> * fix unlinked email address in coc Signed-off-by: HarHarLinks <[email protected]> --------- Signed-off-by: Kim Brose <[email protected]> Signed-off-by: HarHarLinks <[email protected]> Co-authored-by: Thibault Martin <[email protected]>
1 parent 2087e10 commit 963ee43

File tree

324 files changed

+1869
-1883
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+1869
-1883
lines changed

.github/pull_request_template.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1+
### Description
2+
3+
<!-- Please describe what you added or changed. This helps us review the PR faster. -->
4+
5+
6+
7+
### Related issues
8+
9+
<!-- If you know that your PR closes issues, please list them here -->
10+
11+
### Role
12+
13+
<!-- Are you contributing as an individual or on behalf of an organisation? Are you affiliated with any project relevant to this PR? -->
14+
15+
### Timeline
16+
17+
<!-- By when do you need us to review your PR at the latest? -->
18+
19+
### Signoff
20+
21+
Please [sign off](https://github.com/matrix-org/matrix.org/blob/main/CONTRIBUTING.md) your individual commits or whole pull request.
22+
23+
24+
25+
<!-- ------------------------------ DO NOT WRITE BELOW THIS LINE ------------------------------ -->
126
<!-- Thank you for creating a Pull Request to the matrix.org website!
227
Please read our documentation for contributors to make the review process a smooth as possible:
328
- https://github.com/matrix-org/matrix.org/blob/main/README.md
429
- https://github.com/matrix-org/matrix.org/blob/main/CONTRIBUTING.md
530
- https://github.com/matrix-org/matrix.org/blob/main/CONTENT.md
6-
7-
You can use the CI build or a local environment to check your changes are working as expected.
831
932
If you have questions at any time, please contact the Website & Content Working Group at
1033
https://matrix.to/#/#matrix.org-website:matrix.org -->
11-
12-
### Description
13-
<!-- Please describe what you added here, and add a screenshot or video if possible.
14-
That makes it easier to understand the change. -->
15-
16-
### :heavy_check_mark: Checklist
17-
<!-- Please tick as appropriate, but don't remove this checklist from your PR, as it is useful for reviewers, too. -->
18-
19-
- [x] Keep this checklist
20-
- Check for common mistakes:
21-
- [ ] Wrap plain URLs in `<>` to linkify them ([learn more](https://github.com/matrix-org/matrix.org/blob/main/CONTENT.md#publishing-to-the-blog)).
22-
- [ ] Use the right level of headings: The page title will use a level 1 headings, so your headings should use level 2 and below.
23-
- [ ] Use internal links: when linking to another page on <https://matrix.org>, use the Zola `[label](@/target.md)` [syntax](https://www.getzola.org/documentation/content/linking/#internal-links).
24-
- For blog posts:
25-
- [ ] Verify the date and post ordering on the `/blog` page, especially for multiple posts on the same day. Prefer UTC format, e.g. `2025-12-01T14:00:00Z` for Dec 1st, 2025, 2pm UTC.
26-
- [ ] Set the correct author and category. Browse existing ones at <https://matrix.org/author/> and <https://matrix.org/category/> to match them.
27-
- [ ] If you hold a specific role in relation to the content you are contributing, such as project maintainer or on behalf of a team or organisation, please let us know. See [example](https://github.com/matrix-org/matrix.org/pull/2969).
28-
- [ ] If your PR is time-sensitive in any way, please mention the attached timeline and context in the PR description.
29-
- [ ] Mention any issues related to the PR. Use [GitHub keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) as appropriate.
30-
- [ ] Your individual commits or pull request is [signed off](https://github.com/matrix-org/matrix.org/blob/main/CONTRIBUTING.md).
31-
32-
<!-- ------------------------------ DO NOT WRITE BELOW THIS LINE ------------------------------ -->

.github/workflows/linter.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Linters
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
run:
10+
name: Spell Check with Typos
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Actions Repository
14+
uses: actions/checkout@v6
15+
16+
- name: Check spelling
17+
uses: crate-ci/[email protected]
18+
19+
rumdl-check:
20+
name: Lint Markdown with rumdl
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v6
24+
- uses: rvben/rumdl@v0
25+
with:
26+
config: .rumdl.toml
27+
report-type: annotations

.github/workflows/pr-bot.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
name: PR Bot
22

33
on:
4-
pull_request:
4+
pull_request_target: # unblock read/write repository permission, even when it is triggered from a public fork - https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#permissions
55
types: [opened, reopened, ready_for_review] # https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=ready_for_review#pull_request
66

77
jobs:
88
missing-template:
99
name: Auto-draft PRs missing template
1010
runs-on: ubuntu-latest
11-
permissions: write-all
12-
env:
13-
CHECKOUT_DIR: my-repo
11+
permissions:
12+
pull-requests: write
13+
contents: write # Needed for the bot to turn the PR into a draft if the template is missing
14+
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
1415

1516
steps:
16-
- uses: actions/checkout@v5
17-
with:
18-
path: ${{ env.CHECKOUT_DIR }}
19-
2017
- name: Check if the PR template was deleted
2118
env:
2219
GH_TOKEN: ${{ github.token }}
2320
BASE_URL: ${{ github.server.url }}/${{ github.repository }}/blob/main
2421
PR_NUMBER: ${{ github.event.number }}
25-
working-directory: ${{ env.CHECKOUT_DIR }}
2622
run: |
27-
if ! gh pr view $PR_NUMBER --json 'body' | grep -q "don't remove this checklist from your PR"; then
28-
gh pr ready $PR_NUMBER --undo # mark as draft
29-
gh pr edit $PR_NUMBER --add-label 'missing-template'
30-
gh pr review $PR_NUMBER --request-changes --body "Thanks for contributing to the matrix.org website. I have automatically marked your pull request as a draft. Please restore the [PR template]($BASE_URL/.github/pull_request_template.md?plain=1) to your PR description and follow our [contributing guidelines]($BASE_URL/CONTRIBUTING.md), then undraft to let the team know the PR is ready for review."
23+
cmd="gh pr -R ${{ github.repository }}"
24+
if ! $cmd view $PR_NUMBER --json 'body' | grep -q "Description"; then
25+
$cmd ready $PR_NUMBER --undo # mark as draft
26+
$cmd edit $PR_NUMBER --add-label 'missing-template'
27+
$cmd review $PR_NUMBER --request-changes --body "Thanks for contributing to the matrix.org website. I have automatically marked your pull request as a draft. Please restore the [PR template]($BASE_URL/.github/pull_request_template.md?plain=1) to your PR description and follow our [contributing guidelines]($BASE_URL/CONTRIBUTING.md), then undraft to let the team know the PR is ready for review."
28+
exit 1
3129
fi
32-
if gh pr view $PR_NUMBER --json 'labels' | grep -q "missing-template"; then
33-
gh pr edit $PR_NUMBER --remove-label 'missing-template'
34-
gh pr review $PR_NUMBER --approve --body "Thank you for applying the PR template. The PR is now ready for review by a human."
30+
if $cmd view $PR_NUMBER --json 'labels' | grep -q "missing-template"; then
31+
$cmd edit $PR_NUMBER --remove-label 'missing-template'
32+
$cmd review $PR_NUMBER --approve --body "Thank you for applying the PR template. The PR is now ready for review by a human."
3533
fi

.github/workflows/spell-check.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.rumdl.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# rumdl configuration file
2+
3+
# Global configuration options
4+
[global]
5+
# List of rules to disable (uncomment and modify as needed)
6+
# disable = ["MD013", "MD033"]
7+
8+
# List of rules to enable exclusively (if provided, only these rules will run)
9+
enable = ["MD001", "MD003", "MD011", "MD034", "MD039"]
10+
11+
# List of file/directory patterns to include for linting (if provided, only these will be linted)
12+
# include = [
13+
# "docs/*.md",
14+
# "src/**/*.md",
15+
# "README.md"
16+
# ]
17+
18+
# List of file/directory patterns to exclude from linting
19+
exclude = [
20+
# Common directories to exclude
21+
".git",
22+
".github",
23+
"node_modules",
24+
"vendor",
25+
"dist",
26+
"build",
27+
28+
# legacy content
29+
"content/blog/2014",
30+
"content/blog/2015",
31+
"content/blog/2016",
32+
"content/blog/2017",
33+
"content/blog/2018",
34+
]
35+
36+
# Respect .gitignore files when scanning directories (default: true)
37+
respect-gitignore = true
38+
39+
# Markdown flavor/dialect (uncomment to enable)
40+
# Options: mkdocs, gfm, commonmark
41+
flavor = "commonmark" # https://www.getzola.org/documentation/getting-started/overview/
42+

CONTENT.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ The matrix.org website is powered by [Zola](https://www.getzola.org/), a [static
44

55
This documentation is about helping you create new content that the static site generator will accept. To get your content actually deploy on matrix.org, you need to be familiar with git, GitHub and Pull Requests. If that's not the case, we suggest either finding someone who is and can help, or dropping us a line in the [Matrix.org Website chat room](https://matrix.to/#/#matrix.org-website:matrix.org).
66

7+
## General tips
8+
9+
### Internal links
10+
11+
Zola can automatically check internal links if they are added using the [Zola internal link syntax](https://www.getzola.org/documentation/content/linking/#internal-links).
12+
13+
Tl;dr: Linking to a file located at content/pages/about.md would be `[my link](@/pages/about.md)`.
14+
15+
There are some edge cases, for example this can only work when a file generating a page actually exists, e.g. not for entirely generated pages such as the blog's `/category/` pages.
16+
We collect such issues in [#2829](https://github.com/matrix-org/matrix.org/issues/2829) and welcome ideas to improve this approach.
17+
18+
We still prefer this approach on a best effort basis as it has already proven useful.
19+
720
## Publishing to the blog
821

922
Articles on the blog are written in the markdown format. Markdown should generally be the same everywhere, but there are small variations around what you can or can't do with it. Zola supports the [CommonMark variant](https://commonmark.org/help/) of Markdown. Note that Zola's Markdown parser is pedantic about links and requires to use `<>` around a link without title.
@@ -25,6 +38,8 @@ Once this structure is in place, you need to write the actual blog post. It is a
2538

2639
In the frontmatter, make sure to format the date as `year-month-day` (e.g. `2024-01-22`) then append `T` to specify the time as `hour:minute:seconds` (e.g. `12:30:00`) and add a final `Z` to specify that the time is on the UTC time zone. We use UTC to make it easier for humans to figure out which blog post is going to be published first if two blog posts are issued on the same day.
2740

41+
The `taxonomies` automatically create groupings of blog posts and also filter into respective atom feeds readers can subscribe to. It is hence important to choose correct and consistent values for both author(s) and categories. You can browse existing ones at <https://matrix.org/author/> and <https://matrix.org/category/> to match them.
42+
2843
You can use the following template to create a new blog post:
2944

3045
```markdown

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ just 612MiB.
2828
For more information on this please check out these 2 articles which also
2929
explain why `--depth=1` is not ideal and which implications this has:
3030

31-
- https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/
32-
- https://web.archive.org/web/20241001150554/https://nayak.io/posts/git-clone-optimizations/
31+
- <https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/>
32+
- <https://web.archive.org/web/20241001150554/https://nayak.io/posts/git-clone-optimizations/>
3333

3434
## Building the website
3535

@@ -41,5 +41,5 @@ zola serve
4141
```
4242

4343
Zola will build the website and start a web server, usually at
44-
http://127.0.0.1:1111
44+
<http://127.0.0.1:1111>
4545

content/blog/2015/03/2015-03-02-introduction-to-application-services.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ app_service_config_files:
5757
- "/path/to/appservice/registration.yaml"
5858
</pre>
5959
NB: Note the "-" at the start; this indicates a list element. The registration file <code>registration.yaml</code> should look like:
60-
<pre># registration.yaml
60+
```
61+
# registration.yaml
6162
6263
# this is the base URL of the application service
6364
url: "http://localhost:5000"
@@ -78,11 +79,12 @@ namespaces:
7879
aliases:
7980
- exclusive: false
8081
regex: "#logged_.*"
81-
</pre>
82+
```
8283
<strong>You will need to restart the home server after editing the config file before it will take effect.</strong>
8384

8485
To test everything is working correctly, go ahead and explicitly create a room with the alias "#logged_test:localhost" and send a message into the room: the HS will relay the message to the AS by PUTing to /transactions/&lt;tid&gt; and you should see your AS print the event on the terminal. This will monitor any room which has an alias prefix of "#logged_", but it won't lazily create room aliases if they don't already exist. This means it will only log messages in the room you created before: #logged_test:localhost. Try joining the room "#logged_test2:localhost" without creating it, and it will fail. Let's fix that and add in lazy room creation:
85-
<pre>@app.route("/rooms/&lt;alias&gt;")
86+
```
87+
@app.route("/rooms/<alias>")
8688
def query_alias(alias):
8789
alias_localpart = alias.split(":")[0][1:]
8890
requests.post(
@@ -94,7 +96,7 @@ def query_alias(alias):
9496
headers={'{'}"Content-Type":"application/json"{'}'}
9597
)
9698
return jsonify({'{'}{'}'})
97-
</pre>
99+
```
98100
This makes the application service lazily create a room with the requested alias whenever the HS queries the AS for the existence of that alias (when users try to join that room), allowing any room with the alias prefix #logged_ to be sent to the AS. Now try joining the room "#logged_test2:localhost" and it will work as you'd expect.  You can see that if this were a real bridge, the AS would have checked for the existence of #logged_test2 in the remote network, and then lazily-created it in Matrix as required.
99101

100102
Application services are powerful components which extend the functionality of home servers, but they are limited. They can only ever function in a "passive" way. For example, you cannot implement an application service which censors swear words in rooms, because there is no way to prevent the event from being sent. Aside from the fact that censoring will not work when using end-to-end encryption, all federated home servers would also need to reject the event in order to stop developing an inconsistent event graph. To "actively" monitor events, another component called a "Policy Server" is required, which is beyond the scope of this post.  Also, Application Services can result in a performance bottleneck, as all events on the homeserver must be ordered and sent to the registered application services.  If you are bridging huge amounts of traffic, you may be better off having your bridge directly talk the Server-Server federation API rather than the simpler Application Service API.

content/blog/2015/04/2015-04-23-monitoring-synapse-metrics-with-prometheus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ category = ["Tutorials"]
1111

1212
Synapse has had support for exporting a comprehensive range of metrics via HTTP since 0.8.1 - we added this to help quantify the benefits of all the performance work which is going on currently in advance of Synapse 0.9. If you're interested in monitoring your own synapse and seeing what's going on using something like Prometheus, Leo just wrote a quick tutorial on getting up and running:
1313

14-
#### How to monitor Synapse metrics using Prometheus
14+
### How to monitor Synapse metrics using Prometheus
1515

1616
<dl>
1717
<dt>1: Install prometheus:</dt><dd>Follow instructions at <a href="http://prometheus.io/docs/introduction/install/">http://prometheus.io/docs/introduction/install/</a></dd>

content/blog/2017/11/2017-11-15-synapse-0-25-is-out-as-is-matrix-specification-0-3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ The full changelog for 0.3 of the spec is:
8080

8181
This is a medium-sized release; the main thing being to support configurable room visibility within groups (so that whenever you add a room to a group, you're not forced into sharing their existence with the general public, but can choose to just tell group members about them).  There's also a bunch of useful bug fixes and some performance improvements, including lots of contributions from the community this release (thank you!).  Full release notes are:
8282

83-
##### Changes in synapse v0.25.0 (2017-11-15)
83+
#### Changes in synapse v0.25.0 (2017-11-15)
8484

8585
Bug fixes:
8686
<ul>
8787
<li>Fix port script (PR <a class="issue-link js-issue-link" href="https://github.com/matrix-org/synapse/pull/2673" data-error-text="Failed to load issue title" data-id="273841564" data-permission-text="Issue title is private" data-url="https://github.com/matrix-org/synapse/issues/2673">#2673</a>)</li>
8888
</ul>
8989

90-
##### Changes in synapse v0.25.0-rc1 (2017-11-14)
90+
#### Changes in synapse v0.25.0-rc1 (2017-11-14)
9191

9292
Features:
9393
<ul>

0 commit comments

Comments
 (0)