-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Docs: Additions to style guide - placeholders, seealso::, Diátaxis and new word list entry #9840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
161cb88
00d5697
7ccd6eb
7447543
9075733
d975ae9
e582cc8
9181f0c
b7e3827
9a27fc9
8733c34
2bc794e
273abf7
b913829
8060351
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,19 +39,36 @@ Content | |
* Do not break the content across multiple lines at 80 characters, | ||
but rather break them on semantic meaning (e.g. periods or commas). | ||
Read more about this `here <https://rhodesmill.org/brandon/2012/one-sentence-per-line/>`_. | ||
* If you are cross-referencing to a different page within our website, | ||
* If you are :ref:`cross-referencing <style-guide:Cross-references>` to a different page within our website, | ||
use the ``doc`` role and not a hyperlink. | ||
* If you are cross-referencing to a section within our website, | ||
* If you are :ref:`cross-referencing <style-guide:Cross-references>` to a section within our website, | ||
use the ``ref`` role with the label from the `autosectionlabel extension <http://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html>`__. | ||
* Use ``<abstract concept>`` and ``<variable>`` as placeholders in code and URLs. For instance: | ||
|
||
* ``https://<slug>.readthedocs.io`` | ||
* ``:guilabel:`<your username>` dropdown`` | ||
benjaoming marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Make sure that **all bullet list items end with a period**, and don't mix periods with no periods. | ||
|
||
Word List | ||
--------- | ||
|
||
We have a specific way that we write common words: | ||
|
||
* ``Git repository`` for the place that stores Git repos. We used to use ``VCS``, but this is deprecated. | ||
* ``Git provider`` for generic references to GitHub/Bitbucket/GitLab/Gitea etc. | ||
We avoid "host" and "platform" because they are slightly more ambiguous. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better suggestions are most welcome 🙏 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, we also call them integrations in some places too I think? It would be good to be explicit when we're talking about Git-specific hosts that are actually used for code & auth, so I think Git provider is fine? Though provider is a bit abstract as well, tbh, but so are host & platform 🤷 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As you also noted in the PR adding texts to the Dashboard UI of "Connected Services", we would want to keep changes to the current Dashboard minimal. In the upcoming Dashboard frontend, we will hopefully recall our terminology and find it natural to add some more tweaks both in the Dashboard and in the documentation. The future version of the documentation will also be less complicated to impose changes to - I feel somewhat confident about that 🤞 |
||
* ``open source`` should be lower case, unless you are definitely referring to `OSI's Open Source Definition <https://opensource.org/osd>`. | ||
* ``Git`` should be upper case, except when referring to the command, when it should be written as `:program:\`git\``. | ||
* ``Git`` should be upper case. Except when referring to the :program:`git` command, then it should be written as `:program:\`git\``. | ||
|
||
Substitutions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is great 💯 |
||
------------- | ||
|
||
The following substitutions are used in our documentation to guarantee consistency and make it easy to apply future changes. | ||
|
||
* ``|org_brand|`` is used for mentioning of .org: Example: |org_brand| | ||
* ``|com_brand|`` is used for mentioning of .com. Example: |com_brand| | ||
* ``|git_providers_and|`` is used to mention currently support Git providers with "and". Example: |git_providers_and| | ||
* ``|git_providers_or|`` is used to mention currently support Git providers with "or". Example: |git_providers_or| | ||
|
||
Glossary | ||
-------- | ||
|
@@ -67,3 +84,153 @@ but even more importantly, | |
it helps and includes readers by giving them quick and easy access to terms that they may be unfamiliar with. | ||
|
||
Use an external link or Intersphinx reference when a term is clearly defined elsewhere. | ||
|
||
Cross-references | ||
---------------- | ||
|
||
Cross-references are great to have as :ref:`inline links <style-guide:Cross-references>`. | ||
Because of sphinx-hoverxref_, | ||
inline links also have a nice tooltip displayed. | ||
|
||
We like to cross-reference other articles with a definition list inside a ``seealso::`` admonition box. | ||
It looks like this: | ||
|
||
.. code-block:: rst | ||
|
||
.. seealso:: | ||
|
||
:doc:`/other/documentation/article` | ||
You can learn more about <concept> in this (how-to/description/section/article) | ||
|
||
.. _sphinx-hoverxref: https://sphinx-hoverxref.readthedocs.io/ | ||
|
||
|
||
Differentiating .org and .com | ||
----------------------------- | ||
|
||
When there are differences on .org and .com, | ||
you can use a ``note::`` admonition box with a definition list. | ||
Notice the use of :ref:`substitutions <style-guide:Substitutions>` in the example: | ||
|
||
.. code-block:: rst | ||
|
||
.. note:: | ||
|
||
|org_brand| | ||
You need to be *maintainer* of a subproject in order to choose it from your main project. | ||
|
||
|com_brand| | ||
You need to have *admin access* to the subproject in order to choose it from your main project. | ||
|
||
If the contents aren't suitable for a ``note::``, you can also use ``tabs::``. | ||
We are using `sphinx-tabs`_, | ||
however since `sphinx-design`_ also provides tabs, | ||
it should be noted that we don't use that feature of sphinx-design. | ||
|
||
.. _sphinx-tabs: https://github.com/executablebooks/sphinx-tabs/ | ||
.. _sphinx-design: https://github.com/executablebooks/sphinx-design/ | ||
|
||
|
||
Headlines | ||
--------- | ||
|
||
Sphinx is very relaxed about how headlines are applied and will digest different notations. | ||
We try to stick to the following: | ||
|
||
.. code-block:: rst | ||
|
||
Header 1 | ||
======== | ||
|
||
Header 2 | ||
-------- | ||
|
||
Header 3 | ||
~~~~~~~~ | ||
|
||
Header 4 | ||
^^^^^^^^ | ||
|
||
In the above, ``Header 1`` is the title of the article. | ||
|
||
Diátaxis Framework | ||
------------------ | ||
|
||
We apply the methodology and concepts of the Diátaxis Framework. | ||
This means that *both content and navigation path* for all sections should fit a single category of the 4 Diátaxis categories: | ||
|
||
* Tutorial | ||
* Explanation | ||
* How-to | ||
* Reference | ||
|
||
.. seealso:: | ||
|
||
`https://diataxis.fr/ <https://diataxis.fr/>`__ | ||
The official website of Diátaxis is the main resource. | ||
It's best to check this out before guessing what the 4 categories mean. | ||
|
||
.. warning:: **Avoid minimal changes** | ||
|
||
If your change has a high coherence with another proposed or planned change, | ||
propose the changes in the same PR. | ||
|
||
By multi-tasking on several articles about the same topic, | ||
such as an explanation *and* a how-to, | ||
you can easily design your content to end up in the right place *Diátaxis-wise*. | ||
This is great for the author and the reviewers | ||
and it saves coordination work. | ||
|
||
Minimal or isolated changes generally raise more questions and concerns | ||
than changes that seek to address a larger perspective. | ||
ericholscher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Explanation | ||
~~~~~~~~~~~ | ||
|
||
* Introduce the scope: **“This article introduces ...”** | ||
(write this as the very first thing, | ||
then consider rewriting it or turning it into an internal comment afterwards). | ||
* Cross-reference the related How-to Guide. | ||
Put a ``seealso::`` somewhere visible. | ||
It should likely be placed right after the introduction, | ||
and if the article is very short, maybe at the bottom. | ||
* Consider adding an Examples section. | ||
* Can you add screenshots or diagrams? | ||
|
||
How-to Guides | ||
~~~~~~~~~~~~~ | ||
|
||
* Title should begin with **“How to ...”**, | ||
but navigation titles should not contain the “How to” part. | ||
* Introduce the scope: **“In this guide, we will…”** | ||
* Cross-reference related explanation. | ||
benjaoming marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Put a ``seealso::`` somewhere visible, | ||
It should likely be placed right after the introduction | ||
and if the article is very short, maybe at the bottom. | ||
* Try to avoid a “trivial” how-to, | ||
i.e. a step-by-step guide that just states what is on a page without further information. | ||
You can ask questions like: | ||
|
||
* Can this how-to contain recommendations and practical advice without breaking the how-to format? | ||
* Can this how-to be expanded with relevant troubleshooting? | ||
* Worst-case: | ||
Is this how-to describing a task that's so trivial and self-evident | ||
that we might as well remove it? | ||
|
||
* Consider if an animation can be embedded: | ||
`Here is an article about 'gif-to-video' <https://www.smashingmagazine.com/2018/11/gif-to-video/#replace-animated-gifs-with-video-in-the-browser>`__ | ||
|
||
Reference | ||
~~~~~~~~~ | ||
|
||
We have not started organizing the Reference section yet, | ||
guidelines pending. | ||
|
||
Tutorial | ||
~~~~~~~~ | ||
|
||
.. note:: We don’t really have tutorials targeted in the systematic refactor, so this checklist isn’t very important right now. | ||
|
||
* Cross-reference related explanation and how-to. | ||
* Try not to explain things too much, and instead link to the explanation content. | ||
* **Refactor other resources** so you can use references instead of disturbing the flow of the tutorial. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking
$variable
to differentiate them?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! So on that note, would you prefer
$variable
and that the example ishttps://$slug.readthedocs.io
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the sh interpolation syntax is nice as it give variable boundaries:
https://${slug}.readthedocs.io
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that I prefer just one notation and that it's
<variable name>
and<abstract concept>
. It's because I have a hard time coming up with examples from our documentation of referenced variable names that are 100% bound and not actually also an abstract concept that we introduced in the docs.So even if we say
https://$slug.readthedocs.io
orhttps://${slug}.readthedocs.io
, there actually doesn't exist a real variable calledslug
but just a concept from the text. So this might as well be<slug>
and no distinction.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that seems reasonable, especially since we're using
$
variables to actually be explicit vars in places in the application (eg;.$rest
in redirects). So probably better to preserve them for that.