This repository holds the custom theme for https://github.com/openownership/data-standard
It also holds various files and tools to build this theme.
If you are writing docs only and don't need to change the theme then please follow the instructions at https://github.com/openownership/data-standard/blob/master/README.md
You will need Vagrant and VirtualBox (or equivalent).
- Check out this git repository into a folder anywhere. eg data-standard-sphinx-theme
- Check out the https://github.com/openownership/data-standard git repository into a folder called "data-standard" inside the other folder. eg data-standard-sphinx-theme/data-standard
- Follow the instructions in the data-standard README.md. This is especially important if you are going to be translating a version of the data-standard's schema.
- (you may want to check out a particular branch of the data-standard repository now.)
- Follow the instructons in add-to-conf.py in the root directory to edit conf.py in data-standard/docs/conf.py .
- In the folder for this repository (eg data-standard-sphinx-theme) run "vagrant up"
- Run "vagrant ssh" to connect to this box (Windows user may want to install the putty plugin and run "vagrant putty" instead).
- Inside the box, run "build"
- Browse "http://localhost:8080"
Edit any files you want, then repeat the last 2 steps!
Simply pass a variable:
BODSLANG=ru build
Q: Pip install fails saying "ERROR: Could not install packages due to an EnvironmentError: [Errno 39] Directory not empty"? A: Just run the command again. If the error persists, run
rm -rf /vagrant/data-standard/.ve
and try again.
When you are connected to the vagrant box (after running "vagrant ssh"), run:
build
At the end this will check all internal links and echo a report. Hopefully you will see:
SUCCESS Crawled 91 urls in 2.53 seconds
This will only check internal links. If you want to check external links to, run:
build
pylinkvalidate.py --test-outside --output=/tmp/report.txt http://localhost/
cat /tmp/report.txt
Any errors reported in external links must be checked by hand - sometimes a website will block our automatic checker but let a human through.
If you add English text to a theme (including in title
attributes or similar), make sure to wrap it in {% trans %}
/ {% endtrans %}
blocks.
You need to get a Transifex API key, make sure you have access to the BODS Theme project on Transifex.
After you add translatable strings to the theme templates:
- Extract the strings (to
oods/locale/sphinx.pot
):python setup.py extract_messages
- Push to Transifex:
tx push -s
- Fetch new translations from Transifex:
tx pull -a
- To build a particular language locally you can run
sphinx-build -b html -D language={lang} . _build/html/{lang}
(from thedata-standard/docs
directory)