|
7 | 7 | Supported named inline text roles |
8 | 8 | ================================= |
9 | 9 |
|
10 | | -In general we support any text roles in reStructuredText that were previously |
11 | | -supported by Sphinx. |
| 10 | +A named inline text role marks up a short piece of text inline, in the |
| 11 | +middle of a sentence. Write the role name surrounded by colons |
| 12 | +(:rst:`:role-name:`), immediately followed — with no space — by the text |
| 13 | +it applies to, enclosed in backticks. Some roles expect that text to |
| 14 | +follow a particular syntax, for example a link target, an issue number, |
| 15 | +or a fully-qualified class name. |
12 | 16 |
|
13 | | -The TYPO3 Documentation Rendering Container also supports the |
| 17 | +In general we support any text roles in reStructuredText that were |
| 18 | +previously supported by Sphinx. The TYPO3 Documentation Rendering |
| 19 | +Container also supports the |
14 | 20 | `Docutils Standard Text Roles <https://docutils.sourceforge.io/docs/ref/rst/roles.html#standard-roles>`_ |
15 | | -except for `:raw:`, as that could pose security issues. |
| 21 | +except for :rst:`:raw:`, as that could pose security issues. |
16 | 22 |
|
17 | | -.. seealso:: |
| 23 | +The roles below are the ones most commonly used across TYPO3 |
| 24 | +documentation that are not already covered on their own page. |
18 | 25 |
|
19 | | - * `Basic inline markup (bold, italic etc.) <https://docs.typo3.org/permalink/h2document:rest-bold-italic>`_ |
20 | | - * `Inline code with or without overlays <https://docs.typo3.org/permalink/h2document:inline-code>`_ |
21 | | - for roles like `:php:`, `:typoscript:`, etc. |
22 | | - * `Links in ReStructured Text <https://docs.typo3.org/permalink/h2document:how-to-document-hyperlinks>`_ |
| 26 | +.. _text-roles-backslash: |
| 27 | + |
| 28 | +.. attention:: |
| 29 | + |
| 30 | + For most roles, a lone backslash inside the backticks is treated as |
| 31 | + an escape character and silently disappears from the output instead |
| 32 | + of being printed. This trips people up in Windows paths and PHP |
| 33 | + namespaces: |
| 34 | + |
| 35 | + .. code-block:: rst |
| 36 | +
|
| 37 | + `\Vendor\Ext\MyClass` renders as: VendorExtMyClass |
| 38 | + `\\Vendor\\Ext\\MyClass` renders as: \Vendor\Ext\MyClass |
| 39 | +
|
| 40 | + Double every backslash you want to keep. :rst:`:file:`, :rst:`:php:` |
| 41 | + and :rst:`:php-short:` are exceptions -- they take the text verbatim, |
| 42 | + so a single backslash there already prints as-is. If you are not |
| 43 | + sure how a given role handles it, check the rendered output rather |
| 44 | + than assuming. |
| 45 | + |
| 46 | +.. index:: reST roles; abbr |
| 47 | +.. _text-roles-abbr: |
| 48 | + |
| 49 | +`:abbr:` |
| 50 | +======== |
| 51 | + |
| 52 | +Marks a piece of text as an abbreviation or acronym. Write the |
| 53 | +abbreviation followed by its expansion in parentheses; the expansion is |
| 54 | +shown as a tooltip on hover and is not printed inline. |
| 55 | + |
| 56 | +.. code-block:: rst |
| 57 | +
|
| 58 | + :abbr:`LIFO (last-in, first-out)` |
| 59 | +
|
| 60 | +How it looks: |
| 61 | + :abbr:`LIFO (last-in, first-out)` |
| 62 | + |
| 63 | +.. index:: reST roles; path |
| 64 | +.. _text-roles-path: |
| 65 | + |
| 66 | +`:path:` |
| 67 | +======== |
| 68 | + |
| 69 | +Refers to a directory or folder path, as opposed to a specific file. Use |
| 70 | +:ref:`:file: <text-roles-file>` instead when the path ends in a file name. |
| 71 | + |
| 72 | +.. code-block:: rst |
23 | 73 |
|
24 | | -.. tabs:: |
| 74 | + The extension stores its data in :path:`public/fileadmin`. |
25 | 75 |
|
26 | | - .. group-tab:: Output |
| 76 | +How it looks: |
| 77 | + The extension stores its data in :path:`public/fileadmin`. |
27 | 78 |
|
28 | | - .. include:: _snippets/_text-roles.rst.txt |
| 79 | +.. index:: reST roles; file |
| 80 | +.. _text-roles-file: |
29 | 81 |
|
30 | | - .. group-tab:: reST |
| 82 | +`:file:` |
| 83 | +======== |
31 | 84 |
|
32 | | - .. literalinclude:: _snippets/_text-roles.rst.txt |
| 85 | +Refers to a specific file, including its name and, if helpful, its path. |
| 86 | +Use :ref:`:path: <text-roles-path>` instead when referring to a directory |
| 87 | +rather than a single file. |
| 88 | + |
| 89 | +.. code-block:: rst |
| 90 | +
|
| 91 | + Edit :file:`config/system/settings.php` to change the setting. |
| 92 | +
|
| 93 | +How it looks: |
| 94 | + Edit :file:`config/system/settings.php` to change the setting. |
| 95 | + |
| 96 | +.. index:: reST roles; issue |
| 97 | +.. _text-roles-issue: |
| 98 | + |
| 99 | +`:issue:` |
| 100 | +========= |
| 101 | + |
| 102 | +Links to an issue on `TYPO3 Forge <https://forge.typo3.org>`_ by its |
| 103 | +number. By default the link text is `forge#<number>`; pass a custom link |
| 104 | +text before the number in angle brackets to show different text instead. |
| 105 | + |
| 106 | +.. code-block:: rst |
| 107 | +
|
| 108 | + See also :issue:`102056` or :issue:`this issue <99508>`. |
| 109 | +
|
| 110 | +How it looks: |
| 111 | + See also :issue:`102056` or :issue:`this issue <99508>`. |
| 112 | + |
| 113 | +.. _text-roles-elsewhere: |
| 114 | + |
| 115 | +More text roles, documented on their own pages |
| 116 | +============================================== |
| 117 | + |
| 118 | +A few text roles are common enough, or involved enough, to have a full |
| 119 | +page to themselves rather than a short entry here: |
| 120 | + |
| 121 | +* :rst:`:guilabel:` for GUI labels — backend modules, tabs, buttons, |
| 122 | + fields — and click paths through them, and :rst:`:kbd:` for keyboard |
| 123 | + shortcuts — see |
| 124 | + `Referring to GUI elements and keystrokes <https://docs.typo3.org/permalink/h2document:rest-refer-to-gui-elements>`_. |
| 125 | +* :rst:`:composer:` and :rst:`:t3ext:` for linking Composer packages and |
| 126 | + TER extensions — see |
| 127 | + `Linking Composer packages and TYPO3 extensions <https://docs.typo3.org/permalink/h2document:linking-extensions>`_. |
| 128 | +* :rst:`:t3src:` for linking source files of the TYPO3 Core — see |
| 129 | + `Linking source files of the TYPO3 Core <https://docs.typo3.org/permalink/h2document:linking-core-source>`_. |
| 130 | +* :rst:`:php:`, :rst:`:php-short:`, :rst:`:typoscript:` and other code |
| 131 | + roles with an infobox — see |
| 132 | + `Inline code with or without infoboxes <https://docs.typo3.org/permalink/h2document:inline-code>`_. |
| 133 | + |
| 134 | +.. seealso:: |
| 135 | + |
| 136 | + * `Basic inline markup (bold, italic etc.) <https://docs.typo3.org/permalink/h2document:rest-bold-italic>`_ |
| 137 | + * `Links in ReStructured Text <https://docs.typo3.org/permalink/h2document:how-to-document-hyperlinks>`_ |
| 138 | + * `Docutils: Interpreted Text Roles <http://docutils.sourceforge.io/docs/ref/rst/roles.html>`_ |
0 commit comments