Search code examples
doxygenfavicon

How to set a favicon for Doxygen output


I am automating documentation generation using Doxygen. How can I specify a favicon (URL icon) for the output?


Solution

  • In doxygen one has the possibility to define his own HTML header file, best based on the default HTML header file.

    To obtain the default HTML header file, syntax:

    doxygen -w html headerFile footerFile styleSheetFile [configFile]
    

    in the headerFile insert in the head part a line like:

    <link rel="icon" href="$relpath^my_icon.ico" type="image/x-icon" />
    

    Note: that the $relpath^ part is necessary especially in case of CREATE_SUBDIRS is set.

    Furthermore in the configuration file (Doxyfile) you have to set:

    HTML_HEADER            = headerFile
    HTML_EXTRA_FILES       += my_icon.ico
    

    Of course the standard restrictions regarding favicons still apply (regarding support by browsers etc.).