Skip to content

What's the best way for admonition (callout) boxes? #3005

Answered by pdehaan
Andre601 asked this question in Q&A
Discussion options

You must be logged in to vote

I think you pretty much got it. I'd use a paired shortcode, like https://www.11ty.dev/docs/languages/nunjucks/#paired-shortcode

So it would look something like your example:

{% callout "info" %}
This could be some HTML or Markdown content.

<p>This would be incompatible with using the apex <code>example.com</code> for other purposes, e.g. for the <i>Personal/Organization</i> example discussed before.</p>
{% endcallout %}

And maybe your callout shortcode wraps the content in an <aside> tag and displays the "Info" label/icon based on the level that you pass to the shortcode. Or some extra error checking to throw errors if you pass an invalid level/severity (like "warn" instead of "warning",…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Andre601
Comment options

@Andre601
Comment options

@pdehaan
Comment options

Answer selected by Andre601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants