Markus Sabin
Markus Sabin

Reputation: 4013

Doxygen: Is it possible to strip namespace names in CHM index?

I am working on a C++ project which makes extensive use of namespaces and doxygen. I prefer using the CHM file as compiled by MS HHC over the HTML directory for various reasons. One of them is the very convenient index search in the CHM viewer.

But the calls names in the index are always prefixed with their namespaces which forces the user of the CHM file to enter Namespace::Sub-Namespace::[...]::ClassName in the search.

Regarding this, I have changed the following settings in the doxygen configuration file (referring to the default that comes with the tool):

SHOW_NAMESPACES        = NO
HIDE_SCOPE_NAMES       = YES

This removes the namespace names everywhere except for the CHM index. (How) is it possible to get rid of the namespace prefixes in the CHM index as well?

Upvotes: 0

Views: 546

Answers (1)

help-info.de
help-info.de

Reputation: 7298

As far as I know and tried with a small C# project the answer is - no.

One solution I see at this stage is to edit the resulting index.hhk and compile again by HTMLHelp Workshop. Please have a look into your index.hhk you'll find in your Doxygen HTML output subfolder.

The index.hhk file is a text file and can be openend by any text editor e.g. Notepad++. Having some namespaces only you make a RegEx for your needs and replace e.g. C_Sharp_CHM:: like shown in the screenshot below with NOTHING. But be careful using this and try before going to a production use case.

enter image description here

As you can see index.hhk is an old file format and not HTML as used today. Normally each index keyword has a link and a value (see screenshot, text format is edited here for better reading).

To compile the index.hhp you need to open the command prompt, navigate to your output folder and type "%programfiles(x86)%\HTML Help Workshop\hhc" index.hhp on a Windows 10 machine.

Upvotes: 1

Related Questions