Skip to content

Commit d516948

Browse files
authored
Updated docs for maintainers (#179)
* Updated docs for maintainers * Review comments * Review comments
1 parent 9aebd37 commit d516948

File tree

10 files changed

+191
-52
lines changed

10 files changed

+191
-52
lines changed

docs/source/commands.rst

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,37 @@ To preview the docs:
2020
2121
2. Open http://127.0.0.1:5500/ with your preferred browser.
2222

23-
You can pass custom options to increase or decrease verbosity. For a list of all the available options, refer to the `Sphinx documentation <https://www.sphinx-doc.org/en/master/man/sphinx-build.html>`_.
24-
For example:
23+
.. tip:: You can pass custom options to increase or decrease verbosity. For a list with all the available options, refer to the `Sphinx documentation <https://www.sphinx-doc.org/en/master/man/sphinx-build.html>`_.
24+
25+
To increase verbosity, use the option ``-v``:
2526

2627
.. code:: console
2728
2829
make preview SPHINXOPTS=-v
2930
30-
Preview multiversion
31-
--------------------
32-
The multiversionpreview generates a local instance of the docs site with all specified versions available for navigation. You can view the rendering in a sandbox environment on your local browser.
33-
To preview multiple versions:
34-
35-
1. Build the docs.
31+
To decrease verbosity, use the option ``-Q``:
3632

3733
.. code:: console
3834
39-
cd docs
40-
make previewmultiversion
41-
42-
2. Open http://0.0.0.0:5500/ with your preferred browser.
35+
make preview SPHINXOPTS=-Q
4336
44-
If the version drop-down menu does not contain the all of the listed versions, try to run ``git fetch --tags`` to download the latest tags from remote.
4537
46-
Build HTML for the current branch
47-
---------------------------------
38+
Preview multiversion
39+
--------------------
4840

49-
To generate an HTML version:
41+
The multiversionpreview command generates a local instance of the docs site with all :doc:`specified versions <../configuration/multiversion>` available for navigation.
42+
You can view the rendering in a sandbox environment on your local browser.
43+
To preview multiple versions:
5044

5145
1. Build the docs.
5246

5347
.. code:: console
5448
5549
cd docs
56-
make dirhtml
50+
make multiversionpreview
51+
52+
2. Open http://0.0.0.0:5500/ with your preferred browser.
5753

58-
2. The previous command should generate HTML docs under the ``docs/_build/dirhtml`` directory.
5954

6055
Build HTML for multiple versions
6156
--------------------------------
@@ -73,6 +68,8 @@ To generate multiple versions of the documentation:
7368
7469
2. The previous command should generate HTML docs under the ``docs/_build/dirhtml`` directory.
7570

71+
.. tip:: If the command raises an error, see :doc:`Troubleshooting <configuration/troubleshooting>` for help.
72+
7673
Clean all builds
7774
----------------
7875

docs/source/configuration/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ Configuration
77

88
template
99
multiversion
10-
10+
troubleshooting
11+
1112
.. panel-box::
1213
:title: Overview
1314
:id: "getting-started"
1415
:class: my-panel
1516

1617
* :doc:`Template Options <template>` - Configuration options for this theme.
1718
* :doc:`Multiversion Options <multiversion>` - Configuration options for the multiversion extension.
19+
* :doc:`Troubleshooting <multiversion>` - Help to resolve common issues.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
===============
2+
Troubleshooting
3+
===============
4+
5+
Multiversion
6+
------------
7+
8+
.. _Sync_Fork:
9+
10+
I cannot see my latest local changes
11+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+
By default, the command builds the documentation that is available on GitHub (remote repository).
14+
15+
To build multiversion docs for the local branches:
16+
17+
1. In ``conf.py``, set ``smv_remote_whitelist`` to ``None``:
18+
19+
.. code:: console
20+
21+
smv_remote_whitelist = None
22+
23+
2. Follow `Syncing a Fork <https://docs.github.com/es/github/collaborating-with-pull-requests/working-with-forks/syncing-a-fork>`_ for every branch not updated in your fork.
24+
25+
3. Run ``make multiversionpreview`` again.
26+
27+
.. _Preview_Production:
28+
29+
I want to preview the documentation published in production
30+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31+
32+
1. Follow `these steps <https://docs.github.com/es/github/collaborating-with-pull-requests/working-with-forks/syncing-a-fork>`_ to configure a remote that points to the upstream repository in Git.
33+
34+
2. Download the latest tags and branches from upstream:
35+
36+
.. code:: console
37+
38+
git fetch --all
39+
40+
3. Edit the setting ``smv_remote_whitelist`` in the file `conf.py` to build the docs from upstream as follows:
41+
42+
.. code:: console
43+
44+
smv_remote_whitelist = r"^upstream$"
45+
46+
4. Run the command ``make multiversionpreview`` again.
47+
48+
No matching refs found!
49+
^^^^^^^^^^^^^^^^^^^^^^^
50+
51+
If the console raises the error "No matching refs found!", most likely your fork is not updated with the upstream repository.
52+
53+
In this case, you can:
54+
55+
* Build multiversion docs for the upstream repository. See :ref:`Preview documentation published in production <Preview_Production>` (recommended)
56+
* Sync the fork with the upstream repository. See :ref:`Preview latest local changes <Sync_Fork>`
57+
58+
Another frequent mistake that raises the error message is to have typos in the configuration file. Make sure that the version names listed in ``TAGS`` and ``BRANCHES`` settings from ``conf.py`` match the repository's branch and tags names on Git.

docs/source/contribute/contribute-docs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Submit a pull request (PR)
216216

217217
We expect that you are aware of how to submit a PR to GitHub. If you are not, please look at this `tutorial <https://guides.github.com/activities/hello-world/>`_.
218218
Every repository handles PRs differently. Some require you to use a template for submissions and some do not.
219-
Make sure to speak with your project’s maintainer before submitting the PR to avoid any misunderstanding or issues.
219+
Make sure to speak with the project’s maintainer before submitting the PR to avoid any misunderstanding or issues.
220220

221221
If you are writing new content it is **highly recommended** to set your PR to a draft state.
222222
For Documentation PRs, the following guidelines should be applicable to all Scylla projects:

docs/source/examples/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Examples
1212
images
1313
links
1414
lists
15+
markdown
1516
panel-box
1617
substitutions
1718
tables
@@ -31,6 +32,7 @@ Examples
3132
* :doc:`Images <images>`
3233
* :doc:`Links <links>`
3334
* :doc:`Lists <lists>`
35+
* :doc:`Markdown <markdown>`
3436
* :doc:`Panel Box <panel-box>`
3537
* :doc:`Substitutions <substitutions>`
3638
* :doc:`Tables <tables>`

docs/source/examples/markdown.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Markdown Support
2+
3+
The theme supports writing documents in MarkDown thanks to the extension [recommonmark](https://github.com/readthedocs/recommonmark).
4+
5+
## MarkDown Cheatsheet
6+
7+
For Markdown syntax reference, you can use this `Cheatsheet <https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet>`_.
8+
9+
## Using directives in MarkDown
10+
11+
You can use all restructuredText directives with the ``eval_rst`` code block. Here's an example:
12+
13+
``` rst
14+
```eval_rst
15+
.. autoclass:: recommonmark.transform.AutoStructify
16+
:show-inheritance:
17+
```
18+
```

docs/source/getting-started/index.rst

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,47 @@
22
Getting Started
33
===============
44

5-
This site is a guide for using ``sphinx-scylladb-theme`` in ScyllaDB documentation projects.
6-
7-
The theme's source code is hosted on `GitHub <https://github.com/scylladb/sphinx-scylladb-theme>`_.
8-
The repository also contains a `sample documentation project <https://github.com/scylladb/sphinx-scylladb-theme/tree/master/docs>`_ using this theme.
9-
10-
Theme Features
11-
--------------
12-
13-
* Bundled as a `PyPI <https://pypi.org/project/sphinx-scylladb-theme/>`_ package for easier installation/upgrading.
14-
* Support for files written in Markdown and reStructuredText.
15-
* Compatible with `GitHub Pages <../github-pages>`_.
16-
* Build docs for `different versions <../configuration/multiversion>`_ of your project.
17-
* Shared search engine between documentation projects.
18-
19-
Documentation
20-
-------------
5+
For Docs Maintainers
6+
--------------------
217

228
.. panel-box::
23-
:title: For Docs Maintainers
9+
:title: Documentation
2410
:id: "components"
2511
:class: my-panel
2612

27-
#. `Add Sphinx & theme to your project <installation>`_
28-
#. `Configure the theme <../configuration/template>`_
29-
#. `List new versions <../configuration/multiversion>`_
30-
#. `Publish to GitHub Pages <../github-pages>`_
31-
#. `Commands to build docs <../commands>`_
13+
* :doc:`Read about the toolchain <toolchain>`
14+
* :doc:`Add Sphinx & theme to a project <installation>`
15+
* :doc:`Configure the theme <../configuration/template>`
16+
* :doc:`List new versions <../configuration/multiversion>`
17+
* :doc:`Publish to GitHub Pages <../github-pages>`
18+
* :doc:`Commands to build docs <../commands>`
19+
20+
For Docs Contributors
21+
---------------------
3222

3323
.. panel-box::
34-
:title: For Docs Contributors
24+
:title: Documentation
3525
:id: "components"
3626
:class: my-panel
3727

38-
`Scylla Docs Contributor’s Handbook <../contribute/contribute-docs>`_
39-
`Markup Guide for Docs Contributors <../contribute/markup-guide>`_
28+
* :doc:`Scylla Docs Contributor’s Handbook <../contribute/contribute-docs>`
29+
* :doc:`Markup Guide for Docs Contributors <../contribute/markup-guide>`
30+
4031

32+
For Theme Maintainers
33+
---------------------
4134

4235
.. panel-box::
43-
:title: For Theme Contributors
36+
:title: Documentation
4437
:id: "components"
4538
:class: my-panel
4639

47-
`Contribute to the Theme <../contribute/contribute-theme>`_
40+
:doc:`Contribute to the Theme <../contribute/contribute-theme>`
4841

4942
.. toctree::
5043
:maxdepth: 2
5144
:glob:
5245
:hidden:
5346

47+
toolchain
5448
installation

docs/source/getting-started/installation.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Installation
33
============
44

5-
This guide explains how to install Sphinx and this theme in a ScyllaDB project.
5+
This guide explains how to add the documentation toolchain to a project hosted on GitHub.
66

77
1. Copy the ``docs`` and ``.github`` directories from the repository `scylladb/sphinx-scylladb-theme <https://github.com/scylladb/sphinx-scylladb-theme>`_
88
to the project root directory where you want to set up docs. The directory structure should look like this:
@@ -34,4 +34,3 @@ to the project root directory where you want to set up docs. The directory struc
3434

3535
6. From the command line, run ``make preview`` within the ``docs`` folder. Fix any warnings raised by Sphinx. Once the docs build without errors, open ``http://127.0.0.1:5500/`` to preview the generated site.
3636

37-
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
=========
2+
Toolchain
3+
=========
4+
5+
Here are some basic concepts you should know before adding the doc toolchain to a project.
6+
7+
Markup language
8+
---------------
9+
10+
Most docs are written in RestructuredText. RestructuredText is a file format for textual data used primarily for technical documentation.
11+
12+
Alternatively, you can also use :doc:`MarkDown <../examples/markdown>` to create content pages.
13+
14+
`Learn more <https://www.sphinx-doc.org/es/master/usage/restructuredtext/index.html>`__
15+
16+
Sphinx
17+
------
18+
19+
The tool we used to converts restructuredText and Markdown to HTML.
20+
Sphinx also has directives and extensions to add additional options for formatting the text.
21+
22+
`Learn more <https://www.sphinx-doc.org>`__
23+
24+
ScyllaDB Sphinx Theme
25+
---------------------
26+
27+
The theme all Scylla documentation projects share to have a common look and feel.
28+
It also adds a set of custom functionallities available to make them available to all projects.
29+
30+
`Learn more <https://github.com/scylladb/sphinx-scylladb-theme>`__
31+
32+
Multiversion Extension
33+
----------------------
34+
35+
The extension Scylla docs use to build docs for different versions.
36+
37+
`Learn more <https://github.com/Holzhaus/sphinx-multiversion>`__
38+
39+
GitHub
40+
------
41+
42+
Hosts the code and docs source files of Scylla's proejcts.
43+
44+
`Learn more <https://github.com>`__
45+
46+
GitHub Pages
47+
------------
48+
49+
Hosts the HTML version of the docs generated by Sphinx.
50+
51+
`Learn more <https://pages.github.com/>`__
52+
53+
GitHub Actions
54+
--------------
55+
56+
Builds and deploys the documentation to GitHub Pages every time there is new content.
57+
All the repositories deploy the documentation automatically except the repository scylla-docs, which is deployed manually.
58+
59+
`Learn more <https://docs.github.com/actions>`__

docs/source/github-pages.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ When :doc:`multiversion <../configuration/multiversion>` is enabled, GitHub Page
99
Enabling GitHub Pages
1010
---------------------
1111

12-
#. Create a file named ``.github/pages.yaml`` in your project's root repository.
12+
#. Create a file named ``.github/pages.yaml`` in the project's root repository.
1313

1414
#. Copy the contents from `this file <https://github.com/scylladb/sphinx-scylladb-theme/blob/master/.github/workflows/pages.yml>`_ into ``.github/pages.yaml``.
1515

16-
#. (Optional) If your repository default branch is not ``master``, edit the configuration file to use the default branch name instead.
16+
#. (Optional) If the repository default branch is not ``master``, edit the configuration file to use the default branch name instead.
1717

1818
#. Commit and push the changes to GitHub (default branch).
1919

2020
#. Wait a couple of minutes; it might take a while until GitHub builds the site. If everything goes well, you will see the docs published under ``https://scylladb.github.io/<repository-slug>``.
2121

22-
2322
Setting up a custom domain
2423
--------------------------
2524

@@ -38,3 +37,14 @@ Disabling GitHub Pages
3837

3938
To disable the docs deployment temporarily, see `Unpublishing a GitHub Pages Site <https://help.github.com/en/github/working-with-github-pages/unpublishing-a-github-pages-site#unpublishing-a-project-site>`_.
4039

40+
Triggering builds manually
41+
---------------------------
42+
43+
Re-running workflows is useful when:
44+
45+
- The theme received an update. By running the last build manually, the documentation project will receive the latest version. Otherwise, the theme will be automatically updated when the default branch gets an update.
46+
47+
- A previous version (branch or a tag) received a patch. Otherwise, the changes will not be reflected in production until the master branch gets an update.
48+
49+
To re-run a workflow see, `Re-running a workflow <https://docs.github.com/en/actions/managing-workflow-runs/re-running-a-workflow>`_.
50+

0 commit comments

Comments
 (0)