=================================== =======================================
Variable Description
=================================== =======================================
-:ini:`M_THEME_COLOR` Color for :html:`<meta name="theme-color"/>`,
+:ini:`M_THEME_COLOR` Color for :html:`<meta name="theme-color" />`,
corresponding to the CSS style. If empty,
no :html:`<meta>` tag is rendered. See
`Theme selection`_ for more information.
+:ini:`M_FAVICON` Favicon URL, used to populate
+ :html:`<link rel="icon" />`. If empty, no
+ :html:`<link>` tag is rendered.
:ini:`M_LINKS_NAVBAR1` Left navbar column links. See
`Navbar links`_ for more information.
:ini:`M_LINKS_NAVBAR2` Right navbar column links. See
active menu item) and :py:`sub` is a list optionally containing sub-menu
items. The sub-menu items are in a similarly formed tuple,
:py:`(title, url, id)`.
+- The :py:`M_FAVICON` is converted to a tuple of :py:`(url, type)` where
+ :py:`url` is the favicon URL and :py:`type` is favicon MIME type to
+ populate the ``type`` attribute of :html:`<link rel="favicon" />`.
and in addition the following variables:
import html
import os
import glob
+import mimetypes
import shutil
import subprocess
import urllib.parse
state.doxyfile[var] = navbar_links
+ # Guess MIME type of the favicon
+ if state.doxyfile['M_FAVICON']:
+ state.doxyfile['M_FAVICON'] = (state.doxyfile['M_FAVICON'], mimetypes.guess_type(state.doxyfile['M_FAVICON'])[0])
+
def parse_xml(state: State, xml: str):
# Reset counter for unique math formulas
m.math.counter = 0
'M_FILE_TREE_EXPAND_LEVELS': ['1'],
'M_EXPAND_INNER_TYPES': ['NO'],
'M_THEME_COLOR': ['#22272e'],
+ 'M_FAVICON': [],
'M_LINKS_NAVBAR1': ['pages', 'namespaces'],
'M_LINKS_NAVBAR2': ['annotated', 'files'],
'M_PAGE_FINE_PRINT': ['[default]']
'XML_OUTPUT',
'M_PAGE_HEADER',
'M_PAGE_FINE_PRINT',
- 'M_THEME_COLOR']:
+ 'M_THEME_COLOR',
+ 'M_FAVICON']:
if i in config: state.doxyfile[i] = ' '.join(config[i])
# Int values that we want
{% for css in HTML_EXTRA_STYLESHEET %}
<link rel="stylesheet" href="{{ css|basename_or_url|e }}" />
{% endfor %}
+ {% if M_FAVICON %}
+ <link rel="icon" href="{{ M_FAVICON[0] }}" type="{{ M_FAVICON[1] }}" />
+ {% endif %}
{% block header_links %}
{% endblock %}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
PROJECT_BRIEF = "is cool"
M_THEME_COLOR = 00ffff
+M_FAVICON = favicon.png
M_PAGE_HEADER = "<p><a href=\"{filename}\">A self link</a>.</p>"
M_PAGE_FINE_PRINT = "<p><a href=\"http://doxygen.org\">Doxygen</a> version {doxygen_version}.</p>"
M_LINKS_NAVBAR1 = "files pages namespaces" \
<title>A project is cool</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
<link rel="stylesheet" href="m-dark+doxygen.compiled.css" />
+ <link rel="icon" href="favicon.png" type="image/png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="00ffff" />
</head>
'HTML_OUTPUT': 'html',
'M_CLASS_TREE_EXPAND_LEVELS': 1,
'M_EXPAND_INNER_TYPES': False,
+ 'M_FAVICON': '',
'M_FILE_TREE_EXPAND_LEVELS': 1,
'M_LINKS_NAVBAR1': ['pages', 'namespaces'],
'M_LINKS_NAVBAR2': ['annotated', 'files'],