Inject custom html pages into your doxygen documentation, that can be navigated to and contain the header and footer layout.
First download the doxygen-custom-page-injector.js
script from this repository.
Use doxygen to create a custom layout xml file.
The layout file can be created with the following command:
doxygen -l
After that open your doxyfile and add the layout file.
LAYOUT_FILE = DoxygenLayout.xml
Open your layout file and add an entry for your html file to the end of the navindex
.
<navindex>
...
<tab type="user" url="sample.html" title="SamplePage"/>
</navindex>
For more information about the layout file, please check the doxygen docs.
To make the script and your html file available in the created doc they need to be added to the doxyfile as extra html files.
HTML_EXTRA_FILES = sample.html \
js/doxygen-custom-page-injector.js
For the injection to work, the html file needs to be set up in the right way.
<!DOCTYPE html>
<link rel="icon" href="data:,">
<script type="text/javascript" src="./doxygen-custom-page-injector.js"></script>
<div id="injection-wrapper" nav-to="sample.html" style="display: none;">
<!-- Your HTML goes here -->
</div>
The html file should start with the linked injection script.
Optionally, the following can be added to the top of the file, to use the correct doctype and remove the automatic favicon request, that will be sent by the browser before the doxygen layout gets injected.
<!DOCTYPE html>
<link rel="icon" href="data:,">
After that comes a div
element that wraps the html that should be injected into the doxygen layout.
This div needs to have the id
injection-wrapper
to allow the script to find it.
The nav-to
attribute should contain the name of your html file, so doxygen knows what navigation item to select.
Setting the display
style to none
is optional but recommended if you don't want anything to show up before it gets injected.
All of your custom html should be inside of the injection-wrapper
element, because only the content of that element will be injected and the rest will be trimmed.
If there are any problems or you have some questions, feel free to open an issue.