Conversation
There was a problem hiding this comment.
Thanks for all of your work on this! I left a bunch of comments on things that jumped out at me, but I admit that I didn't scan through this line-by-line.
My biggest concern is that, while a single page is nice, we're now pushing the limit of what is maintainable by humans. Even the rendered page is a bit hard to parse with the onscreen elements and nesting. Maintenance aside, I think that users are more likely to be looking for syntax in one markup language or the other, which may outweigh the benefits of putting them side-by-side. I don't have a concrete request on this front, but I think it's something we should consider.
| @@ -0,0 +1,1520 @@ | |||
| --- | |||
| relatedlinks: https://github.com/canonical/canonical-sphinx-extensions, https://github.com/canonical/lxd-sphinx-extensions, [reStructuredText Primer](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html), [Canonical Documentation Style Guide](https://docs.ubuntu.com/styleguide/en) | |||
There was a problem hiding this comment.
| relatedlinks: https://github.com/canonical/canonical-sphinx-extensions, https://github.com/canonical/lxd-sphinx-extensions, [reStructuredText Primer](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html), [Canonical Documentation Style Guide](https://docs.ubuntu.com/styleguide/en) | |
| relatedlinks: https://github.com/canonical/canonical-sphinx, [reStructuredText Primer](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html), [Canonical Documentation Style Guide](https://docs.ubuntu.com/styleguide/en) |
- I assume the first link was meant to be the canonical-sphinx theme
- canonical-sphinx-extensions was superseded by the standalone extension repositories.
| # Syntax guide | ||
|
|
||
| The Sphinx Stack supports [reStructuredText](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html) (reST), [Markdown](https://commonmark.org/) and | ||
| [MyST](https://myst-parser.readthedocs.io/). |
There was a problem hiding this comment.
| [MyST](https://myst-parser.readthedocs.io/). | |
| The Sphinx Stack supports [reStructuredText](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html) (reST) and [MyST Markdown](https://myst-parser.readthedocs.io/). |
MyST is a superset of Commonmark, so we probably don't need to explicitly mention Commonmark support.
|
|
||
| * - Description | ||
| - <span style="text-transform: none">reST</span> | ||
| - <span style="text-transform: none">MyST</span> |
There was a problem hiding this comment.
| - <span style="text-transform: none">MyST</span> | |
| - reST | |
| - MyST |
| `````{tab-item} reST | ||
| To start a code block, either end the introductory paragraph with two colons (``::``) | ||
| and indent the following code block, or explicitly start a code block with ``.. | ||
| code::``. In both cases, the code block must be surrounded by empty lines. |
There was a problem hiding this comment.
I understand this is meant to be less opinionated when it comes to style, but I think we should still promote a consistent use of reST and MyST syntax where possible.
For instance, I don't think we should bring extra attention to the :: code block syntax, as it isn't declarative and is even less visually accessible than the rest of reST syntax.
| Or use the explicit directive: | ||
|
|
||
| ```` | ||
| .. code:: |
There was a problem hiding this comment.
Since we're assuming that the project is based on the Sphinx Stack, can we advise users to use the code-block directive instead? It has a much more robust set of options. The code directive is the more barebones version provided by Docutils.
|
|
||
| * - Output | ||
| - <span style="text-transform: none">reST</span> | ||
| - <span style="text-transform: none">MyST</span> |
There was a problem hiding this comment.
| - <span style="text-transform: none">MyST</span> | |
| - reST | |
| - MyST |
I won't duplicate this suggestion, but it's in all of these tables.
| * - Output | ||
| - <span style="text-transform: none">reST</span> | ||
| - <span style="text-transform: none">MyST</span> | ||
| * - <ol><li>Step 1<ul><li>Item 1<ul><li>Sub-item</li></ul></li><li>Item 2</li></ul></li><li>Step 2<ol><li>Sub-step 1</li><li>Sub-step 2</li></ol></li></ol> |
There was a problem hiding this comment.
Looks like another translation error? There are a few other instances of stuff like this the subsequent tables as well.
| ## Notes | ||
|
|
||
| ```{list-table} | ||
| :header-rows: 1 |
There was a problem hiding this comment.
I think we should bring attention to the standard admonition's args and options, as it's the one that should probably be used most often.
.. admonition:: <title>
:class: <class>
|
|
||
| `````{tab-item} reST | ||
| **Globally**, in a file named ``reuse/substitutions.txt`` that is included in a | ||
| custom ``rst_epilog`` directive (see the [rst_epilog documentation](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-rst_epilog)): |
There was a problem hiding this comment.
We've removed this from the Sphinx Stack as well.
| Please note: | ||
|
|
||
| - Substitutions do not work on GitHub. Therefore, use substitution names that indicate | ||
| the included content (for example, `note_not_supported` instead of `reuse_note`). |
There was a problem hiding this comment.
| Please note: | |
| - Substitutions do not work on GitHub. Therefore, use substitution names that indicate | |
| the included content (for example, `note_not_supported` instead of `reuse_note`). | |
| Substitutions do not work on GitHub. Therefore, use substitution names that indicate the included content (for example, `note_not_supported` instead of `reuse_note`). |
Addresses #7
There is some confusion about the purpose of the currently included MD and rST "style guide" documents. This PR amalgamates them and converts them syntax reference documents, removing style guidelines.
Tabs and tables are used depending on the length of the reST or MyST syntax.
The image example was updated to include an image in the repository to shorten the syntax examples. This way, it all fits in a table.
I also included links to the intersphinx guide and updated the terminology of cross references to only use "labels", following Cross-references — Sphinx documentation.
AI disclosure: Claude Sonnet 4.6 was used to format tables and to initially combine both syntax guides. Content was checked, updated and arranged manually after that.
CHANGELOG.mdwith relevant non-documentation file changes?