Bowie Owens
Bowie Owens

Reputation: 2976

How to translate a library's doxygen \mainpage into a \page?

I have a library which is documented using doxygen which is used within a larger project. I have a nice \mainpage for my library which I would like to be demoted to a \page when I am running doxygen on the larger project. Is there an easy way to do this without relying on tools other than those installed by Doxygen? To illustrate, when when running doxygen on the library by itself doxygen should see:

/**    
\mainpage

\section main_introduction Introduction

The Gen-MC (Generalised Monte-Carlo) simulation tool.
*/

And when I run doxygen in the larger project it should see:

/**    
\page gen_MC_mainpage Gen-MC

\section main_introduction Introduction

The Gen-MC (Generalised Monte-Carlo) simulation tool.
*/

I assume I could use INPUT_FILTER and a perl script to do this but the more tools I have to get people to install to generate the documentation the less likely they are to make use of it.

Upvotes: 1

Views: 73

Answers (1)

Artur Kink
Artur Kink

Reputation: 528

This can be achieved using conditions

/**    
\if USEMAINPAGE
\mainpage
\else
\page gen_MC_mainpage Gen-MC
\endif

\section main_introduction Introduction

The Gen-MC (Generalised Monte-Carlo) simulation tool.
*/

In your smaller project's Doxyfile add USEMAINPAGE as an enabled section:

ENABLED_SECTIONS       = USEMAINPAGE

if command for more info.

Upvotes: 2

Related Questions