This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Compile and render Synapse's docs into a browsable, mobile-friendly and searchable website #10086
Merged
Merged
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e453c3b
Setup; add book.toml
anoadragon453 f8f770a
Add book/ directory to .gitignore
anoadragon453 035d696
Add a favicon
anoadragon453 706f64a
Add github actions workflow to deploy docs to gh-pages
anoadragon453 99e7ffe
Organise existing documentation into a tree structure.
anoadragon453 069712e
Add some section pages
anoadragon453 db46987
Add a table of contents plugin
anoadragon453 3f9f35d
Remove chapter navigation buttons on desktop
anoadragon453 3712044
Update docs/README.md with information on the site and how to build it
anoadragon453 fe65330
Update oft-linked to admin_api directory with info about the new site
anoadragon453 b4bf418
Refine the sidebar: switch to headers without labels
anoadragon453 c6e5eaf
Changelog
anoadragon453 8d774a4
Apply suggestions from code review
anoadragon453 e9ba348
Apply suggestions from code review
anoadragon453 14cb114
Remove comments in workflow, latest -> develop
anoadragon453 b6adbd7
Split out homeserver and logging sample config files
anoadragon453 2568e5b
Move structured logging up next to the logging configuration chapter
anoadragon453 9157b8e
Don't link to register_new_matrix_user
anoadragon453 92c514f
Update docs/usage/configuration/README.md
anoadragon453 7cb4fd9
Merge branch 'develop' of github.com:matrix-org/synapse into anoa/mdbook
anoadragon453 170fed8
Switch admin_api SUMMARY entries to their markdown versions; fix link…
anoadragon453 2b39299
Feature Documentation -> Internal Documentation
anoadragon453 071a6ef
Add Media Storage Providers draft chapter
anoadragon453 90520ae
Update mdbooks to 0.4.9; re-enable edit button
anoadragon453 f896a1b
Drop 'Writing a Module' chapter draft until new module API exists
anoadragon453 6991e88
Fix links to documentation
anoadragon453 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Deploy the documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
pages: | ||
name: GitHub Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup mdbook | ||
uses: peaceiris/actions-mdbook@4b5ef36b314c2599664ca107bb8c02412548d79d # v1.1.14 | ||
with: | ||
mdbook-version: '0.4.9' | ||
|
||
- name: Build the documentation | ||
run: mdbook build | ||
|
||
- name: Deploy latest documentation | ||
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 # v3.8.0 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
keep_files: true | ||
publish_dir: ./book | ||
destination_dir: ./develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,6 @@ __pycache__/ | |
/docs/build/ | ||
/htmlcov | ||
/pip-wheel-metadata/ | ||
|
||
# docs | ||
book/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Documentation for possible options in this file is at | ||
# https://rust-lang.github.io/mdBook/format/config.html | ||
[book] | ||
title = "Synapse" | ||
authors = ["The Matrix.org Foundation C.I.C."] | ||
language = "en" | ||
multilingual = false | ||
|
||
# The directory that documentation files are stored in | ||
src = "docs" | ||
|
||
[build] | ||
# Prevent markdown pages from being automatically generated when they're | ||
# linked to in SUMMARY.md | ||
create-missing = false | ||
|
||
[output.html] | ||
# The URL visitors will be directed to when they try to edit a page | ||
edit-url-template = "https://github.com/matrix-org/synapse/edit/develop/{path}" | ||
|
||
# Remove the numbers that appear before each item in the sidebar, as they can | ||
# get quite messy as we nest deeper | ||
no-section-label = true | ||
|
||
# The source code URL of the repository | ||
git-repository-url = "https://github.com/matrix-org/synapse" | ||
|
||
# The path that the docs are hosted on | ||
site-url = "/synapse/" | ||
|
||
# Additional HTML, JS, CSS that's injected into each page of the book. | ||
# More information available in docs/website_files/README.md | ||
additional-css = [ | ||
"docs/website_files/table-of-contents.css", | ||
"docs/website_files/remove-nav-buttons.css", | ||
"docs/website_files/indent-section-headers.css", | ||
] | ||
additional-js = ["docs/website_files/table-of-contents.js"] | ||
theme = "docs/website_files/theme" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add initial infrastructure for rendering Synapse documentation with mdbook. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,72 @@ | ||
# Synapse Documentation | ||
|
||
This directory contains documentation specific to the `synapse` homeserver. | ||
**The documentation is currently hosted [here](https://matrix-org.github.com/synapse).** | ||
anoadragon453 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Please update any links to point to the new website instead. | ||
|
||
All matrix-generic documentation now lives in its own project, located at [matrix-org/matrix-doc](https://github.com/matrix-org/matrix-doc) | ||
## About | ||
|
||
(Note: some items here may be moved to [matrix-org/matrix-doc](https://github.com/matrix-org/matrix-doc) at some point in the future.) | ||
This directory currently holds a series of markdown files documenting how to install, use | ||
and develop Synapse, the reference Matrix homeserver. The documentation is readable directly | ||
from this repository, but it is recommended to instead browse through the | ||
[website](https://matrix-org.github.com/synapse) for easier discoverability. | ||
anoadragon453 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Adding to the documentation | ||
|
||
Most of the documentation currently exists as top-level files, as when organising them into | ||
a structured website, these files were kept in place so that existing links would not break. | ||
The rest of the documentation is stored in folders, such as `setup`, `usage`, and `development` | ||
etc. **All new documentation files should be placed in structured folders.** For example: | ||
|
||
To create a new user-facing documentation page about a new Single Sign-On protocol named | ||
"MyCoolProtocol", one should create a new file with a relevant name, such as "my_cool_protocol.md". | ||
This file might fit into the documentation structure at: | ||
|
||
- Usage | ||
- Configuration | ||
- User Authentication | ||
- Single Sign-On | ||
- **My Cool Protocol** | ||
|
||
Given that, one would place the new file under | ||
`usage/configuration/user_authentication/single_sign_on/my_cool_protocol.md`. | ||
|
||
Note that the structure of the documentation (and thus the left sidebar on the website) is determined | ||
by the list in [SUMMARY.md](SUMMARY.md). The final thing to do when adding a new page is to add a new | ||
line linking to the new documentation file: | ||
|
||
```markdown | ||
- [My Cool Protocol](usage/configuration/user_authentication/single_sign_on/my_cool_protocol.md) | ||
``` | ||
|
||
## Building the documentation | ||
|
||
The documentation is built with [mdbook](https://rust-lang.github.io/mdBook/), and the outline of the | ||
documentation is determined by the structure of [SUMMARY.md](SUMMARY.md). | ||
|
||
First, [get mdbook](https://github.com/rust-lang/mdBook#installation). Then, **from the root of the repository**, | ||
build the documentation with: | ||
|
||
```sh | ||
mdbook build | ||
``` | ||
|
||
The rendered contents will be outputted to a new `book/` directory at the root of the repository. You can | ||
browse the book by opening `book/index.html` in a web browser. | ||
|
||
You can also have mdbook host the docs on a local webserver with hot-reload functionality via: | ||
|
||
```sh | ||
mdbook serve | ||
``` | ||
|
||
The URL at which the docs can be viewed at will be logged. | ||
|
||
## Configuration and theming | ||
|
||
The look and behaviour of the website is configured by the [book.toml](../book.toml) file | ||
at the root of the repository. See | ||
[mdbook's documentation on configuration](https://rust-lang.github.io/mdBook/format/config.html) | ||
for available options. | ||
|
||
The site can be themed and additionally extended with extra UI and features. See | ||
[website_files/README.md](website_files/README.md) for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Summary | ||
|
||
# Introduction | ||
- [Welcome and Overview](welcome_and_overview.md) | ||
|
||
# Setup | ||
- [Installation](setup/installation.md) | ||
- [Using Postgres](postgres.md) | ||
- [Configuring a Reverse Proxy](reverse_proxy.md) | ||
- [Configuring a Turn Server](turn-howto.md) | ||
- [Delegation](delegate.md) | ||
|
||
# Upgrading | ||
- [Upgrading between Synapse Versions](upgrading/README.md) | ||
- [Upgrading from pre-Synapse 1.0](MSC1711_certificates_FAQ.md) | ||
|
||
# Usage | ||
- [Federation](federate.md) | ||
- [Configuration](usage/configuration/README.md) | ||
- [Homeserver Sample Config File](usage/configuration/homeserver_sample_config.md) | ||
- [Logging Sample Config File](usage/configuration/logging_sample_config.md) | ||
- [Structured Logging](structured_logging.md) | ||
- [User Authentication](usage/configuration/user_authentication/README.md) | ||
- [Single-Sign On]() | ||
- [OpenID Connect](openid.md) | ||
- [SAML]() | ||
- [CAS]() | ||
- [SSO Mapping Providers](sso_mapping_providers.md) | ||
- [Password Auth Providers](password_auth_providers.md) | ||
- [JSON Web Tokens](jwt.md) | ||
- [Registration Captcha](CAPTCHA_SETUP.md) | ||
- [Application Services](application_services.md) | ||
- [Server Notices](server_notices.md) | ||
- [Consent Tracking](consent_tracking.md) | ||
- [URL Previews](url_previews.md) | ||
- [User Directory](user_directory.md) | ||
- [Message Retention Policies](message_retention_policies.md) | ||
- [Pluggable Modules]() | ||
- [Third Party Rules]() | ||
- [Spam Checker](spam_checker.md) | ||
- [Presence Router](presence_router_module.md) | ||
- [Media Storage Providers]() | ||
- [Writing a Module]() | ||
- [Workers](workers.md) | ||
- [Using `synctl` with Workers](synctl_workers.md) | ||
- [Systemd](systemd-with-workers/README.md) | ||
- [Administration](usage/administration/README.md) | ||
- [Admin API](usage/administration/admin_api/README.md) | ||
- [Account Validity](admin_api/account_validity.md) | ||
- [Delete Group](admin_api/delete_group.md) | ||
- [Event Reports](admin_api/event_reports.md) | ||
- [Media](admin_api/media_admin_api.md) | ||
- [Purge History](admin_api/purge_history_api.md) | ||
- [Purge Rooms](admin_api/purge_room.md) | ||
- [Register Users](admin_api/register_api.md) | ||
- [Manipulate Room Membership](admin_api/room_membership.md) | ||
- [Rooms](admin_api/rooms.md) | ||
- [Server Notices](admin_api/server_notices.md) | ||
- [Shutdown Room](admin_api/shutdown_room.md) | ||
- [Statistics](admin_api/statistics.md) | ||
- [Users](admin_api/user_admin_api.md) | ||
- [Server Version](admin_api/version_api.md) | ||
- [Manhole](manhole.md) | ||
- [Monitoring](metrics-howto.md) | ||
- [Scripts]() | ||
|
||
# Development | ||
- [Contributing Guide](development/contributing_guide.md) | ||
- [Code Style](code_style.md) | ||
- [Git Usage](dev/git.md) | ||
- [Testing]() | ||
- [OpenTracing](opentracing.md) | ||
- [Synapse Architecture]() | ||
- [Log Contexts](log_contexts.md) | ||
- [Replication](replication.md) | ||
- [TCP Replication](tcp_replication.md) | ||
- [Internal Documentation](development/internal_documentation/README.md) | ||
- [Single Sign-On]() | ||
- [SAML](dev/saml.md) | ||
- [CAS](dev/cas.md) | ||
- [State Resolution]() | ||
- [The Auth Chain Difference Algorithm](auth_chain_difference_algorithm.md) | ||
- [Media Repository](media_repository.md) | ||
- [Room and User Statistics](room_and_user_statistics.md) | ||
- [Scripts]() | ||
|
||
# Other | ||
- [Dependency Deprecation Policy](deprecation_policy.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,14 @@ | ||
Admin APIs | ||
========== | ||
|
||
This directory includes documentation for the various synapse specific admin | ||
APIs available. | ||
|
||
Authenticating as a server admin | ||
-------------------------------- | ||
|
||
Many of the API calls in the admin api will require an `access_token` for a | ||
server admin. (Note that a server admin is distinct from a room admin.) | ||
|
||
A user can be marked as a server admin by updating the database directly, e.g.: | ||
|
||
.. code-block:: sql | ||
**Note**: The latest documentation can be viewed `here <https://matrix-org.github.io/synapse>`_. | ||
See `docs/README.md <../docs/README.md>`_ for more information. | ||
|
||
UPDATE users SET admin = 1 WHERE name = '@foo:bar.com'; | ||
**Please update links to point to the website instead.** Existing files in this directory | ||
are preserved to maintain historical links, but may be moved in the future. | ||
|
||
A new server admin user can also be created using the | ||
``register_new_matrix_user`` script. | ||
|
||
Finding your user's `access_token` is client-dependent, but will usually be shown in the client's settings. | ||
|
||
Once you have your `access_token`, to include it in a request, the best option is to add the token to a request header: | ||
|
||
``curl --header "Authorization: Bearer <access_token>" <the_rest_of_your_API_request>`` | ||
This directory includes documentation for the various synapse specific admin | ||
APIs available. Updates to the existing Admin API documentation should still | ||
be made to these files, but any new documentation files should instead be placed under | ||
`docs/usage/administration/admin_api <../docs/usage/administration/admin_api>`_. | ||
|
||
Fore more details, please refer to the complete `matrix spec documentation <https://matrix.org/docs/spec/client_server/r0.5.0#using-access-tokens>`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put a link here to the rendered version or maybe we should add it to the release notes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release notes sounds good - we'll need to flip the switch on the GitHub Pages settings once we've merged anyhow.