Add support for `[TOC]` to generate a table of contents in Markdown

Additional information from issue https://gitlab.com/gitlab-org/gitlab-ce/issues/64358 and #21901 (closed)

Currently, it is possible to generate a Table of Contents in Markdown by adding the [[_TOC_]] tag. This was added in Issue gitlab-ce#2494 and !24196 (merged). Would it be possible to extend this to support using

  • git user
  • title-1
  • title-2
  • title-3
    • Links / references
to add a Table of Contents as well? As noted in the forum thread below, some Markdown editors such as stackedit.io and Typora interpret
  • git user
  • title-1
  • title-2
  • title-3
    • Links / references
as a ToC rather than [[_TOC_]]. I also have my repository's wiki mirrored on Bitbucket and I found that their software also recognises
  • git user
  • title-1
  • title-2
  • title-3
    • Links / references
but not [[_TOC_]]. Thanks.
  • git user
  • title-1
  • title-2
  • title-3
    • Links / references

git user

sth.....

title-1

title-2

title-3


Links / references

  • https://forum.gitlab.com/t/table-of-contents-toc-in-markdown-wiki-and-general/9394
  • https://confluence.atlassian.com/bitbucket/add-a-table-of-contents-to-a-wiki-221451163.html
  • https://support.typora.io/Markdown-Reference/#table-of-contents-toc
Edited Jun 30, 2020 by Brett Walker
Assignee Loading
Time tracking Loading