6

I am trying to use the doxygen to generate a user help, when I use the command \tableofcontents in the mainpage, nothing shows in the html output.I just don't know why, does anyone know how to use the command of tableofcontents? Some examples will be better, thanks! Note that the browser is OK.

user1416414
  • 61
  • 1
  • 2
  • The [`\tableofcontents`](http://www.stack.nl/~dimitri/doxygen/commands.html#cmdtableofcontents) command: "Creates a table of contents at the top of a page, listing all sections and subsections in the page". Do you have any sections or subsections on your `\mainpage`? It does not generate a table of contents for the project documentation as a whole. – Chris May 25 '12 at 08:05
  • Also in version 1.8.0 the \tableofcontents command did not work in the mainpage. This has been corrected in version 1.8.1. – doxygen May 25 '12 at 14:39

1 Answers1

2

The solution key is to add a label to your headlines:

This is a level 1 header {#labelid_H1}
========================

This is a level 2 header {#labelid_H2}
------------------------

# This is a level 1 header # {#labelidH1}

## This is level 2 header ## {#labelidH2}

Then table of contents [TOC]

[TOC]

as well as headline links

[Link to first headline](@ref labelid_H1) 
[Link to second headline](#labelid_H2)

are working.

Another point to mention is that Doxygen eats up the first line in the file that's used as mainpage (look for "Eat my shorts, Doxygen!" in: Use the README.md file as main page in Doxygen)

Community
  • 1
  • 1
Tuka
  • 21
  • 2
  • The same solution is posted here: https://www.mail-archive.com/doxygen-users@lists.sourceforge.net/msg01520.html – Tuka Aug 07 '15 at 11:39