Skip to content

Commit 84cb6f0

Browse files
Document attr and attribute (#1311)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent a8e1743 commit 84cb6f0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

documentation/markup.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ variables/literals/code ````foo````, ````42````, ````len(s) - 1```` :ref:`inline
2424
True/False/None ````True````, ````False````, ````None```` :ref:`inline-markup`
2525
functions definitions ``.. function:: print(*args)`` :ref:`directives`
2626
functions references ``:func:`print``` :ref:`roles`
27+
attribute definitions ``.. attribute: `attr-name``` :ref:`information-units`
28+
attribute references ``:attr:`attr-name``` :ref:`roles`
2729
reference labels ``.. _label-name:`` :ref:`doc-ref-role`
2830
internal references ``:ref:`label-name``` :ref:`doc-ref-role`
2931
external links ```Link text <https://example.com>`_`` :ref:`hyperlinks`
@@ -565,6 +567,10 @@ The directives are:
565567

566568
Description of the attribute.
567569

570+
Refer to an attribute using the ``:attr:`` role::
571+
572+
Use the :attr:`ham` attribute to spam the eggs.
573+
568574
If is also possible to document an attribute outside of a class directive,
569575
for example if the documentation for different attributes and methods is
570576
split in multiple sections. The class name should then be included

0 commit comments

Comments
 (0)