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

Failure to process classifiers as part of consolidation fields in a reStructuredText docstring #765

Closed
juur opened this issue Mar 24, 2024 · 2 comments · Fixed by #766
Closed
Labels

Comments

@juur
Copy link

juur commented Mar 24, 2024

Using pydoctor 23.9.1 under Python 3.11.5, executing with args pydoctor --quiet --make-html --html-output docs --process-types --intersphinx-cache-path ./.sphinx-cache src/pyerp

The following snippet works fine:

"""A BusinessUnit is a top level organisational container.

:CVariables:
    `id`
        unique serial for this entity
"""

However, the following snippet generates an error:

"""A BusinessUnit is a top level organisational container.

:CVariables:
    `id` : int
        unique serial for this entity
"""

The error is:

bad docstring: Unexpected element in type specification field: element 'Text'. This value should only contain regular paragraphs with text or inline markup.

Based on the documentation, I believe this to be a bug as the classifiers should be processed in a definition list.

@tristanlatr
Copy link
Contributor

Thanks for the bug report, it is linked to the —process-types options, it seem there is a bug Indeed.

@tristanlatr
Copy link
Contributor

So here is the deal:

"This value should only contain regular paragraphs with text or inline markup.")

We do not account for the cases where a Text node is directly put inside the document node. Which is what happened with consolidated fields. It should be a very quick fix.

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

Successfully merging a pull request may close this issue.

2 participants