Add a depth option to [articletoc] to control which type of titles to add in the table of content | World Anvil

Remove these ads. Join the Worldbuilders Guild

Add a depth option to [articletoc] to control which type of titles to add in the table of content

Feature Upgrade · Articles & templates · Created by Rumengol
closed
articletoc

What functionality is missing? What is unsatisfying with the current situation?

 

Currently, when adding the {articletoc} tag to an article, every header from h1 to h4 is gathered and displayed. However, sometimes we add titles extensively to ease the flow of the article. While it is nice, it may impair the readability of the table of content.

 

In my most recent case, the only titles worth appearing in the table of content were h1, but I also had many h2's and the articletoc was way too big for what needed to be actually displayed. Although a workaround exists, it is quite tedious to make in every article.

 

How does this feature request address the current situation?

 

My suggestion is to add to the articletoc tag an optional parameter to specify how deep one wants to go in the header hierarchy. It may look like [articletoc:1] to only display h1 titles, [articletoc:2] for including h2 and so on...

 

This would allow better control of the layout, and how the table of content is displayed in articles. And I believe, though I may be wrong, that it shouldn't be too heavy development-wise.

 

Let me know what you think!

The Team's Response

Great idea but very low support - I think that a better title / description might help when resubmitted.
Current score

26/300 Votes · +4640 points

Votes Cast

  • +300

    by scholarmage
    on 2022-05-18 14:41
    +1 for Jubliana's comment. There are problems with articletoc already, such as the statblocks using header formatting and consequently showing up in the table of contents - any improvements can only be good.
  • +300

    by Katarini
    on 2022-05-17 16:34
  • +300

    by Jubliana
    on 2022-05-12 13:54
    Some customization is needed here so that the TOC for well-structured articles is readable. The options shouldn't make you choose between readable article or readable TOC.
  • +300

    by Shamajotsi
    on 2022-05-11 12:55
  • +10

    by A Lusty Cthulhu
    on 2022-05-11 05:56
  • -300

    by A Filthy Goblin
    on 2022-05-10 10:39
    Off-setting coins added below.
  • +300

    by A Glamorous Dwarf
    on 2022-05-08 22:53
  • +100

    by byrce1
    on 2022-05-08 20:36
  • +300

    by Rahjar
    on 2022-05-06 23:06
  • +20

    by pyrrha
    on 2022-05-05 19:08
  • +200

    by Zhuriel
    on 2022-05-05 06:30
  • +100

    by A Adorable Kitten
    on 2022-05-04 13:26
  • +10

    by nnie
    on 2022-05-04 07:13
    In the meantime, for anyone looking for a solution, you can filter out certain tiers of header with CSS. Under the design options on your article edit add this:   .user-css .article-toc-indent-1 { display:none; }   Swapping indent-1 out will target different header sizes. -0 hides h1, -1 hides h2, -2 hides h3, and so on.
  • +100

    by Nekith
    on 2022-05-03 13:21
  • +100

    by Furiousbunnies
    on 2022-05-02 00:36
  • +100

    by Secere Laetes
    on 2022-05-01 22:12
  • +50

    by A Cute T-Rex
    on 2022-04-30 23:10
  • +100

    by RiverFang
    on 2022-04-30 02:34
  • +300

    by PrincessESH
    on 2022-04-30 00:08
  • +300

    by BARON229
    on 2022-04-29 18:24
  • +200

    by LeighThalion
    on 2022-04-29 13:56
  • +200

    by charley2020
    on 2022-04-29 08:11
  • +300

    by SilasFM
    on 2022-04-29 03:49
  • +300

    by ss2020
    on 2022-04-28 21:55
  • +300

    by SoulLink
    on 2022-04-28 19:41
    Would be useful to remove minor sidebar headings as well, as I sometimes put the sidebar into the main content field for extra flexibility!
  • +50

    by Michael Chandra
    on 2022-04-28 17:02
  • +300

    by Rumengol
    on 2022-04-28 16:57