I have a bunch of namespaces (containing free functions) and classes (containing member functions, obviously), each of which has a Doxygen comment at the top level and some Doxygen comments for its members. They're within a top-level namespace (one for the whole project) and secondary namespaces (to break the project into packages). Like this:
proj/pkg1/foo.hpp
:class proj::pkg1::Foo
proj/pkg1/bar.hpp
:class proj::pkg1::Bar
proj/pkg1/baz.hpp
:namespace proj::pkg1::Baz
proj/pkg2/one.hpp
:class proj::pkg2::One
proj/pkg2/two.hpp
:namespace proj::pkg2::Two
I don't have any @file
comments. They'd be totally redundant, because there's already exactly one main comment per component, which is attached to the main class or namespace.
I tried running this through Doxygen, and the result is a mess:
- The namespaces and classes are separated into two different hierarchies, both in the header row and the navigation panel. But I want them all in a single tree, because e.g.
pkg2::One
belongs alongsidepkg2::Two
. - The main hierarchy of namespaces is buried three levels down the navigation panel (Project name -> namespaces -> namespace list). It's next to "Namespace Members" - who uses that!?
- There's another hierarchy for the files (and directories). This is redundant because these exactly match the hierarchy of namespaces (and classes).
- This is digressing a bit now, but I'd also like to add comments to the package namespaces. These have the same problem of separating classes and namespaces (not such a big deal) but also show up various free functions e.g.
operator<<(proj::pkg2::One
.
Is there any way to clean things up a bit? Maybe with Sphinx and Breathe?
Example screen shot
Here is what Doxygen produces by default on the above code (it doesn't even mention Baz
and Two
!), and what I prefer it to look like: