-
Public Repo axilleas/home-assistant.github.io#2 Description Hi! I'm trying to contribute to the home assistant repo and add table of contents to the integrations pages, for example https://www.home-assistant.io/integrations/tradfri/. While the table of contents is generated, the anchor links are not. Am I missing something? Your Usage Markdown file example https://github.com/home-assistant/home-assistant.io/blob/current/source/_integrations/tradfri.markdown {% include toc.html html=content sanitize=true h_min=2 %} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Take a look at the rendered page and inspect the headings, <h3>
<a class="title-link" name="configuration-variables" href="#configuration-variables"></a> Configuration Variables
</h3> The IDs are being created as You would have to modify this project to instead look for |
Beta Was this translation helpful? Give feedback.
-
Ah, I see. I figured it had something to do with using CommonMark instead of Kramdown. Thanks :) |
Beta Was this translation helpful? Give feedback.
Take a look at the rendered page and inspect the headings,
The IDs are being created as
<a>
tags inside of the<h3>
. The way this snippet works is that it relies on the<h1>
-<h6>
tags having theid
attribute.You would have to modify this project to instead look for
<a>
tags and then pull out thename
attribute values.