treeviewdoxygen

Customize treeview in Doxygen


I am trying to use Doxygen for the first time and so far I am pleased with most things. You can say the manual I am creating consists of two parts: one that is built up using .dox-files containing general information about the product; then part two is built from source files and shows the API.

The problem I am having is that the pages generated from source files don't appear like I want them to in the treeview. The part generated from .dox-files can easily be structured like I want it (using \page, \section and \subsection for example) but when I include the source files the new pages (Classes, Files) appear on the first level of the treeview:

V Project Name
    > Installation (.dox)
    > Licensing (.dox)
    > Components (.dox)
    > Tools (.dox)
    > Getting Started (.dox)
    > Classes (source files)
    > Files (source files)

The least I would like to be able to customize the treeview is to move all the pages generated from source files down one level in the treeview (but if it is possible to customize the page structure like I do in the .dox-files that would be great):

V Project Name
    > Installation (.dox)
    > Licensing (.dox)
    > Components (.dox)
    > Tools (.dox)
    > Getting Started (.dox)
    V API
        > Classes (source files)
        > Files (source files)

Is this possible? While googling I managed to find something called "layout file" but I failed to understand how it works or if it would even help in this case.

If this is not possible then I have to put the API part in a separate manual but I really like to avoid this.

I appreciate any help.


Solution

  • I managed to solve this by changing the "layout file". The default file looks as follows:

    <navindex>
      <tab type="mainpage" visible="yes" title=""/>
      <tab type="pages" visible="yes" title="" intro=""/>
      <tab type="modules" visible="yes" title="" intro=""/>
      <tab type="namespaces" visible="yes" title="">
        <tab type="namespacelist" visible="yes" title="" intro=""/>
        <tab type="namespacemembers" visible="yes" title="" intro=""/>
      </tab>
      <tab type="classes" visible="yes" title="">
        <tab type="classlist" visible="yes" title="" intro=""/>
        <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/> 
        <tab type="hierarchy" visible="yes" title="" intro=""/>
        <tab type="classmembers" visible="yes" title="" intro=""/>
      </tab>
      <tab type="files" visible="yes" title="">
        <tab type="filelist" visible="yes" title="" intro=""/>
        <tab type="globals" visible="yes" title="" intro=""/>
      </tab>
      <tab type="examples" visible="yes" title="" intro=""/>  
    </navindex>
    

    I changed to:

    <navindex>
      <tab type="mainpage" visible="yes" title=""/>
      <tab type="pages" visible="yes" title="" intro=""/>
      <tab type="usergroup" visible="yes" title="API" url="@ref api" intro="">
        <tab type="modules" visible="yes" title="" intro=""/>
        <tab type="namespaces" visible="yes" title="">
          <tab type="namespacelist" visible="yes" title="" intro=""/>
          <tab type="namespacemembers" visible="yes" title="" intro=""/>
        </tab>
        <tab type="classes" visible="yes" title="">
          <tab type="classlist" visible="yes" title="" intro=""/>
          <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/> 
          <tab type="hierarchy" visible="yes" title="" intro=""/>
          <tab type="classmembers" visible="yes" title="" intro=""/>
        </tab>
        <tab type="files" visible="yes" title="">
          <tab type="filelist" visible="yes" title="" intro=""/>
          <tab type="globals" visible="yes" title="" intro=""/>
        </tab>
        <tab type="examples" visible="yes" title="" intro=""/>
      </tab>
    </navindex>
    

    I created the API page (referenced by the usergroup tab) in a file called api.dox:

    /*! \page api API
    TODO: Add text here...
    */