Open
Conversation
It can be used by enabling the MKDEXT_INS option like this
(example/sundown.c):
markdown = sd_markdown_new(MKDEXT_INS, 16, &callbacks, &options)
then, after compilation the following command line:
echo "++ins++" | ./sundown
results in:
<p><ins>ins</ins></p>
This is a rewrite of the outline extension for Python-Markdown (http://git.constantvzw.org/?p=aa.mdx_outline.git;a=tree). Wraps the document logical sections (as implied by h1-h6 headings) in html5 <section> tags. Big thank you to Pierre Marchand for helping me with this, and taking time showing me the basics of C99!
One can enable it that way:
sdhtml_renderer(&callbacks, &options, HTML_OUTLINE);
section tags were not closed if current header level was lower than previous header level (eg. h1 following an h2).
If the HTML_OUTLINE flag is enabled, documents like:
# level 1
## level 2
turn into:
<section class="section1">
<h1>level 1</h1>
<section class="section2">
<h2>level2</h2>
</section>
</section>
dokutoku
pushed a commit
to dokutoku/sundown
that referenced
this pull request
Mar 11, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi, I have ported the python-markdown outline extension. Here is what it does:
Wraps the document logical sections (as implied by h1-h6 headings).
By default, the wrapper element is a section tag having a class attribute "sectionN", where N is the header level being wrapped.
More information here:
https://github.com/aleray/mdx_outline