Open hileamlak opened 4 years ago
I assume you read about these ways to customize the output already: https://www.doxygen.nl/manual/customize.html
I'm working on a django/jinja like template system that you can use to have much more control over the output but this is still a work in progress (with not too much progress unfortunately). You can see how the templates for html will look like by running doxygen -T -g
and then look at the generated templates/html
directory.
I've been struggling to find how to set a custom template directory. I've generated the templates with doxygen -T -g
but can't find the way to tell Doxygen to use that template directory. Is there a way?
I also understand that this is still an ongoing feature. In order to customize the current layout (with changes that are deeper than those referred to in the manual), is it necessary to fork Doxygen and make the changes there?
(I would really like not to have to write an XML parser for this :-)
Currently, the template directory is hard coded to templates/html
. If a template file is found there it will be used instead of the built-in version. See also https://github.com/doxygen/doxygen/blob/592aaa4f17d73ec8c475df0f44efaea8cc4d575c/src/context.cpp#L10097 for the relevant code.
Fantastic, thank you for the useful reply. I eventually succeded once it became clear that you also need the -T
option when generating the docs so that Doxygen uses your local template dir.
Thank you again! (and apologies now that I realise I hijacked this issue a bit)
Was the -T
option abandoned? I no longer see htmllayout.tpl in templates/html.
Yes this has been abandoned with the 1.9.8 version of doxygen:
Commit: 0b0ec2e61189c321bb7ead5c0bf2f8cb0b618f65 [0b0ec2e]
Date: Friday, August 18, 2023 3:08:08 PM
Remove experimental template engine option
Motivation:
- Incomplete and lagging behind for years
- Too much effort to maintain
- Hard to get the same/reasonable performance
That's disappointing. When comparing other static site generators with Doxygen's HTML output, I'd say Doxygen is years behind the competition (no offense). I know there's other alternatives like Doxygen XML + external tools, but the XML output tends to change enough to break tooling (like breathe) between minor and patch releases of doxygen.
It would be great to have a solution where only doxygen is needed to generate HTML docs. Without template support, any attempt to customize the HTML output (other than header/footer and CSS) would basically require JS to alter the DOM on browser load. So, the performance cost is basically offloaded to the consumers of your end-users.
PS - I did experiment with the JS approach (see my archived repo and its rendered results), but that too became untenable.
I came across this great tool, and I was reading the documentation. This tool is great, but I thought it would be nice if it left a room for users to customize the produced html file. Like allowing users to use there template would be nice.