This is the code that powers www.writethedocs.org. It contains information about the Write the Docs group, as well as information about writing documentation.
To contribute to the Write the Docs website, it's helpful to familiarize yourself with the Sphinx site generator and reStructuredText markup syntax.
All of the generated website lives inside the docs directory, but many files outside the conf/ directory are just static RST like any other Sphinx project.
All RST files are rendered with Jinja, which allows the use of Jinja tags in all of them. A few custom Jinja filters are available for things like generating photo paths for speakers.
For conferences, see the conference site documentation.
-
Install uv (Python package manager).
-
In the repository root directory (
wwwby default), runuv syncto install Python 3.12 and all dependencies.
Remember to activate the virtual environment using the appropriate command for your OS and Shell before running the following commands.
- In the
docsdirectory, runuv run make livehtmlto view the docs on http://127.0.0.1:8888/.
If you're not seeing new content in the local preview, run make clean to delete the generated files, then uv run make livehtml to regenerate them.
The Write the Docs website is hosted on Read the Docs.
Styling is maintained in docs/_static/conf/css/ as SASS. Convert SASS to minified CSS by installing SASS
npm install -g sass
and then running (using a 2022 example):
sass --style=compressed docs/_static/conf/scss/main-2022.scss docs/_static/conf/css/main-2022.min.css
In addition to local development with Python venv, it is also possible to use the devcontainer found in the root of the project.
A barebones dockerfile is supplied to run the site within a local Docker Container through Docker Desktop - a simple, free, way to easily setup Docker and Python without leaving beyond installations, modifying your underlying Operating System, and changing Environment Variables.
- Make sure Docker Desktop is running and started
- Build the Docker Image from the root directory with the command:
docker build -t wtd . - Run the Docker Image Container using that Image ID:
docker run -p 8888:8888 wtd - Access the live site on http://localhost:8888 through your web browser
- Both the Docker Container and Image will be present in Docker Desktop
Make sure all of the following is installed.
Follow the steps below to open the development environment.
- Open a supported IDE
- Click the "Open in devcontainer" popup
- The development environment starts in an containerized environment