Skip to content

Conversation

@aleray
Copy link

@aleray aleray commented Jun 24, 2012

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

aleray added 7 commits May 27, 2012 15:08
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
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

Successfully merging this pull request may close these issues.

1 participant