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

Allow adding custom classes to the admonition #8

Open
oprypin opened this issue Jan 20, 2022 · 0 comments
Open

Allow adding custom classes to the admonition #8

oprypin opened this issue Jan 20, 2022 · 0 comments

Comments

@oprypin
Copy link
Owner

oprypin commented Jan 20, 2022

For example, to support this feature: https://squidfunk.github.io/mkdocs-material/reference/admonitions/#inline-blocks

I currently don't have any ideas regarding how it would still make sense with "graceful degradation", there's just no way...

This (made up) syntax makes little sense to me, and anything similar would probably be just as noisy:

NOTE {.inline .end}: Hello, world!

So perhaps this would be the syntax, relying on attr_list:

NOTE: Hello, world!
{.inline .end}

> NOTE: Hello, world!
>
> Foo bar
{: #someid .someclass somekey='some value' }

Currently the latter produces this HTML, which is no good:

<div class="admonition note">
  <p class="admonition-title">
    Note
  </p>
  <p>
    Hello, world!
  </p>
  <p class="someclass" id="someid" somekey="some value">
    Foo bar
  </p>
</div>

But in fact, the current state is consistent with how blockquotes behave! -- regardless of the callout part, the classes get attached to the last paragraph of the blockquote. So I have some doubts on trying to do it in this exact way.

But in any case, we would need to be able to produce this HTML:

<div class="admonition note someclass" id="someid" somekey="some value">
  <p class="admonition-title">
    Note
  </p>
  <p>
    Hello, world!
  </p>
  <p>
    Foo bar
  </p>
</div>
Repository owner deleted a comment from Sebastianoskiojoj Oct 1, 2022
Repository owner deleted a comment from Sebastianoskiojoj Oct 1, 2022
Repository owner deleted a comment from Sebastianoskiojoj Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant