In-reply-to » @lyse Besides, have a look at https://movq.de/v/cf0903ebc3/numb.png again: When it goes from item 9 to item 10, the indentation of the text (after the number) changes. Pretty ugly. In other words, a table of contents should be a table, not a list like it is at the moment. And that would require me to write my own extension for python-markdown … Probably not worth it.

@movq@www.uninformativ.de Yes, that’s what I was thinking, too. For a moment, I wanted to suggest to use <ol> instead of <ul> to fix that. However, that’s only gonna work for the first level, but subsections then miss their parent level.

And it turns out that I was wrong. At least sort of. There are some CSS tricks to fix it: https://stackoverflow.com/a/26243681 Of course, with text or retro browsers, this is not gonna fly.

I also came across this interesting article. I just skimmed it and it’s about real tables of contents with page numbers, so not what you have in mind, but cool nevertheless: https://css-tricks.com/a-perfect-table-of-contents-with-html-css/

⤋ Read More