New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In HTML header & footer file, allow substituting $title only by title, not by title with project name prepended (Origin: bugzilla #616213) #3743

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity enhancement in component general for ---
Reported in version 1.6.3-SVN on platform Other
Assigned to: Dimitri van Heesch

Original attachment names and IDs:

On 2010-04-19 19:16:46 +0000, Max Horn wrote:

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" :).

On 2011-07-01 20:15:45 +0000, Carsten Fuchs wrote:

Created attachment 191117
Fixes the issue of this ticket: Expands $title to title only. Patch for Doxygen 1.7.4.

On 2011-07-01 20:32:58 +0000, Carsten Fuchs wrote:

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.

On 2011-07-02 17:51:50 +0000, Dimitri van Heesch wrote:

Thanks, I'll include the patch in the next subversion update.

On 2011-08-14 14:04:35 +0000, Dimitri van Heesch wrote:

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.

On 2011-08-24 20:49:07 +0000, Carsten Fuchs wrote:

Verified, it works very well in 1.7.5 and 1.7.5.1.

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

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment