Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indentation in docstring lists doesn't seem to work #8

Open
gkaempfer opened this issue Nov 12, 2019 · 4 comments
Open

indentation in docstring lists doesn't seem to work #8

gkaempfer opened this issue Nov 12, 2019 · 4 comments

Comments

@gkaempfer
Copy link

gkaempfer commented Nov 12, 2019

This works:

#. this is the first item
#. this is the second item 

This doesn't work and an error "Enumerated list ends without a blank line; unexpected unindent." is thrown:

#. this is the first item
#. this is the second item with a long
   indented line

I tried all kinds of list formats (numbers, bullets etc) but they all fail in the same way. If the second item in the latter example is separated from the first one with a blank line, it isn't identified as a list item.

@cag
Copy link
Owner

cag commented Nov 12, 2019

Like so, right?

#. this is the first item
#. this is the second item with a long
   indented line

By the way, this formatting is accessible by putting a block between a pair of triple-backticks (```)

@gkaempfer
Copy link
Author

Fixed my GitHub comment but the issue with sphinx soliditydomain persists :(
I tried using triple-backticks in the Solidity comment but that didn't work either...

@cag
Copy link
Owner

cag commented Nov 19, 2019

Hey sorry it's taking so long... I dunno if I have that much bandwidth unfortunately. Also my bad: I had meant that the triple backticks worked on GitHub for preformatted text blocks.

Could you provide some more information about the issue? Is it that you're unable to use rst numbered lists inside of documentation comments, and what does your Sphinx setup look like?

@gkaempfer
Copy link
Author

gkaempfer commented Nov 19, 2019

Indeed. I'm using the autodoc feature such as here (rst file):

Solidity Module Name
====================

.. autosolcontract:: SolModule
    :members:

and then have inline comments like this (sol file):

contract SolModule {

    /**
      This function checks validity of a fact.
      It may fail for many reasons:
      #. This is a very very very very very long reason which I would like to break over multiple lines
      #. another reason
      #. last reason

      Maybe a summary
    */
    function isValid(bytes32 fact)
        external view
        returns(bool);
}

If I try to break the first numbered item into two lines I get the error as explained above.
In my conf.py, I'm using:
html_theme = "sphinx_rtd_theme"
extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.soliditydomain'] and some other HTTP domain extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants