Skip to content

Allow for admonition titles without specifying "admonition" when using ::: syntax #259

Closed
@choldgraf

Description

@choldgraf

I'm still not sure if this is a good idea or not, because it would technically break from Sphinx directives syntax, but:

I find that it feels unnecessarily complex to have to add admonition to my admonitions if I want them to have a title. E.g.:

:::{note}
Here is a note
:::

but if I want a title, I must do:

:::{admonition,note} My title
Here is a note
:::

I wonder what folks think about supporting the following condition:

  • If ::: syntax is being used
  • If there is text in the body of the admonition (e.g. after the ::: line)
  • Then treat any text coming at the end of the ::: line as a title, and auto-magically use the {admonition,note} pattern shown above.

That way users could do:

:::{note} My note title
My note body

but if they did:

:::{note} My note body
:::

then the title would be Note

What do folks think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions