Add a table of contents to a wiki

Learn how to use the table-of-contents (TOC) macro to create a list of the topics (or sections) of a given wiki page.

The markup language you are using in your Wiki will determine what style of TOC you can create.  The following table shows the markup syntax for each available language.

Language Description and Markup

Allows you to create a TOC for the Wiki itself or just a page. Use the following to create a page-level TOC


You can also create a table of contents for a Wiki use:

<<toc path depth>>

For example, to list all the pages in your Wiki and their headings to a level of 2, enter the following:

<<toc / 2>>

See Macro Reference for Creole Markup in this documentation for more information.


You can only create a page-level table of contents. The syntax is:


See the extension documentation for more information.


You can create a page-level TOC. The syntax is as follows:

.. contents::

See the reStructureText documentation for more information.

Textile You cannot create a TOC for a page or the Wiki itself with Textile.


Special support for Creole

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

16 Archived comments

  1. User avatar


    It's worth noting that the toc macro isn't expanded when using the preview feature. To see the actual ToC you need to save the wiki page.

    07 Apr 2011
  2. User avatar


    08 Apr 2011
  3. User avatar


    The example should be <<toc / 3>>

    06 Aug 2011
  4. User avatar


    The lack of addressing this ToC issues in a timely manner (repeatedly) has inspired this (once paying) customer to delete all of my personal repositories from Bitbucket and to go with a competitor.  We currently have a broad spectrum of Atlasssian products, to include our 25+ user licenses for Jira, Bamboo, Crucible, and Greenhopper - it's clear that Bitbucket is the bastard-stepchild of the Atlasssian product line. I suggest that anyone else that expects reasonable functionality from Bitbucket's web site and/or the wiki pages (and their support staff) should do the same.



    23 Oct 2011
  5. User avatar

    Alexander Sideropoulos

    There are currently some issues with the TOC on a sub-directory page where the links are not generated correctly. I have reported issue #3912.

    20 Apr 2012
  6. User avatar

    Joel Latino

    Was nice if it was possible to sort by name. That's a really good feature.

    05 Apr 2013
    1. User avatar


      Good idea.  Check the markup language you are using, it might offer this already.

      09 Apr 2013
      1. User avatar

        Joel Latino

        I'm using creole. And I think is not provided. Is only path and depth. Link: "Syntax<<toc path depth>>"

        09 Apr 2013
        1. User avatar


          Apologies.  I should never answer page questions from a conference. You are correct, our TOC macro does not support sort. You can file an enhancement request for this.

          09 Apr 2013
  7. User avatar

    Hauke Hildebrandt

    Is there a way to include the page title in a wiki (not page) toc? It seems only the Hx tags are evaluated, but the page titles are missing.

    21 Oct 2013
    1. User avatar


      What you can do in a page depends on the markup language you use in your Wiki.  Of course, regardless of the language, you can always manually enter the title in the page.  

      21 Oct 2013
      1. User avatar


        I'm using Creole. Now, to autogenerate a TOC for the wiki on the homepage I can use the macro, e.g. like this: <<toc / 3>>. But that will give me the H1-H3 headers. I would like to see the page itself (as specified by its title) in the list.

        21 Oct 2013
  8. User avatar


    And if you click History button,  it seems that it only shows the history of Any other changes pushed to the wiki repo (ie. adding of new files) are not shown. Why?

    12 Feb 2014
  9. User avatar


    I am exporting a pdf, out from multiple confluence wiki pages. My requirement is to have a minitioc(for h1, h2, h3 etc.) at the top for each page in the exported pdf. Is this possible to generate, and how?

    I don't want to update my wiki pages.


    25 May 2014
    1. User avatar

      Dan Stevens [Atlassian]

      Good day,

      Thanks for taking the time to comment. I'm wondering if you are looking for confluence help? This topic is specific to Wiki pages created and maintained in Bitbucket. I think this page might help you Exporting Confluence Pages and Spaces to PDF.

      If you are referring to Bitbucket wiki's, you can't do what your seeking from the Bitbucket UI itself. I'm not sure if there is a way to do so with Markdown after you clone the wiki locally.

      Have a great day.

      25 May 2014
  10. User avatar

    Appan Ponnappan

    In the last 2-3 days, suddenly the <<toc>> and <<issues>> macros have stopped working. Page in which it is not working is here.

    It works in page preview, but after saving the page the macros are not replaced with content.

    03 May 2015
Powered by Confluence and Scroll Viewport