Skip to content

Admonition text blocks support #891

@milmazz

Description

@milmazz

What is an admonition text block?

From the AsciiDoc documentation an admonition:

There are certain statements that you may want to draw attention to by taking
them out of the content’s flow and labeling them with a priority. These are
called admonitions. It’s rendered style is determined by the assigned label
(i.e., value)

Also, probably some of you have read the blog post announcing Distillery
2.0
, in that blog post Paul mentioned some documentation improvements in
Distillery, specifically:

The docs have been significantly revamped using MkDocs. They are much easier
to navigate now, are more readable by extracting tips and warnings into
asides/callouts, and are fully searchable as well!

Behind the scenes MkDocs uses Python-MarkDown, which parses MarkDown
and support admonitions via an extension.

screen shot 2018-09-06 at 11 01 26 am

So, I think it would be really nice to have support for something like this in ExDoc.

About the syntax

The Admonition extension from Python-MarkDown follows almost the same syntax
as in reStructuredText:

.. note:: This is a note admonition.
   This is the second line of the first paragraph.

   - The note contains all indented body elements
     following.
   - It includes this bullet list.

But, they use !!! instead of ..:

!!! note
    You should note that the title will be automatically capitalized.

I also have seen these callouts when I have used AsciiDoc, but the AsciiDoc syntax depends on the use case.

For a single paragraph it is like this:

WARNING: Wolpertingers are known to nest in server racks.
Enter at your own risk.

In this case the label must be uppercase and immediately followed by a colon. But the syntax is a little more complex for a block of text:

[IMPORTANT]
.Feeding the Werewolves
====
While werewolves are hardy community members, keep in mind the following dietary concerns:

. They are allergic to cinnamon.
. More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
. Celery makes them sad.
====

Probably we should ask the Earmark team if they want to support this feature there, but I want to know your opinion before proceeding .

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions