I am looking at this snippet of code:
def ook(*args):
"""Some silly function.
:param *args: Optional arguments.
"""
...
And as soon as I run Sphinx, I get the oh-so helpful error:
WARNING: Inline literal start-string without end-string.
So, I tried param ``*``args
, param :literal:'*' args
and still get the warning.
How do I have a literal '*' in restructuredText?
Literal blocks display the text you write exactly as you see it in the source. Literal text is treated as preformatted text. The text is presented in a fixed-width font and endlines are preserved. Only special characters and callouts are replaced when the document is converted.
For comments, add 2 periods .. followed by a newline and then your comment indented.
You could use the (somewhat ugly) backslash quotation: \*
EDIT: As an (somewhat ugly) addendum, if you are concerned about pylint warning about the backslash, you could add a r
to the string literal: r""" ... docstring ... """
. This was descibed in this pylint issue.
Having different text processing systems play nicely together destroys sometimes the aesthetics.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With