Extend definition lists to support admonitions #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows you to define an admonition by using the syntax found at https://pythonhosted.org/Markdown/extensions/admonition.html. The difference between this implementation and the one described on pythonhosted is this implementation uses definition lists instead of nested paragraphs. Also, if you specify and empty string for the title, the generated
<dt>
element will still be generated, but will be empty.The added classes are
admonition
andxxx
- whatever you set the admonition as.Also, if you do not provide a term, then
Xxx
will be used as the term. The first letter will be capitalized, and any underscores will be replaced with spaces. This allows you to define, for example:And it will be turned into:
If you define a term after the admonition annotation, then the term is used instead (without the admonition). So, for example:
Will be turned into:
Note that the trailing triple exclamation point is optional, but can be used (similar to the
#
for headers) to balance out the way the line looks.Non-HTML formats will just output their information as a definition list.
There are also unit tests added to the MarkdownTest repository (see fletcher/MMD-Test-Suite#7)