Source files for wire-server documentation hosted on https://docs.wire.com
Visit https://docs.wire.com/
The structure of this document has been heavily inspired by this blog post.
We use sphinx for rendering. Here is a cheat
sheet
for writing re-structured text (*.rst
).
here is another one.
And another one.
The re-structured spec text allows for choosing any underline/overline symbol for any level. In this repository we have not been very consistent. For any new contribution let's stick to this convention:
######
Part 1
######
*********
Chapter 1
*********
Section 1
=========
Sub-section 1
-------------
Sub-sub-section 1
^^^^^^^^^^^^^^^^^
Paragraph 1
~~~~~~~~~~~
Sub-paragraph 1
+++++++++++++++
If another level is needed, please add the chosen symbol here.
You need docker
available on your system.
Generate docs (using docker, so you don't need to install python dependencies yourself)
make docs
See build/html/index.html
make docs-pdf
Then see build/pdf/
Note: when switching from a docker-based building to a local building, you might encounter permission issues due to the build directory being owned by root. These can be solved by cleaning the build directory: sudo rm -rf ./build/
Install the dependencies locally, you have two options A or B:
- Install Nix
- MacOS users with a recent Mac might need to follow these instructions
- Debian users can use their distro's
nix
package, and should remember to add their user to thenix-users
group in /etc/group, and re-start their login session.
- Install Direnv.
- On debian, you can install the
direnv
package. On MacOS usebrew install direnv
. - On NixOS with home-manager, you can set
programs.direnv.enable = true;
. - Make sure direnv is hooked into your shell via it's appripriate
rc
file. Addeval "$(direnv hook bash|zsh|fish)"
to your ~/.(bash|zsh|fish)rc . - When successfully installed and hooked, direnv should ask you to
direnv allow
the current.envrc
when you cd to this repository. See the Installation documentation for further details.
- On debian, you can install the
Now, whenever you cd to wire-docs, you will have the relevant binaries (make, sphinx, rst2pdf, ...) in your PATH.
If you don't like to use nix and direnv:
You need python3
and to install poetry then run poetry install
. If that fails you may not have a required system dependency, have a look at the Dockerfile for hints of packages you may need.
Enter a development mode by running make dev-run
to start a local server and file watcher.
Look at results by opening build/html/index.html which will auto-update whenever files under ./src change.
make html
NOTE: support is experimental and resulting pdf may not have great formatting. See the rst2pdf manual to improve the configuration here so the resulting PDF becomes nicer.
Run make pdf
and look at files in ./build/pdf/
.
If you have nix & direnv, you can use the make dev-pdf
target to get auto-refreshing PDF files as you save source files. (requires a PDF viewer installed globally)
CI is set up to do this automatically on a push to master. If for some reason you wish to upload manually to S3:
(You need amazon credentials for pushing to S3)
make push
Please note that cloudfront CDN has a certain cache duration (at the time of writing: 1 minute), so changes will take a bit of time to take effect.