Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: Update with instructions on how to build locally #404

Merged
merged 1 commit into from
Feb 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 39 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,46 @@ git submodule init
git submodule update
```

### Build the docs locally
### Build & test the docs locally

Please see https://github.com/openownership/data-standard-sphinx-theme
(Note if you need to change the theme you must instead use https://github.com/openownership/data-standard-sphinx-theme . If you only need to change the content, read on).

Clone this repository and change to the directory of this repository.

Create a Python Virtual Environment. It should be python3.8 to match our build server.

python3 -m virtualenv -p python3.8 .ve

(If you don't have python3.8 installed [see here](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa).)

Activate the virtual environment:

source .ve/bin/activate

Install Python libraries:

pip install -r requirements_test.txt

To actually build the docs:

sphinx-build docs/ _build

To see the docs, open a new terminal window and run a development webserver:

cd _build
python3 -m http.server

Leave this command running, and you can now go to http://127.0.0.1:8000/ to see the docs.

Edit source files as needed. Return to your original window and rerun the build command above. Reload in web browser. Repeat!

To run the tests:

pytest tests

To build another language, instead use this build command:

sphinx-build -D language=ru docs/ _build

### Translation

Expand Down Expand Up @@ -97,10 +134,3 @@ Now the files are ready to be translated in Transifex.
pybabel compile --use-fuzzy -d docs/locale -D svg
itstool -m docs/locale/ru/LC_MESSAGES/svg.mo -o docs/_build_svgs/ru docs/_assets/*.svg
```

**To build another language locally** to preview it (pass the language code you want)..

```
$ cd docs
$ sphinx-build -b html -D language=ru . _build/html/ru
```