Issue
I am trying to create an block of example code for a python module that I have written, according to here spyder uses sphinx to render the docstring in the help window. When I try to create a code block with:
'''
Example:
---------
.. code-block :: python
::
def testing():
pass
'''
Below is what is rendered:
testing(): ...
should be inside the highlighted block. I have no idea how to fix this... Any help would be greatly appreciated!
Solution
So it turns out (after a lot of fiddling) that an empty line under ::
is required:
'''
Example:
---------
::
def testing():
pass
'''
Renders properly,
It seems that .. code-block :: python
was also causing some problems, I am not sure why.
Answered By - BenedictWilkinsAI
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.