Skip to content

Looking for more information about data-toc-label and <small> #8271

Closed Answered by mocdaniel
rmscode asked this question in Q&A
Discussion options

You must be logged in to vote

<small> is just HTML, which can be written inside of .md files and gets rendered by mkdocs as-is.

The {{ #with-pip data-toc-label="with pip" }} part is an attribute list which allows you to add HTML attributes and CSS classes to almost every Markdown inline- and block-level element with a special syntax (quoted from the docs).

In the specific case you mention in your question, the part #with-pip assigns id="with-pip" to the <h3> HTML element rendered by mkdocs.

The data-toc-label="with-pip" most probably overwrites the TOC entry for this subheading, so that recommended won't get rendered in the TOC. Instead, with-pip is used for the anchor within the page's URL slug, and with pip as entry…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rmscode
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants