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

Admonitions (syntax extension) #37

Open
Omikhleia opened this issue Dec 5, 2022 · 5 comments · May be fixed by #38
Open

Admonitions (syntax extension) #37

Omikhleia opened this issue Dec 5, 2022 · 5 comments · May be fixed by #38
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@Omikhleia
Copy link
Owner

Omikhleia commented Dec 5, 2022

MkDocs' Markdown has "admonitions" as a syntax extension.

While quoting the "title" seems a bit idiosyncratic, we could support something similar:

!!! keyword Inline content for title
    4-space indented block contents...

Compare to the "fenced divs" syntax, it allows for something simpler for environments needing two arguments (where Markdown can be used in both). I mean, it's doable with fenced divs, but it looks a bit "clumsy" / less straightforward in my opinion, and also makes the task of the writer afterwards less obvious for identifying and extracting the necessary bits.

::: { .keyword }
block contents...
:::: { .title }
Content for title
::::
:::

I would tend to think it would bring a more natural way to typeset some things, with an immediate sensible use -- as shown in the PoC below.

image

I wonder what other writers using Markdown would have to say (or how they'd address that type of need with other means).

@Omikhleia Omikhleia added enhancement New feature or request question Further information is requested labels Dec 5, 2022
@Omikhleia Omikhleia added this to the 2.0 milestone Dec 5, 2022
@Omikhleia Omikhleia linked a pull request Dec 5, 2022 that will close this issue
@Omikhleia
Copy link
Owner Author

But also look at how Microsoft does it for "Alerts" (https://learn.microsoft.com/en-us/contribute/markdown-reference)

> [!NOTE]
> Information the user should notice even if skimming.

So funny how everyone is tweaking Markdown in every possible direction... 👯

@Omikhleia
Copy link
Owner Author

And in addition to the above note on fenced dives, Pandoc also seems to have "some" of the same idea with fenced divs with just a class name:
jgm/lunamark#58

(Though it doesn't address the "title" of such blocks.)

@Omikhleia
Copy link
Owner Author

And yet another way, in Paradox https://developer.lightbend.com/docs/paradox/current/directives/callouts.html

@@@ note {title='Caveat Emptor'}
...
@@@

@Omikhleia
Copy link
Owner Author

Too many possible ways, and now that we also have Djot support, we might need to think to a better approach that just adding our own syntax extension --> switching milestones.

@Omikhleia Omikhleia modified the milestones: 2.0, 3.0 Feb 16, 2023
@Omikhleia
Copy link
Owner Author

For reference, admonitions in Djot are discussed here: jgm/djot#196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant