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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compile and render Synapse's docs into a browsable, mobile-friendly a…
…nd searchable website (#10086)
- Loading branch information
1 parent
9eea464
commit fd9856e
Showing
35 changed files
with
978 additions
and
54 deletions.
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.io/synapse).** | ||
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.io/synapse) for easier discoverability. | ||
|
||
## 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,87 @@ | ||
# 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]() | ||
- [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.