2018-05-07 03:55:05 +02:00
|
|
|
# Guide to updating the Project X-Ray docs
|
|
|
|
|
|
|
|
|
|
We welcome updates to the Project X-Ray docs. The docs are published on [Read
|
|
|
|
|
the Docs](http://prjxray.readthedocs.io) and the source is on
|
|
|
|
|
[GitHub](https://github.com/SymbiFlow/prjxray/tree/master/docs).
|
|
|
|
|
|
|
|
|
|
Updating the docs is a three-step process: Make your updates, test your updates,
|
|
|
|
|
send a pull request.
|
|
|
|
|
|
|
|
|
|
# 1. Make your updates
|
|
|
|
|
|
|
|
|
|
The standard Project X-Ray [contribution guidelines](CONTRIBUTING.md) apply to
|
|
|
|
|
doc updates too.
|
|
|
|
|
|
|
|
|
|
Follow your usual process for updating content on GitHub. See GitHub's guide to
|
|
|
|
|
[working with forks](https://help.github.com/articles/working-with-forks/).
|
|
|
|
|
|
|
|
|
|
# 2. Test your updates
|
|
|
|
|
|
|
|
|
|
Before sending a pull request with your doc updates, you need to check the
|
|
|
|
|
effects of your changes on the page you've updated and on the docs as a whole.
|
|
|
|
|
|
|
|
|
|
## Check your markup
|
|
|
|
|
|
|
|
|
|
There are a few places on the web where you can view ReStructured Text rendered
|
|
|
|
|
as HTML. For example:
|
|
|
|
|
[https://livesphinx.herokuapp.com/](https://livesphinx.herokuapp.com/)
|
|
|
|
|
|
|
|
|
|
## Perform basic tests: make html and linkcheck
|
|
|
|
|
|
|
|
|
|
If your changes are quite simple, you can perform a few basic checks before
|
|
|
|
|
sending a pull request. At minimum:
|
|
|
|
|
|
|
|
|
|
- Check that `make html` generates output without errors
|
|
|
|
|
- Check that `make linkcheck` reports no warnings.
|
|
|
|
|
- When editing, `make livehtml` is helpful.
|
|
|
|
|
|
|
|
|
|
To make these checks work, you need to install Sphinx. We recommend `pipenv`.
|
|
|
|
|
|
|
|
|
|
Follow the steps below to install `pipenv` via `pip`, run `pipenv install` in
|
|
|
|
|
the `docs` directory, then run `pipenv shell` to enter an environment where
|
|
|
|
|
Sphinx and all the necessary plugins are installed:
|
|
|
|
|
|
|
|
|
|
Steps in detail, on Linux:
|
|
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Install pip:
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
sudo apt install python-pip
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Install pipenv - see the
|
2018-05-07 03:55:05 +02:00
|
|
|
[pipenv installation
|
|
|
|
|
guide](http://pipenv.readthedocs.io/en/latest/install/#installing-pipenv):
|
|
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
pip install pipenv
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Add pipenv to your path, as recommended in the
|
2018-05-07 03:55:05 +02:00
|
|
|
[pipenv installation
|
2018-05-07 04:14:02 +02:00
|
|
|
guide](http://pipenv.readthedocs.io/en/latest/install/#installing-pipenv). On
|
|
|
|
|
Linux, add this in your `~/.profile` file:
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
export PATH=$PATH:~/.local/bin source ~/.profile
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
Note: On OS X the path is different: `~/Library/Python/2.7/bin`
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Go to the docs directory in the Project X-Ray repo:
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
cd ~/github-repos/prjxray/docs
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Run pipenv to install the Sphinx environment:
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
pipenv install
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Activate the shell:
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
pipenv shell
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Run the HTML build checker, and check for _errors_:
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
make html
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Run the link checker, and check for _warnings_:
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
make linkcheck
|
2018-05-07 03:55:05 +02:00
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
1. To leave the shell, type: `exit`.
|
2018-05-07 03:55:05 +02:00
|
|
|
|
|
|
|
|
## Perform more comprehensive testing on your own staging doc site
|
|
|
|
|
|
|
|
|
|
If your changes are more comprehensive, you should do a full test of your fork
|
|
|
|
|
of the docs before sending a pull request to the Project X-Ray repo. You can
|
|
|
|
|
test your fork by viewing the docs on your own copy of the Read the Docs
|
|
|
|
|
build.
|
|
|
|
|
|
|
|
|
|
Follow these steps to create your own staging doc site on Read the Docs (RtD):
|
|
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Sign up for a RtD account here:
|
2018-05-07 03:55:05 +02:00
|
|
|
[https://readthedocs.org/](https://readthedocs.org/)
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Go to your [RtD connected
|
2018-05-07 03:55:05 +02:00
|
|
|
services](https://readthedocs.org/accounts/social/connections/), click
|
|
|
|
|
**Connect to GitHub**, and connect RtD to your GitHub account. (If you
|
|
|
|
|
decide not to do this, you'll need to import your project manually in the
|
|
|
|
|
following steps.)
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Go to [your RtD dashboard](https://readthedocs.org/dashboard/).
|
|
|
|
|
1. Click **Import a Project**.
|
|
|
|
|
1. Add your GitHub fork of the Project X-Ray project. Give your doc site a
|
2018-05-07 03:55:05 +02:00
|
|
|
**name** that distinguishes it from the canonical Project X-Ray docs. For
|
2018-05-07 04:14:02 +02:00
|
|
|
example, `your-username-prjxray`.
|
|
|
|
|
1. Make your doc site **protected**. See the [RtD guide to privacy
|
2018-05-07 03:55:05 +02:00
|
|
|
levels](http://docs.readthedocs.io/en/latest/privacy.html).
|
|
|
|
|
Reason for protecting your doc site: If you leave your doc site public, it
|
|
|
|
|
will appear in web searches. That may be confusing for readers who are
|
|
|
|
|
looking for the canonical Project X-Ray docs.
|
2018-05-07 04:14:02 +02:00
|
|
|
1. Set RtD to build from your branch, rather than from master. This ensures
|
2018-05-07 03:55:05 +02:00
|
|
|
that the content you see on your doc site reflect your latest updates:
|
2018-05-07 04:14:02 +02:00
|
|
|
- On [your RtD dashboard](https://readthedocs.org/dashboard/),
|
|
|
|
|
open **your project**, then go to **Admin > Advanced Settings.**
|
2018-05-07 03:55:05 +02:00
|
|
|
- Add the name of your branch in **Default branch**. This is the
|
|
|
|
|
branch that the "latest" build config points to. If you leave this field
|
|
|
|
|
empty, RtD uses `master` or `trunk`.
|
|
|
|
|
|
2018-05-07 04:14:02 +02:00
|
|
|
1. RtD now builds your doc site, based on the contents in your Project X-Ray
|
2018-05-07 03:55:05 +02:00
|
|
|
fork.
|
2018-05-07 04:14:02 +02:00
|
|
|
1. See the [RtD getting-started
|
2018-05-07 03:55:05 +02:00
|
|
|
guide](https://docs.readthedocs.io/en/latest/getting_started.html#import-docs)
|
|
|
|
|
for more info.
|
|
|
|
|
|
|
|
|
|
# 3. Send a pull request
|
|
|
|
|
|
|
|
|
|
Follow your standard GitHub process to send a pull request to the Project X-Ray
|
|
|
|
|
repo. See the GitHub guide to [creating a pull request from a
|
|
|
|
|
fork](https://help.github.com/articles/creating-a-pull-request-from-a-fork/).
|