Skip to content

Support subsections in main description or in notes #216

Open

Description

@anntzer

It would be nice if it was possible to have subsections either in the "main" description or in the Notes section. Right now Matplotlib just uses bold to delineate such sections (e.g. in https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.plot.html#matplotlib.axes.Axes.plot "plotting labeled data"), which is not so nice semantically.

In theory, rst supports any kind of underlining to mark subsections (and sections), but numpydoc can probably mandate e.g. using ~~~ (or whatever looks nice to the devs). Also, rst just creates the section hierarchy following the order in which the various kinds of underlines occur, so I guess this may be problematic (assuming we want to keep compatibility with plain rst, which I think is nice to have) for subsections in the main description (but fine for the Notes section, at least).

Activity

  1. larsoner commented on May 1, 2019

    @larsoner
    Collaborator

    Agreed this would be nice, I'm always a little bit sad when I have to do **Subsection title**.

  2. anntzer commented on May 1, 2019

    @anntzer
    ContributorAuthor

    Actually, now that I look at it, perhaps one can just use either the .. topic:: or the .. rubric:: rst directives (http://docutils.sourceforge.net/docs/ref/rst/directives.html#topic, http://docutils.sourceforge.net/docs/ref/rst/directives.html#rubric) and call it a day without needing specific support from numpydoc. (If so, perhaps this could be suggested in numpydoc's docs, as these directives are not very well-known, I'd say.)

  3. jnothman commented on May 2, 2019

    @jnothman
    Member
  4. anntzer commented on May 2, 2019

    @anntzer
    ContributorAuthor

    looks like your message was cropped

  5. jnothman commented on May 2, 2019

    @jnothman
    Member

    The indentation would be a bit disruptive perhaps in pydoc view relative to headings

  6. anntzer commented on May 2, 2019

    @anntzer
    ContributorAuthor

    .. rubric:: is not followed by an indent block, it's basically a standalone title.

  7. jnothman commented on May 2, 2019

    @jnothman
    Member
  8. larsoner commented on May 3, 2019

    @larsoner
    Collaborator

    I tested .. rubric:: Title and the output for me at least is very similar to **Title**. And .. topic:: did not work because of some complaint about not being in the main body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions