Skip to content

Commit ca50348

Browse files
committed
[py] Update instructions for docs
1 parent fce924d commit ca50348

File tree

1 file changed

+30
-26
lines changed

1 file changed

+30
-26
lines changed

py/docs/README.rst

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,56 @@ How to build docs
1111
=================
1212

1313
One can build the Python documentation without doing a full bazel build. The
14-
following instructions will build the setup a virtual environment and installs tox, clones the
15-
selenium repo and then runs ``tox -c py/tox.ini`` building the Python documentation.
14+
following instructions will build the setup a virtual environment and installs tox,
15+
clones the selenium repo and then runs ``tox -c py/tox.ini`` building the Python documentation.
1616

1717
.. code-block:: console
1818
19-
virtualenv test-py38-env
20-
source test-py38-env/bin/activate
19+
python3 -m venv
20+
source venv/bin/activate
2121
pip install tox
2222
git clone [email protected]:SeleniumHQ/selenium.git
2323
cd selenium/
2424
# uncomment and switch to your development branch if needed
2525
#git switch -c feature-branch origin/feature-branch
2626
tox -c py/tox.ini
2727
28-
Works in similar manner as the larger selenium bazel doing just the python documentation portion.
28+
This works in a similar manner as the larger selenium bazel build, but does just the Python
29+
documentation portion.
2930

3031
What is happening under the covers of tox, sphinx
3132
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32-
tox is essentially a build tool for Python. Here it setups its own virtualenv and installs the
33-
documentation packages (sphinx and jinja2) as well as the required selenium python
34-
dependencies. Then tox runs the sphinx generate autodoc stub files and then builds the docs.
33+
tox is essentially a build tool for Python. Here it sets up its own virtual env and installs
34+
the documentation packages (sphinx and jinja2) as well as the required selenium python
35+
dependencies. Then tox runs the ``sphinx-autogen`` command to generate autodoc stub pages.
36+
Then it runs ``sphinx-build`` to build the HTML docs.
3537

3638
Sphinx is .. well a much larger topic then what we could cover here. Most important to say
37-
here is that the docs are using the "classic" theme and than the majority of the api documentation
38-
is autogenerated. There is plenty of information available and currently the documentation is
39-
fairly small and not complex. So some basic understanding of restructed text and the Sphinx tool chain
40-
should be sufficient to contribute and develop the Python docs.
39+
here is that the docs are using the "sphinx_rtd_theme" theme (AKA "Read the Docs" theme) and
40+
the the majority of the api documentation is autogenerated. There is plenty of information
41+
available and currently the documentation is fairly small and not complex. So some basic
42+
understanding of reStructuredText and the Sphinx tool chain should be sufficient to contribute
43+
and develop the Python docs.
4144

4245
To clean up the build / tox cache
4346
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44-
Although there is a Sphinx Makefile option to clean up using the tox environment above one can
45-
manually clean the build by deleting the build directory on the root (selenium/build using the
46-
default directory on git clone). Noting that both Sphinx and tox cache parts of their build and
47-
recognize changes to speed up their respective builds. But at times one wants to start fresh
48-
deleting the aformentioned directory will clean the Sphinx cache or removing selenium/py/.tox
49-
directory for cleaning the tox environment.
47+
Although there is a Sphinx Makefile option to clean up using the tox environment above, one can
48+
manually clean the build by deleting the build directory on the root (``selenium/build`` using the
49+
default directory on git clone). Note that both Sphinx and tox cache parts of their build and
50+
recognize changes to speed up their respective builds. To start fresh, delete the aformentioned
51+
directory to clean the Sphinx cache and delete the ``selenium/py/.tox`` directory to clean the
52+
tox environment.
5053

5154

5255
Known documentation issues
5356
==========================
5457
The API Reference primarily builds from the source code. But currently the initial template stating
55-
which modules to document is hard coded within py/docs/source/api.rst. So if modules are added or
56-
removed then the generated docs will be inaccurate. It would be preferred that the API docs generate
57-
soley from the code if possible. This is being tracked in `#14178 <https://github.com/SeleniumHQ/selenium/issues/14178>`_
58+
which modules to document is hard coded within ``py/docs/source/api.rst``. So if modules are added or
59+
removed, then the generated docs will be inaccurate. It would be preferred that the API docs generate
60+
soley from the code if possible. This is being tracked in
61+
`#14178 <https://github.com/SeleniumHQ/selenium/issues/14178>`_
5862

59-
We are working through the Sphinx build Warnings and Errors trying to clean up botht the syntax and
63+
We are working through the Sphinx build warnings and errors, trying to clean up both the syntax and
6064
the build.
6165

6266
Contributing to Python docs
@@ -65,7 +69,7 @@ First it is recommended that you read the main `CONTRIBUTING.md <https://github.
6569

6670
Some steps for contibuting to the Python documentation ..
6771

68-
- Check out changes locally using instruction above.
69-
- Try to resolve any warnings/issues.
70-
- If too arduous either ask for help or add to list of known issue.
71-
- If this process is updated please update this doc as well to help the next person.
72+
- Check out changes locally using instructions above.
73+
- Try to resolve any warnings/errors.
74+
- If too arduous, either ask for help or add to the list of known issues.
75+
- If this process is updated, please update this doc as well to help the next person.

0 commit comments

Comments
 (0)