qubes-doc/developer/general/rst-documentation-style-guide.rst
parulin 1449df1f53
Update release-specific documentation
I believe the removed part is now outdated, considering that
https://github.com/QubesOS/qubes-issues/issues/5308 is closed.

Also, I would like to make a proposal to mention change between
versions.
2025-12-14 04:40:30 -05:00

882 lines
33 KiB
ReStructuredText
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

===========================================
reStructuredText documentation style guide
===========================================
*Also see* :doc:`How to edit the documentation </developer/general/how-to-edit-the-rst-documentation/>`.
This page explains the standards we follow for writing, formatting, and organizing the documentation.
Please follow these guidelines and conventions when editing the rST documentation.
For the standards governing the website (as opposed to the rST documentation hosted on `https://doc.qubes-os.org <https://doc.qubes-os.org>`__),
please see the :doc:`Website style guide </developer/general/website-style-guide>`.
If you wish to submit a pull request regarding content hosted on the website, please refer to
:doc:`How to edit the website </developer/general/how-to-edit-the-website/>`.
reStructuredText conventions
----------------------------
All the documentation is written in `reStructuredText (rST) <https://docutils.sourceforge.io/rst.html>`__. When making contributions, please observe the following style conventions.
If youre not familiar with reStructuredText syntax, `the Sphinx primer <https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`__
is a great resource, as well as `this quick reStructuredText <https://docutils.sourceforge.io/docs/user/rst/quickref.html>`__.
Please always be mindful that rST syntax is sensitive to indentation!
Directives
^^^^^^^^^^
A `directive <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html>`__ is a generic block of explicit markup,
provided by `Docutils <https://www.docutils.org/>`__ and extended by `Sphinx <https://www.sphinx-doc.org/>`__.
Directives are used to insert non-paragraph content, such as images, tables, and code blocks.
Example directives are:
.. code:: rst
.. image::
.. code::
.. figure::
Directives start with ``..``, followed by directive name, arguments, options, and indented content.
Images
""""""
To include images (without a caption), use the ``image`` directive.
You need to specify the path to the image and an alt text.
.. code:: rst
.. image:: path/to/image.png
:alt: Alternative text
:width: 200px
:align: center
Read The Docs and the HTML `sphinx-rtd-theme <https://sphinx-rtd-theme.readthedocs.io/en/stable/>`__ in use
have a responsive design, which allows the documentation to render appropriately across all screen sizes.
Make sure to link only to images in the :file:`attachment/doc` folder of the `qubes-doc <https://github.com/QubesOS/qubes-doc>`__ repository.
Do not attempt to link to images hosted on other websites.
See also :ref:`how_to_add_images` for the further information and about using the ``figure`` directive.
Lists
"""""
`Lists <https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#lists-and-quote-like-blocks>`__ can be bullet lists (\*, +, -), enumerated lists (1., 2., etc.), definition lists, field lists.
Nested lists must be separated from the parent list items by blank lines:
.. code:: rst
- Item 1
- Item 2
- Subitem 2.1
- Subitem 2.2
- Item 3
Numbered lists can be autonumbered using the ``#`` sign.
.. code:: rst
#. Item 1
#. Item 2
#. Subitem 2.1
#. Subitem 2.2
#. Item 3
Item 3 will start at 1.
Code blocks
"""""""""""
When writing code blocks, use syntax highlighting within the `code <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code>`__
or `code-block <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code-block>`__.
By specifying the language, you enable pygments, which show syntax color coding for that code sample (see `here <https://pygments.org/languages/>`__ for a list of supported languages).
.. code:: rst
.. code:: language
code
Use ``[...]`` for anything omitted.
For inlining small code snippets you can use the `code role <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-code>`__ as in
.. code:: rst
`code:`:term:`qube``
You can add line numbers to code examples with the ``:linenos:`` parameter.
.. code:: rst
.. code:: python
:linenos:
def hello_world():
print("Hello, world!")
You can have certain lines with the ``:emphasize-lines:`` parameter.
.. code:: rst
.. code:: python
:emphasize-lines: 1,3,4
For Python use ``python``.
.. code:: rst
.. code:: python
string_var = 'python'
For Bash use ``bash``.
.. code:: rst
.. code:: bash
#!/bin/bash
For a terminal session use ``console``.
.. code:: rst
.. code:: console
$ echo "Hello"
For text output use ``output``.
.. code:: rst
.. code:: output
some output
For text use ``text``.
.. code:: rst
.. code:: text
some text
Tables
""""""
We adhere to the list tables directive by docutils as described `here <https://docutils.sourceforge.io/docs/ref/rst/directives.html#list-table-1>`__.
A simple example would be:
.. code:: rst
.. list-table::
:widths: 15 10
:align: center
:header-rows: 1
* - Header 1
- Header 2
* - Cell 1
- Cell 2
* - Cell 3
- Cell 4
Admonitions, messages, and warnings
"""""""""""""""""""""""""""""""""""
`Admonitions, messages, and warnings <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#admonitions-messages-and-warnings>`__ are used to draw the readers attention to important information, such as warnings, and for stylistic purposes.
They are typically styled as colored text boxes, usually accompanied by icons provided out of the box by Sphinx and rST.
Alerts should generally be used somewhat sparingly, so as not to cause `alert fatigue <https://en.wikipedia.org/wiki/Alarm_fatigue>`__.
Here are examples of several types of alerts:
.. code:: rst
.. hint::
**Did you know?** The Qubes OS installer is completely offline. It doesn't
even load any networking drivers, so there is no possibility of
internet-based data leaks or attacks during the installation process.
.. note::
**Note:*</b>** Using Rufus to create the installation medium means that you
`wont be able <https://github.com/QubesOS/qubes-issues/issues/2051">`__
to choose the "Test this media and install Qubes OS" option mentioned in the
example below. Instead, choose the "Install Qubes OS" option.
.. warning::
**Note:** Qubes OS is not meant to be installed inside a virtual machine
as a guest hypervisor. In other words, **nested virtualization** is not
supported. In order for a strict compartmentalization to be enforced, Qubes
OS needs to be able to manage the hardware directly.
.. danger::
**Warning:** Qubes has no control over what happens on your computer
before you install it. No software can provide security if it is installed on
compromised hardware. Do not install Qubes on a computer you don't trust. See
installation security for more information.
These render as:
.. hint::
**Did you know?** The Qubes OS installer is completely offline. It doesn't
even load any networking drivers, so there is no possibility of
internet-based data leaks or attacks during the installation process.
.. note::
**Note:** Using Rufus to create the installation medium means that you
`won't be able <https://github.com/QubesOS/qubes-issues/issues/2051>`__
to choose the "Test this media and install Qubes OS" option mentioned in the
example below. Instead, choose the "Install Qubes OS" option.
.. warning::
**Note:** Qubes OS is not meant to be installed inside a virtual machine
as a guest hypervisor. In other words, **nested virtualization** is not
supported. In order for a strict compartmentalization to be enforced, Qubes
OS needs to be able to manage the hardware directly.
.. danger::
**Warning:** Qubes has no control over what happens on your computer
before you install it. No software can provide security if it is installed on
compromised hardware. Do not install Qubes on a computer you don't trust. See
installation security for more information.
Describing changes between releases
"""""""""""""""""""""""""""""""""""
Sphinx gives you the ability to mark changes between any version of Qubes OS. Any new feature, change, deprecation or removed feature between the previous version and the current version of the documentation should be marked using the corresponding directive.
Those directives should be removed if they mention a previous version, i.e.: no directive concerning Qubes R4.2 should stay in the documentation about Qubes R4.3.
.. list-table::
:widths: 50 50
:header-rows: 1
* - reStructuredText markup
- output
* - .. code:: rst
.. versionadded:: R4.3
- .. versionadded:: R4.3
* - .. code:: rst
.. versionchanged:: R4.3
- .. versionchanged:: R4.3
* - .. code:: rst
.. deprecated:: R4.3
- .. deprecated:: R4.3
* - .. code:: rst
.. versionremoved:: R4.3
- .. versionremoved:: R4.3
Glossary
""""""""
The Sphinx `glossary directive <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#glossary>`__
is created with a simple ``.. glossary::`` block in :file:`/user/reference/glossary.rst`.
Anywhere else in the documentation you can link to a term using the role: :code:`:term:`qube``
which automatically generates a hyperlink to the glossary entry :term:`qube`.
Roles
^^^^^
Sphinx uses interpreted text `roles <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html>`__ to insert semantic markup into documents
and thus enhance the readability and consistency of the documentation.
Syntax is as follows:
.. code:: rst
:rolename:`content`
In Qubes OS documentation the `doc <https://www.sphinx-doc.org/en/master/usage/referencing.html#role-doc>`__ and
`ref <https://www.sphinx-doc.org/en/master/usage/referencing.html#role-ref>`__ roles are used extensively
as described in :ref:`cross_referencing`.
Some of the roles used in the Qubes OS documentation so far are:
- the ``:file:`` `role <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-file>`__
- the ``:guilabel:`` `role <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-guilabel>`__
- the ``:menuselection:`` `role <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-menuselection>`__
- the ``:samp:`` `role <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-samp>`__
- the ``:kbd:`` `role <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-kbd>`__
Please continue using the above or new ones where appropriate.
Cross referencing:
^^^^^^^^^^^^^^^^^^
- Use the `:doc:` role with a path and a custom link text:
.. code:: rst
:doc:`contributions </introduction/contributing>`.
- Use the `:doc:` role with a path:
.. code:: rst
:doc:`/introduction/intro`
- Use `:ref:` for specific sections and a custom link text
.. code:: rst
:ref:`What is Qubes OS? <introduction/intro:what is qubes os?>`
- Use `:ref` only with a unique label above the specific section:
.. code:: rst
.. _cross_referencing:
TL;DR: Cross-referencing
------------------------
and link to the section from within the documentation using :code:`:ref:`cross_referencing``.
For further information please see :ref:`cross_referencing`.
External cross-referencing
""""""""""""""""""""""""""
You can make a cross-reference to any of the projects of the external developer's documentation (hosted on https://dev.qubes-os.org):
* :doc:`core-admin <core-admin:index>`
* :doc:`core-admin-client <core-admin-client:index>`
* :doc:`core-qrexec <core-qrexec:index>`
To do such a cross-reference, use the usual cross-reference syntax but with the following prefix: :samp:`{PROJECT_NAME}:` (replace :samp:`{PROJECT_NAME}` by the name of the project). As an example, if you want to link to the index of the core-admin documentation, use this:
.. list-table::
:widths: 50 50
:header-rows: 1
* - reStructuredText markup
- output
* - .. code:: rst
:doc:`core-admin:index`
- :doc:`core-admin:index`
This is equivalent to using ``:doc:`index``` inside the core-admin documentation. This works with any role like ``:ref:``, ``:option:``, etc.
Even if it works without it, always prefix the external cross-references with the name of the project, to help other contributors and maintainers to figure out what is going on.
.. note::
Intersphinx `can list all the available links <https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#showing-all-links-of-an-intersphinx-mapping-file>`__ to another project with the following command:
.. code:: console
python3 -m sphinx.ext.intersphinx https://dev.qubes-os.org/projects/core-admin/en/latest/objects.inv
You can replace ``core-admin`` by any of the projects listed above.
Hyperlink syntax
^^^^^^^^^^^^^^^^
Use non-reference-style links like
.. code:: rst
`website <https://example.com/>`__
Do *not* use reference-style links like
.. code:: rst
Some text link_
:: _link:: https://example.org
This facilitates the localization process.
Take a look also at :ref:`cross_referencing`.
Relative vs. absolute links
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Always use relative rather than absolute paths for internal website links.
For example, use:
.. code:: rst
text :doc:`contribute code </introduction/contributing>` text
instead of:
.. code:: rst
text `contribute code <https://doc.qubes-os.org/introduction/contributing.html>` text
You may use absolute URLs in the following cases:
- External links
- URLs that appear inside code blocks (e.g., in comments and document templates, and the plain text reproductions of `QSBs <https://www.qubes-os.org/security/qsb/>`__ and `Canaries <https://www.qubes-os.org/security/canary/>`__), since theyre not hyperlinks
- Git repo files like ``README.md`` and ``CONTRIBUTING.md``, since theyre not part of the documentation itself.
This rule is important because using absolute URLs for internal website links breaks:
- Serving the documentation offline
- Documentation localization
- Generating offline documentation
HTML and CSS
^^^^^^^^^^^^
Do not write HTML inside rST documents. In particular, never include HTML or CSS for styling, formatting, or white space control.
That belongs in the (S)CSS files instead.
Headings
^^^^^^^^
Sectioning uses underlines with different characters (=, -, ^, ", ', ~) to create different levels of headings.
This is also the recommended order provided.
It doesn't matter which characters you use in which order to mark a title, subtitle etc,
as long as they are in consistent use across the documentation.
Qubes OS uses the convention in `Python Developers Guide for documenting <https://devguide.python.org/documentation/markup/#sections>`__ which are as follows:
.. code:: text
# with overline, for parts
* with overline, for chapters
= for sections
- for subsections
^ for subsubsections
" for paragraphs
A simple example of how this is used in the Qubes OS documentation:
.. code:: rst
==========
Main Title
==========
Subsection
----------
Sub-subsection
^^^^^^^^^^^^^^
Paragraph
"""""""""
Text decorations
^^^^^^^^^^^^^^^^
Emphasis and Italics
- *Italics*: Use single asterisks
.. code:: rst
*italics*
- **Bold**: Use double asterisks.
.. code:: rst
**bold**
- ``Monospace``: Use backticks.
.. code:: rst
``monospace``
Paragraph
^^^^^^^^^
Paragraphs are plain texts where indentation matters. Separate paragraphs by leaving a blank line between them.
Indentation
^^^^^^^^^^^
Use spaces instead of tabs. Use hanging indentations where appropriate.
rST is an indentation sensitive markup language, similar to Python, please maintain consistent indentation (3 spaces) for readability.
Line wrapping
^^^^^^^^^^^^^
Do not hard wrap text, except where necessary (e.g., inside code blocks).
Writing guidelines
------------------
Correct use of terminology
^^^^^^^^^^^^^^^^^^^^^^^^^^
Familiarize yourself with the terms defined in the :doc:`glossary </user/reference/glossary>`. Use these terms consistently and accurately throughout your writing.
Sentence case in headings
^^^^^^^^^^^^^^^^^^^^^^^^^
Use sentence case (rather than title case) in headings for the reasons explained `here <https://www.sallybagshaw.com.au/articles/sentence-case-v-title-case/>`__. In particular, since the authorship of the Qubes documentation is decentralized and widely distributed among users from around the world, many contributors come from regions with different conventions for implementing title case, not to mention that there are often differing style guide recommendations even within a single region. It is much easier for all of us to implement sentence case consistently across our growing body of pages, which is very important for managing the ongoing maintenance burden and sustainability of the documentation.
Writing command-line examples
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When providing command-line examples:
- Tell the reader where to open a terminal (dom0 or a specific domU), and show the command along with its output (if any) in a code block, e.g.:
.. code:: rst
Open a terminal in dom0 and run:
.. code:: console
$ cd test
$ echo Hello
Hello
- Precede each command with the appropriate command prompt: At a minimum, the prompt should contain a trailing ``#`` (for the user ``root``) or ``$`` (for other users) on Linux systems and ``>`` on Windows systems, respectively.
- Dont try to add comments inside the code block. For example, *dont* do this:
.. code:: rst
Open a terminal in dom0 and run:
.. code:: console
# Navigate to the new directory
$ cd test
# Generate a greeting
$ echo Hello
Hello
The ``#`` symbol preceding each comment is ambiguous with a root command prompt. Instead, put your comments *outside* of the code block in normal prose.
Variable names in commands
^^^^^^^^^^^^^^^^^^^^^^^^^^
Syntactically distinguish variables in commands. For example, this is ambiguous:
.. code:: console
$ qvm-run --dispvm=disposable-template --service qubes.StartApp+xterm
It should instead be:
.. code:: console
$ qvm-run --dispvm=<DISPOSABLE_TEMPLATE> --service qubes.StartApp+xterm
Note that we syntactically distinguish variables in three ways:
1. Surrounding them in angled brackets (``< >``)
2. Using underscores (``_``) instead of spaces between words
3. Using all capital letters
We have observed that many novices make the mistake of typing the surrounding angled brackets (``< >``) on the command line, even after substituting the desired real value between them. Therefore, in documentation aimed at novices, we also recommend clarifying that the angled brackets should not be typed. This can be accomplished in one of several ways:
- Explicitly say something like “without the angled brackets.”
- Provide an example command using real values that excludes the angled brackets.
- If you know that almost all users will want to use (or should use) a specific command containing all real values and no variables, you might consider providing exactly that command and forgoing the version with variables. Novices may not realize which parts of the command they can substitute with different values, but if youve correctly judged that they should use the command youve provided as is, then this shouldnt matter.
Capitalization of "qube"
^^^^^^^^^^^^^^^^^^^^^^^^
We introduced the term :term:`qube` as a user-friendly alternative to the term :term:`vm` in the context of Qubes OS. Nonetheless, “qube” is a common noun like the words “compartment” and “container.” Therefore, in English, “qube” follows the standard capitalization rules for common nouns. For example, “I have three qubes” is correct, while “I have three Qubes” is incorrect. Like other common nouns, “qube” should still be capitalized at the beginnings of sentences, the beginnings of sentence-case headings, and in title-case headings. Note, however, that starting a sentence with the plural of “qube” (e.g., “Qubes can be shut down…”) can be ambiguous, since it may not be clear whether the referent is a plurality of qubes, :term:`qubes os`, or even the Qubes OS Project itself. Hence, it is generally a good idea to rephrase such sentences in order to avoid this ambiguity.
Many people feel a strong temptation to capitalize the word “qube” all the time, like a proper noun, perhaps because its a new and unfamiliar term thats closely associated with a particular piece of software (namely, Qubes OS). However, these factors are not relevant to the capitalization rules of English. In fact, its not unusual for new common nouns to be introduced into English, especially in the context of technology. For example, “blockchain” is a relatively recent technical term thats a common noun. Why is it a common noun rather than a proper noun? Because proper nouns refer to *particular* people, places, things, and ideas. There are many different blockchains. However, even when there was just one, the word still denoted a collection of things rather than a particular thing. It happened to be the case that there was only one member in that collection at the time. For example, if there happened to be only one tree in the world, that wouldnt change the way we capitalize sentences like, “John sat under a tree.” Intuitively, it makes sense that the addition and removal of objects from the world shouldnt cause published books to become orthographically incorrect while sitting on their shelves.
Accordingly, the reason “qube” is a common noun rather than a proper noun is because it doesnt refer to any one specific thing (in this case, any one specific virtual machine). Rather, its the term for any virtual machine in a Qubes OS installation. (Technically, while qubes are currently implemented as virtual machines, Qubes OS is independent of its underlying compartmentalization technology. Virtual machines could be replaced with a different technology, and qubes would still be called “qubes.”)
I have several qubes in my Qubes OS installation, and you have several in yours. Every Qubes OS user has their own set of qubes, just as each of us lives in some neighborhood on some street. Yet we arent tempted to treat words like “neighborhood” or “street” as proper nouns (unless, of course, theyre part of a name, like “Acorn Street”). Again, while this might seem odd because “qube” is a new word that we invented, that doesnt change how English works. After all, *every* word was a new word that someone invented at some point (otherwise we wouldnt have any words at all). We treat “telephone,” “computer,” “network,” “program,” and so on as common nouns, even though those were all new technological inventions in the not-too-distant past (on a historical scale, at least). So, we shouldnt allow ourselves to be confused by irrelevant factors, like the fact that the inventors happened to be *us* or that the invention was *recent* or is not in widespread use among humanity.
English language conventions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For the sake of consistency and uniformity, the Qubes documentation aims to follow the conventions of American English, where applicable. (Please note that this is an arbitrary convention for the sake consistency and not a value judgment about the relative merits of British versus American English.)
Organizational guidelines
-------------------------
Do not duplicate documentation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Duplicating documentation is almost always a bad idea. There are many reasons for this. The main one is that almost all documentation has to be updated as some point. When similar documentation appears in more than one place, it is very easy for it to get updated in one place but not the others (perhaps because the person updating it doesnt realize its in more than once place). When this happens, the documentation as a whole is now inconsistent, and the outdated documentation becomes a trap, especially for novice users. Such traps are often more harmful than if the documentation never existed in the first place. The solution is to **link** to existing documentation rather than duplicating it. There are some exceptions to this policy (e.g., information that is certain not to change for a very long time), but they are rare.
Core vs. external documentation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Core documentation resides in the `Qubes OS Projects official repositories <https://github.com/QubesOS/>`__, mainly in `qubes-doc <https://github.com/QubesOS/qubes-doc>`__. External documentation can be anywhere else (such as forums, community websites, and blogs), but there is an especially large collection in the `Qubes Forum <https://forum.qubes-os.org/docs>`__. External documentation should not be submitted to `qubes-doc <https://github.com/QubesOS/qubes-doc>`__. If youve written a piece of documentation that is not appropriate for `qubes-doc <https://github.com/QubesOS/qubes-doc>`__, we encourage you to submit it to the `Qubes Forum <https://forum.qubes-os.org/docs>`__ instead. However, *linking* to external documentation from `qubes-doc <https://github.com/QubesOS/qubes-doc>`__ is perfectly fine. Indeed, the maintainers of the `Qubes Forum <https://forum.qubes-os.org/>`__ should regularly submit PRs against the documentation index (see :ref:`edit_doc_index`) to add and update Qubes Forum links in the :ref:`“External documentation” <index:external documentation>` section of the documentation table of contents.
The main difference between **core** (or **official**) and **external** (or **community** or **unofficial**) documentation is whether it documents software that is officially written and maintained by the Qubes OS Project. The purpose of this distinction is to keep the core docs maintainable and high-quality by limiting them to the software output by the Qubes OS Project. In other words, we take responsibility for documenting all of the software we put out into the world, but it doesnt make sense for us to take on the responsibility of documenting or maintaining documentation for anything else. For example, Qubes OS may use a popular Linux distribution for an official :doc:`TemplateVM </user/templates/templates>`. However, it would not make sense for a comparatively small project like ours, with modest funding and a lean workforce, to attempt to document software belonging to a large, richly-funded project with an army of paid and volunteer contributors, especially when they probably already have documentation of their own. This is particularly true when it comes to Linux in general. Although many users who are new to Qubes are also new to Linux, it makes absolutely no sense for our comparatively tiny project to try to document Linux in general when there is already a plethora of documentation out there.
Many contributors do not realize that there is a significant amount of work involved in *maintaining* documentation after it has been written. They may wish to write documentation and submit it to the core docs, but they see only their own writing process and fail to consider that it will have to be kept up-to-date and consistent with the rest of the docs for years afterward. Submissions to the core docs also have to :ref:`undergo a review process <developer/general/how-to-edit-the-rst-documentation:security>` to ensure accuracy before being merged, which takes up valuable time from the team. We aim to maintain high quality standards for the core docs (style and mechanics, formatting), which also takes up a lot of time. If the documentation involves anything external to the Qubes OS Project (such as a website, platform, program, protocol, framework, practice, or even a reference to a version number), the documentation is likely to become outdated when that external thing changes. Its also important to periodically review and update this documentation, especially when a new Qubes release comes out. Periodically, there may be technical or policy changes that affect all the core documentation. The more documentation there is relative to maintainers, the harder all of this will be. Since there are many more people who are willing to write documentation than to maintain it, these individually small incremental additions amount to a significant maintenance burden for the project.
On the positive side, we consider the existence of community documentation to be a sign of a healthy ecosystem, and this is quite common in the software world. The community is better positioned to write and maintain documentation that applies, combines, and simplifies the official documentation, e.g., tutorials that explain how to install and use various programs in Qubes, how to create custom VM setups, and introductory tutorials that teach basic Linux concepts and commands in the context of Qubes. In addition, just because the Qubes OS Project has officially written and maintains some flexible framework, such as ``qrexec``, it does not make sense to include every tutorial that says “heres how to do something cool with ``qrexec`` in the core docs. Such tutorials generally also belong in the community documentation.
See `#4693 <https://github.com/QubesOS/qubes-issues/issues/4693>`__ for more background information.
Release-specific documentation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Our first priority is to document all **current, stable releases** of Qubes. Our second priority is to document the next, upcoming release (if any) that is currently in the beta or release candidate stage.
In general, avoid mentioning specific Qubes versions in the body text of documentation, as these references rapidly go out of date and become misleading to readers.
For further discussion about release-specific documentation in Qubes, see `here <https://groups.google.com/d/topic/qubes-users/H9BZX4K9Ptk/discussion>`__.
Git conventions
---------------
Please follow our :ref:`Git commit message guidelines <developer/code/coding-style:commit message guidelines>`.
Cheatsheet: Markdown vs. reStructuredText
-----------------------------------------
For the documentation contributors more familiar with Markdown, here is a small cheatsheet
highlighting essential differences.
Cheatsheet: Headings
^^^^^^^^^^^^^^^^^^^^
**Markdown:**
.. code:: markdown
# Title
## Section
### Sub-Section
**reStructuredText:**
.. code:: rst
=====
Title
=====
Section
-------
Seub-Section
^^^^^^^^^^^^
Hyperlinks
^^^^^^^^^^
External
**Markdown:**
.. code:: markdown
[Link Text](http://example.com)
**reStructuredText:**
.. code:: rst
`Link Text <http://example.com>`__
Internal
**Markdown:**
.. code:: markdown
[Link Text](/doc/some-file)
**reStructuredText:**
.. code:: rst
:doc:`Link Text </path/to/file>`
For example on cross referencing please see :ref:`cross_referencing`.
Text Decoration
^^^^^^^^^^^^^^^
**Markdown:**
.. code:: markdown
*Italic* or _Italic_
**Bold** or __Bold__
~~Strikethrough~~
**reStructuredText:**
.. code:: rst
*Italic*
**Bold**
:strike:`Strikethrough`
Cheatsheet: Lists
^^^^^^^^^^^^^^^^^
**Markdown:**
.. code:: markdown
- Item 1
- Item 2
- Subitem 1
- Subitem 2
1. Item 1
2. Item 2
a. Subitem 1
b. Subitem 2
**reStructuredText:**
.. code:: rst
- Item 1
- Item 2
- Subitem 1
- Subitem 2
1. Item 1
2. Item 2
a. Subitem 1
b. Subitem 2
Cheatsheet: Tables
^^^^^^^^^^^^^^^^^^
**Markdown:**
.. code:: markdown
| Header 1 | Header 2 |
|----------|----------|
| Cell 1 | Cell 2 |
| Cell 3 | Cell 4 |
**reStructuredText:**
.. code:: rst
.. list-table:: rst
:widths: 15 10
:align: center
:header-rows: 1
* - Header 1
- Header 2
* - Cell 1
- Cell 2
* - Cell 3
- Cell 4
Cheatsheet: Code Blocks
^^^^^^^^^^^^^^^^^^^^^^^
**Markdown:**
.. code:: markdown
```python
print("Hello, world!")
```
**reStructuredText:**
.. code:: rst
.. code:: python
print("Hello, world!")
Alerts and Warnings
^^^^^^^^^^^^^^^^^^^
**Markdown:**
Markdown does not have built-in support for alerts and warnings.
**reStructuredText:**
.. code:: rst
.. note::
This is a note.
.. warning::
This is a warning.
.. danger::
This is a danger message.