Skip to content

Commit 2f96d4d

Browse files
Update docs/contribute/documentation/style-guide.rst
Co-authored-by: Nicco Kunzmann <niccokunzmann@rambler.ru>
1 parent 2be5ba1 commit 2f96d4d

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎docs/contribute/documentation/style-guide.rst‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,18 @@ The above example will render as shown.
252252
Python and RFC objects
253253
''''''''''''''''''''''
254254

255-
In narrative documentation, use double backticks (``````) around Python parameter names, :ref:`internal-use-only` Python methods, literal arguments and values, and other Python objects that can't be displayed as a link via a cross-reference to indicate it as an inline literal.
255+
In Sphinx, the role `literal <https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#roles>`_ represents inline code.
256+
In narrative documentation, use double backticks (``````) around Python parameter names, :ref:`internal-use-only` Python methods, literal arguments and values, and other Python objects that can't be displayed as a link via a cross-reference.
257+
258+
The example below shows how to display a Python string as an inline literal:
259+
260+
.. code-block:: rst
261+
262+
My program outputs ``"Hello World!"``.
263+
264+
Which renders as shown below.
265+
266+
My program outputs ``"Hello World!"``.
256267

257268
If the same Python object appears multiple times throughout a paragraph or section, it's better to apply a cross-reference to the first object only and use inline literals for the rest for better legibility.
258269

0 commit comments

Comments
 (0)