-
Notifications
You must be signed in to change notification settings - Fork 886
Closed as not planned
Labels
3rd-partyShould be implemented as a third party extension.Should be implemented as a third party extension.extensionRelated to one or more of the included extensions.Related to one or more of the included extensions.featureFeature request.Feature request.needs-decisionA decision needs to be made regarding request.A decision needs to be made regarding request.wontfixThe issue will not be fixed for the stated reasons.The issue will not be fixed for the stated reasons.
Description
[TOC]
# Header 1
will currently generate the following HTML:
<div class="toc">
<ul>
<li><a href="#header-1">Header 1</a></li>
</ul>
</div>
<h1 id="header-1">Header 1</h1>
The div
element cannot be changed and so it is for the title span
element and its toctitle
class.
I suggest that other config parameters (toc_tag
, title_class
, title_tag
) that defaults to their current defaults are introduced.
This would be very useful for producing semantic HTML, using specific HMTL elements.
For example to use the details disclosure element as toc, the extension could be called like so:
md = markdown.Markdown(extensions=[TocExtension(
title='Summary',
title_class="",
title_tag="summary",
toc_class="",
toc_tag="details"
)]]
<details>
<summary>Summary</summary>
<ul>
<li><a href="#header">Header</a></li>
</ul>
</details>
<h1 id="header">Header</h1>
This will render an initially closed details element with a summary:
Summary
Header
Metadata
Metadata
Assignees
Labels
3rd-partyShould be implemented as a third party extension.Should be implemented as a third party extension.extensionRelated to one or more of the included extensions.Related to one or more of the included extensions.featureFeature request.Feature request.needs-decisionA decision needs to be made regarding request.A decision needs to be made regarding request.wontfixThe issue will not be fixed for the stated reasons.The issue will not be fixed for the stated reasons.