Skip to content

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

Closed

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?

Activity

  1. chrisjsewell commented on Sep 30, 2020

    @chrisjsewell
    Member

    possibly 🤔
    FYI, its something that I didn't originally include in my executablebooks/meta#149 list (adding now), but I want to also at some point re-appraise these ::: blocks, and how they can be generalised, e.g. for use with things like the sphinx-panels panels/tabbed directives (just anywhere that the content of the directive is fully/mostly Markdown compliant)

  2. choldgraf commented on Sep 30, 2020

    @choldgraf
    MemberAuthor

    that makes sense - I don't think this is a crucial or a super time-sensitive feature, just a feeling that has been nagging me as I use it. That said, if we're going to generalize ::: to be more like "any directive that also supports entirely markdown content", then I think we may wanna just keep it as-is

  3. chrisjsewell commented on Dec 17, 2020

    @chrisjsewell
    Member

    again #273 kinda precludes this

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions