Replace html font tags with HTML headings#446
Conversation
CouldBeThis
commented
Apr 22, 2021
Ran markdownlint on install.md; it is complaining about "MD024/no-duplicate-heading" However the headings have intentionally been created in a consistent manner therefor I ignore this.
|
Please see https://github.com/MichaIng/DietPi-Docs/blob/master/.markdownlint.yml#L6-L7 about which markdownlint rules we intentionally ignore or adjust. Actually, the issue of doubled/numbered element IDs and page anchors to hidden elements is the reason why we switched from headings to font size tags in tabs. In this particular example:
Actually these issues are the reason why The IDs + links are set by the TOC extension: https://github.com/MichaIng/DietPi-Docs/blob/master/mkdocs.yml#L36-L37
@StephanStS @fpetru Before the idea comes up again: Automatically opening tabs when a link refers to an element inside of it is not possible with the currently used extension and not a plan, as it would require extended JavaScript use, which goes beyond of what Markdown extensions are designed for (Markdown => HTML translation). I discussed that with facelessuser already. |
|
hmmm interesting. I thought probably someone had used some kind of wysiwyg editor along the way. thank you for taking the time to explain to me. I can't tell if it's because something changed elsewhere in the source but now when I go to the branch where I was working on this it does not display correctly at all, the tabs are weird. What I was going to do was see if the nonpretty anchors would link properly into the tabs. Because that would be useful to know about if yes. However instead it links to totally the wrong place; probably the whole thing is broken.. so I will have to maybe redo some changes on a fresh branch. How are these URLs being displayed to the user or to anyone else? It seems to me the only way anyone would see the nonpretty URL would be because they had some utility for it no?
I'm sure that could be addressed with careful CSS. Or instead of using . Or some other solution; whatever it is, everybody needs to know about how to use it properly. Because there is no way to deduce this from looking at the yml file (which I did do).
|
That is not possible, as mentioned above, hence the wrong page scroll you face.
👍 That is so obvious, I wonder why I never through about that instead of manually trying to get headings style 😄. I hope that MkDocs only converts Markdown headings into links and not HTML headings. @StephanStS did you try that?
What do you mean? When hovering a heading, the link appears, clicking on it scrolls to the header and adjusts the browser address bar accordingly. Copy&pasting that somewhere for reference, then other users clock on it and land on a wrong place of the page, as the original user had another tab open than the default one 😉. So for now there must be no heading links inside of subsequent tabs, but only on the first tab that is visible when accessing the page. |
|
Let's get this further: While we cannot assign IDs for headings behind tabs, there are two options:
|
|
I'm sorry for this taking ages, but it was really that simple: Using HTML h2/h3 tags in Markdown assures that the style is the same but the headings element ID and link are omitted, just as we want it. Applied the changes to other cases where we used the font tag. Made a test build, looks and works all fine, ready from my end. |