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

sphinx doc for warnings should support structured specification of name and category #8125

Open
JasonGross opened this issue Jul 23, 2018 · 2 comments
Labels
good first issue Beginners welcome to submit a pull request. kind: documentation Additions or improvement to documentation. kind: infrastructure CI, build tools, development tools.

Comments

@JasonGross
Copy link
Member

Version

8.9+alpha

Description of the problem

Warnings come with [name,category] descriptions such as [notation-overridden,parsing]. The sphinx doc should have a structured way of indicating these with the .. warn:: directive.

@JasonGross JasonGross added kind: documentation Additions or improvement to documentation. kind: infrastructure CI, build tools, development tools. labels Jul 23, 2018
@Zimmi48
Copy link
Member

Zimmi48 commented Jul 23, 2018

cc @maximedenes @cpitclaudel

@cpitclaudel
Copy link
Contributor

Nice idea. The place to modify is this:

class WarningObject(NotationObject):
    """An warning raised by a Coq command or tactic..

    Do not mistake this for ``.. warning::``; this directive is for warning
    messages produced by Coq.


    Example::

       .. warn:: Ambiguous path

          When the coercion :token:`qualid` is added to the inheritance graph, non
          valid coercion paths are ignored.
    """
    subdomain = "warn"
    index_suffix = "(warn)"
    annotation = "Warning"

    # Generate names automatically
    def _name_from_signature(self, signature):
        return stringify_with_ellipses(signature)

If the names are unique, it would make sense t use them here, too, so you'd remove _name_from_signature and give each exception an explicit :name: instead. To also allow for categories, you'd change the option_spec to this:

    option_spec = {
        'name': directives.unchanged,
        'category': directives.unchanged,
        'undocumented': directives.flag
    }

Finally you'd change the way exceptions are rendered:

    def _render_signature(self, signature, signode):
        super()._render_signature(self, signature, signode)
        signode.append(… some nodes here for the name and category)

@SkySkimmer SkySkimmer pinned this issue Jan 7, 2019
@Zimmi48 Zimmi48 added the good first issue Beginners welcome to submit a pull request. label Jan 8, 2019
@SkySkimmer SkySkimmer changed the title sphinx doc should support structured specification of name and category of warnings sphinx doc for warnings should support structured specification of name and category Jan 9, 2019
@ejgallego ejgallego unpinned this issue Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Beginners welcome to submit a pull request. kind: documentation Additions or improvement to documentation. kind: infrastructure CI, build tools, development tools.
Projects
Status: Infrastructure
Development

No branches or pull requests

3 participants