Article TOC: Paramater to limit TOC depth | World Anvil

Remove these ads. Join the Worldbuilders Guild

Article TOC: Paramater to limit TOC depth

Feature Upgrade · Articles & templates · Created by SierraKomodo
accepted

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

The articletoc bbcode block presents a full list of every single h# header found in the article. For some articles, this can result in a very long table of contents, or in some cases like my own, header levels used for non-organizational purposes get included (I use h4 to 'label' alert blocks I place throughout articles, for example).

   

How does this feature request address the current situation?

Allowing a parameter to the articletoc bbcode to restrict the depth of the table of contents would:

  • Help to reduce the vertical size of the table of contents in longer articles.
  • Allow power users to use smaller sized headers for formatting and other purposes without them appearing in the table of contents.
 

Example Usage

articletoc|2 would cause the TOC to only display h1 and h2 headers, and skip any smaller sized/higher number headers found in the article. This falls in line with the headers I normally enter in my manually written table of contents, to keep the list condensed and not include superfluous or irrelevant headers.

 

Screenshots

  • The current rendered table of contents. Note the vertical length, and the inclusion of RPG Narrator which is an h4 used to tag an alert block located within the article: https://i.imgur.com/uvwny7Z.png
  • A modified render of the table of contents simulating what could appear with articletoc|2, showing only h1 and h2 headers in the table: https://i.imgur.com/PacIYBe.png
Current score

25/300 Votes · +5503 points

Votes Cast

  • +300

    by A Cute Dwarf
    on 2022-10-24 05:46
  • +300

    by Tengwean
    on 2022-10-22 14:14
  • +100

    by DMFW
    on 2022-10-21 17:37
  • +300

    by A Lusty Velociraptor
    on 2022-10-16 06:52
  • +100

    by Alishahr
    on 2022-10-13 15:30
  • +300

    by scholarmage
    on 2022-10-13 11:59
    The character stat blocks for D&D (at the least) also use h# for formatting, so when I tried to use the articletoc BBcode to create a table of contents for my Adventure April oneshot, it proceeded to list every portion of the stat block in the contents! Being able to exclude this instead of having to create the table of contents manually would have saved valuable time.
  • +300

    by Serbaayuu
    on 2022-10-12 23:25
  • +300

    by EmberJ
    on 2022-10-11 21:40
  • +300

    by Graylion
    on 2022-10-11 15:48
  • +300

    by Rumengol
    on 2022-10-11 06:23
    I made a similar suggestion before, but it didn't get enough votes to be considered. Hope this one will make it through!
  • +300

    by ddaniel
    on 2022-10-08 21:19
    Also please have a different css class for the headers (h1-hx) so we can distinguish them
  • +1

    by SebGreg732
    on 2022-10-08 09:02
  • +300

    by A Filthy T-Rex
    on 2022-10-07 13:40
  • +300

    by Shadow Malachi
    on 2022-10-07 07:05
  • +300

    by mastergentleman
    on 2022-10-06 23:36
  • +100

    by Jtheil0
    on 2022-10-06 21:17
  • +1

    by AvalonArcana
    on 2022-10-06 19:23
  • +100

    by Vibeca
    on 2022-10-05 16:39
  • +1

    by Buzzard
    on 2022-10-05 12:03
  • +100

    by architectfantasy
    on 2022-10-05 11:56
    I dont fully understand what this suggestion says but from what I gather, I think this is a good suggestion which helps organization with Table of Contents feature which is probably not accessible for me.
  • +300

    by A Sneaky Goblin
    on 2022-10-05 09:46
    This would be incredibly helpful
  • +300

    by Nimsy
    on 2022-10-05 05:49
    I've currently achieved this with CSS, but it'd be nice to be able to do without coding.
  • +100

    by Ratha
    on 2022-10-05 04:33
  • +300

    by Dalf32
    on 2022-10-05 04:25
  • +100

    by A Filthy Kitten
    on 2022-10-04 21:04
  • +300

    by SierraKomodo
    on 2022-10-04 17:03