Skip to content

Commit 0bf8984

Browse files
committed
fix references, refactor website style doc and others
1 parent bd26dee commit 0bf8984

File tree

5 files changed

+111
-222
lines changed

5 files changed

+111
-222
lines changed

developer/general/how-to-edit-the-rst-documentation.rst

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ How to edit the documentation
44

55
The Qubes OS documentation is stored as `reStructuredText (rST) <https://docutils.sourceforge.io/rst.html>`__ files in
66
the `qubes-doc <https://github.com/QubesOS/qubes-doc>`__ repository.
7+
78
We use `Sphinx <https://www.sphinx-doc.org/>`__ for building and
89
`Read The Docs (RTD) <https://readsthedocs.com/>`__ for hosting.
9-
RTD is a `continuous‑documentation deployment platform <https://docs.readthedocs.com/platform/stable/continuous-deployment.html>`__ that automatically detects changes in the qubes-doc GittHub repository and builds the latest version of the docs.
10+
RTD is a `continuous‑documentation deployment platform <https://docs.readthedocs.com/platform/stable/continuous-deployment.html>`__ that can automatically
11+
detect changes in a GitHub repository and build the latest version of a documentation.
1012

1113
.. figure:: /attachment/doc/rst-rtd-workflow.png
1214
:alt: Qubes OS Documentation Workflow - once new documentation is written or changed, it is built and verified with Sphinx, pushed on GitHub/GitLab and hosted on RTD
@@ -16,7 +18,8 @@ RTD is a `continuous‑documentation deployment platform <https://docs.readthedo
1618

1719
By cloning and regularly pulling from `qubes-doc <https://github.com/QubesOS/qubes-doc>`__ repository, users can maintain their
1820
own up-to-date offline copy of the Qubes documentation rather than
19-
relying solely on the web. EPUB or PDF versions of Qubes OS documenation can also
21+
relying solely on the web and either serve it locally or read the rST files directly.
22+
EPUB or PDF versions of Qubes OS documenation can also
2023
be downloaded from `doc.qubes-os.org <https://doc.qubes-os.org/en/latest/>`__:
2124

2225
|epub-pdf|
@@ -25,6 +28,8 @@ be downloaded from `doc.qubes-os.org <https://doc.qubes-os.org/en/latest/>`__:
2528
TODO screenshots with main branch instead of rst when rst merged in main
2629
TODO add draft pull request screenshot
2730
31+
32+
2833
The documentation is a volunteer community effort. People like you are
2934
constantly working to make it better. If you notice something that can
3035
be fixed or improved, please follow the steps below to open a pull
@@ -56,16 +61,17 @@ A few notes before we get started:
5661
work from the command line, you can skip the rest of this section. All
5762
you need to do to contribute is to `fork and clone <https://guides.github.com/activities/forking/>`__
5863
the `qubes-doc <https://github.com/QubesOS/qubes-doc>`__ repo, make your changes,
59-
then `submit a pull request <https://help.github.com/articles/using-pull-requests/>`__.)
64+
then `submit a pull request <https://help.github.com/articles/using-pull-requests/>`__.
65+
You can continue reading :ref:`viewing_pr`.)
6066

61-
Ok, let’s begin. Every documentation page has a Edit on GitHub link.
67+
Ok, let’s begin. Every documentation page has a :guilabel:`Edit on GitHub` link.
6268

6369
|page-source-button|
6470

6571
When you click on it, you’ll be taken to the source file — a reStructuredText (``.rst``) file — on GitHub.
6672

6773
On this page, there will be a
68-
button to edit the file (if you are already logged in in).
74+
button to edit the file (if you are already logged in).
6975

7076
..
7177
TODO screenshot when rst merged in main
@@ -79,12 +85,12 @@ You can also create a free account from here.
7985
|github-sign-in|
8086

8187
If this is your first contribution to the documentation, you need to
82-
:guilabel:`fork` the repository (make your own copy).
88+
fork the repository (make your own copy).
8389

8490
|fork1|
8591

8692
It’s easy — just click the
87-
green :guilabel:`Create fork` on the next page. This step is only needed the first
93+
green :guilabel:`Create fork` button on the next page. This step is only needed the first
8894
time you make a contribution.
8995

9096

@@ -94,24 +100,23 @@ Now you can make your modifications.
94100

95101
|fork3|
96102

97-
You can also preview the changes by clicking the :guilabel:`Preview changes` tab.
98-
99-
If you want to add images, read :ref:`how_to_add_images`. 
100-
and refer to :ref:`build_locally`
101-
if you want to locally verify that everything looks correct before submitting any changes.
103+
.. You can also preview the changes by clicking the :guilabel:`Preview changes` tab.
102104
103105
104106
|edit|
105107

108+
If you want to add images, read :ref:`how_to_add_images` and refer to :ref:`build_locally`
109+
if you want to locally verify that everything looks correct before submitting any changes.
110+
106111

107112
Once you’re finished, describe your changes at the bottom and click
108113
:guilabel:`Commit changes`.
109114

110115
|commit|
111116

112117
After that, you’ll see exactly what modifications you’ve made. At this
113-
stage, those changes are still in your own copy of the documentation
114-
(“fork”). If everything looks good, send those changes to us by pressing
118+
stage, those changes are still in your own copy (fork) of the documentation.
119+
If everything looks good, send those changes to us by pressing
115120
the :guilabel:`Create pull request` button.
116121

117122

@@ -135,11 +140,14 @@ can’t accept your pull request, we’ll post a comment explaining why we
135140
can’t.
136141

137142

143+
.. _viewing_pr:
144+
138145
Viewing your pull request on RTD
139146
--------------------------------
140147

141148
Every time you push a commit to your pull request, a build on RTD will be triggered.
142-
To view your PR you can go to Qubes OS builds on `RTD <https://app.readthedocs.org/projects/qubes-doc/builds/>`__:
149+
To view your PR you can go to Qubes OS builds on `RTD <https://app.readthedocs.org/projects/qubes-doc/builds/>`__,
150+
find the last build of your PR and click on it:
143151

144152
|pull-request-builds|
145153

@@ -198,14 +206,11 @@ If you want to add a newly created documentation file, do so as follows:
198206
.. code-block:: rst
199207
200208
.. toctree:
201-
old_doc_file_name
202-
new_doc_file_name
209+
/path/to/old_doc_file_name
210+
/path/to/new_doc_file_name
203211
204212
205213
Editing this file will change what appears on the documentation index.
206-
If your pull request (PR) adds, removes, or edits anything that should
207-
be reflected in the documentation index, please make sure you also
208-
submit an associated pull request against this file.
209214

210215
Please always be mindful that rST syntax is sensitive to indentation (3 spaces)!
211216

@@ -226,7 +231,7 @@ To add an image to a page, use the following syntax:
226231
:alt: Qubes desktop screenshot depicting <description>
227232
228233
229-
If you want to add a caption to the image, you may do so using the ``caption`` option of the `figure directive <https://docutils.sourceforge.io/docs/ref/rst/directives.html#figure>`__.
234+
If you want to add a caption to the image, you may do so using the optional ``caption`` of the `figure directive <https://docutils.sourceforge.io/docs/ref/rst/directives.html#figure>`__.
230235
Another way without a caption is to use the `image directive <https://docutils.sourceforge.io/docs/ref/rst/directives.html#image>`__.
231236

232237
Then, add your image(s) in a the :file:`attachment/doc` folder in the `qubes-doc <https://github.com/QubesOS/qubes-doc>`__
@@ -272,6 +277,27 @@ which will refer to :ref:`this section <introduction/faq:what does it mean to "d
272277
For further options and use cases please refer to `Cross-references <https://www.sphinx-doc.org/en/master/usage/referencing.html>`__.
273278

274279

280+
Qubes OS rST configuration
281+
==========================
282+
283+
:file:`qubes-doc` directory contains a build configuration file named :file:`conf.py`, used by Sphinx
284+
to define `input and output behaviour <https://www.sphinx-doc.org/en/master/usage/configuration.html>`__.
285+
It contains settings and extensions that define how the documentation will be generated.
286+
You can find it `here <https://github.com/QubesOS/qubes-doc/blob/rst/conf.py>`__.
287+
288+
You can also find a :file:`readthedocs.yml` `file <https://github.com/QubesOS/qubes-doc/blob/rst/.readthedocs.yaml>`__
289+
which tells RTD how to build the documentation. It defines the build environment, Python version, required dependencies,
290+
and which Sphinx configuration to run. Thus RTD automatically generates and hosts the docs.
291+
292+
293+
Extensions
294+
----------
295+
296+
We use several Sphinx `extensions <https://www.sphinx-doc.org/en/master/usage/extensions/index.html>`__
297+
as defined in :file:`conf.py`, as well a simple custom one to embed YouTube videos,
298+
which can be found `here <https://github.com/QubesOS/qubes-doc/tree/rst/_ext>`__.
299+
300+
275301
.. _build_locally:
276302

277303
Building the rST documentation locally
@@ -282,7 +308,9 @@ In order to build the Qubes OS rST documentation locally clone the `qubes-doc <h
282308
(or your forked one if you want to submit a pull request).
283309

284310

285-
It is recommended to use a virtual environment, f.ex. venv or uv poetry.
311+
It is recommended to use a virtual environment, f.ex.
312+
`venv <https://docs.python.org/3/library/venv.html>`__,
313+
`poetry <https://python-poetry.org/>`__ or `uv <https://docs.astral.sh/uv/>`__.
286314
In the following section there is a sample setup to prepare local environments
287315
for building Qubes OS rST documentation.
288316

@@ -428,7 +456,7 @@ A :file:`pyproject.toml` file is provided.
428456
$ poetry run sphinx-autobuild ../qubes-doc _build/html
429457
430458
431-
You can also use `uv <https://docs.astral.sh/uv/getting-started/>`__ as you wish.
459+
You can also use `uv <https://docs.astral.sh/uv/getting-started/>`__ if you wish.
432460

433461

434462
Editor
@@ -445,32 +473,10 @@ An editor you can use is `ReText <https://github.com/retext-project/retext>`__ b
445473
$ pip3 install ReText
446474
447475
448-
Configuration
449-
-------------
450-
451-
Qubes-doc directory contains a build configuration file named :file:`conf.py`, used by Sphinx
452-
to define `input and output behaviour <https://www.sphinx-doc.org/en/master/usage/configuration.html>`__.
453-
It contains settings and extensions that define how the documentation will be generated.
454-
455-
You can find it `here <https://github.com/QubesOS/qubes-doc/blob/rst/conf.py>`__.
456-
457-
You can also find a :file:`readthedocs.yml` `file <https://github.com/QubesOS/qubes-doc/blob/rst/.readthedocs.yaml>`__
458-
which tells RTD how to build the documentation. It defines the build environment, Python version, required dependencies,
459-
and which Sphinx configuration to run. Thus RTD automatically generates and hosts the docs.
460-
461-
462-
Extensions
463-
----------
464-
465-
We use several Sphinx `extensions <https://www.sphinx-doc.org/en/master/usage/extensions/index.html>`__
466-
as defined in :file:`conf.py`, as well a simple custom one to embed YouTube videos,
467-
which can be found `here <https://github.com/QubesOS/qubes-doc/tree/rst/_ext>`__.
468-
469-
470476
Security
471477
========
472478

473-
Also see: :ref:`FAQ: Why is the documentation hosted on ReadTheDocs as opposed to the website? <introduction/faq:why is the documentation hosted on readthedocs as opposed to the website?>`.
479+
Also see: :ref:`FAQ: Why is the documentation hosted on ReadTheDocs as opposed to the website? <introduction/faq:why is the documentation hosted on readthedocs as opposed to the website?>`
474480

475481
All pull requests (PRs) against `qubes-doc <https://github.com/QubesOS/qubes-doc>`__ must pass review
476482
prior to be merged, except in the case of :ref:`external documentation <index:external documentation>`
@@ -533,3 +539,5 @@ you are not willing or able to do so.)
533539
:alt: Highlights the View Docs button in a specific build for a pull request <number> on RTD
534540
.. |epub-pdf| image:: /attachment/doc/rst-rtd-epub-pdf.png
535541
:alt: Highlights from where one can download a ePUB or PDF of hte Qubes OS documentation deployed on RTD
542+
:scale: 20 %
543+
:align: middle

developer/general/how-to-edit-the-website.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,10 @@ Quick intro to Jekyll
6969

7070
- *Reading data*: YAML front‑matter in :file:`pages/_posts` and files under :file:`_data` give variables you can reuse.
7171
- *Applying layouts*: HTML layout files wrap your content, letting you keep a consistent header/footer, navigation, etc.
72-
- *Processing includes*: Reusable snippets (HTML/Jinja‑style) can be dropped into pages.
72+
- *Processing includes*: Reusable snippets (HTML/`Liquid <https://jekyllrb.com/docs/liquid/>`__) can be dropped into pages.
7373
- *Compiling assets*: SASS/SCSS files become CSS, JavaScript is copied as‑is.
7474
- *Generating the output*: All source files are rendered into a :file:`_site` folder that contains the ready‑to‑serve static files.
7575

76-
7776
The main `qubesos.github.io <https://github.com/QubesOS/qubesos.github.io>`__ contains the following directories:
7877

7978
.. code:: bash
@@ -87,7 +86,7 @@ The main `qubesos.github.io <https://github.com/QubesOS/qubesos.github.io>`__ co
8786
├── _hcl # ← “qubes‑hcl” submodule – custom content for HCL pages
8887
│ └── ... #
8988
90-
├── _includes # ← Reusable HTML/Jinja snippets
89+
├── _includes # ← Reusable HTML/Liquid snippets
9190
│ └── *.html # include with {% include filename.html %} in Markdown or layouts
9291
9392
├── _layouts # ← Page templates that wrap content

0 commit comments

Comments
 (0)