After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 616213 - In HTML header & footer file, allow substituting $title only by title, not by title with project name prepended
In HTML header & footer file, allow substituting $title only by title, not by...
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.6.3-SVN
Other All
: Normal enhancement
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2010-04-19 19:16 UTC by Max Horn
Modified: 2011-08-24 20:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes the issue of this ticket: Expands $title to title only. Patch for Doxygen 1.7.4. (1.48 KB, patch)
2011-07-01 20:15 UTC, Carsten Fuchs
none Details | Review

Description Max Horn 2010-04-19 19:16:46 UTC
Doxygen currently uses the PROJECT_NAME for many different things, inserting it in all kinds of places. Unfortunately, this makes it slightly difficult to adjust the look & feel of the Doxygen output in certain cases.

In this particular case, we would like to change the title of our Doxygen pages from the form
  PROJECT_NAME: ACTUAL PAGE TITLE
to some other form including our project name and the page title. To give a concrete example, we would like to to replace
  ScummVM: ADParams Struct Reference
by
  ScummVM :: Doxygen :: ADParams Struct Reference
in order to match the HTML titles of some of our other sites.

Unfortunately, if PROJECT_NAME is set, then Doxygen's HtmlGenerator::startFile currently always adds a "PROJECT_NAME: " prefix to the page title (the "dispTitle" variable) before passing it to substituteKeywords. This makes it impossible for us to perform this customization.

Well, that is, of course we could try to run a perl / sed script as post-processor, but that seems like a very ugly hack for something that looks to me like an historically grown misfeature in Doxygen ;-), no offense intended (I love Doxygen :).

Now I realize that just changing this might be quite bad for existing templates. So, one shouldn't just change this lightly. I wouldn't dare to be the one to make the call on this, anyway :)

I propose two possible solutions for this (and am willing to get my hands dirty and try to provide a patch, if you tell me which you prefer):

1) Ignore backwards compatibility and just don't prepend PROJECT_NAME to the display title. After all, it's available via the $projectname substitution variable, so it's easy to adapt templates by changing  "$title" to  "$projectname: $title". Still, this would force lots of people to adjust their template.

2) Stay backward compatible and don't touch $title. Instead, introduce a new variable, say, $plain_title, which contains only the actual title. This way new templates can perform customizations like the one we desire.


Maybe you also have other & better ideas, these are just two suggestions from the top of my head, and of course I don't know the Doxygen source code very well.


BTW, some people suggested to me that I should just use an empty PROJECT_NAME (which would solve the issue above as in that case Doxygen doesn't prepend anything), but IMHO that would be a rather bad hack, and also would break other things that normally insert the project name; like the HTML navigation tree view thingy, which uses the project name as root for the navigation tree. Plus it's not a viable solution for other projects which want to share a single template for multiple (sub)projects.

By the way, there are more places where the indiscriminate use of PROJECT_NAME for all and everything bites us. E.g. FTVHelp::generateTreeView in ftvhelp.cpp insists on using PROJECT_NAME for the <title> page of the master index.html it generates, without any option to override this. Hence we currently run a brief perl script over this to change "<title>ScummVM</title>" to the title we really want. Since this is only a single small file, I can live with that. Although it certainly would be nice to be able to change this "cleanly" :).
Comment 1 Carsten Fuchs 2011-07-01 20:15:45 UTC
Created attachment 191117 [details] [review]
Fixes the issue of this ticket: Expands $title to title only. Patch for Doxygen 1.7.4.
Comment 2 Carsten Fuchs 2011-07-01 20:32:58 UTC
Just for completeness, the thread that I started at doxygen-users before I found this bug entry is at http://sourceforge.net/mailarchive/message.php?msg_id=27686220

The problem was reproduced unter Windows 7 with Doxygen 1.7.4,
the patch was taken against r767.
Comment 3 Dimitri van Heesch 2011-07-02 17:51:50 UTC
Thanks, I'll include the patch in the next subversion update.
Comment 4 Dimitri van Heesch 2011-08-14 14:04:35 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.7.5. Please verify if this is indeed the case. Reopen the
bug if you think it is not fixed and please include any additional information
that you think can be relevant.
Comment 5 Carsten Fuchs 2011-08-24 20:49:07 UTC
Verified, it works very well in 1.7.5 and 1.7.5.1.

Dimitri, thank you very much for your work!!
:-D