From: Vladimír Vondruš Date: Mon, 9 Apr 2018 10:04:37 +0000 (+0200) Subject: doxygen: make it possible to highlight Jinja templates. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=62fc15eef1e921ebc84ed4820da339a4e955a249;p=blog.git doxygen: make it possible to highlight Jinja templates. There's no well-known extension for these and Doxygen \code{.ext} *requires* an extension inside {} otherwise it blows up. --- diff --git a/doc/doxygen.rst b/doc/doxygen.rst index e88900c6..5f3962bc 100644 --- a/doc/doxygen.rst +++ b/doc/doxygen.rst @@ -561,6 +561,12 @@ Filename suffix Detected language ``.ansi`` `Colored terminal output <{filename}/css/components.rst#colored-terminal-output>`_. Use ``.shell-session`` pseudo-extension for simple uncolored terminal output. +``.xml-jinja`` Jinja templates in XML markup (these don't have any + well-known extension otherwise) +``.html-jinja`` Jinja templates in HTML markup (these don't have any + well-known extension otherwise) +``.jinja`` Jinja templates (these don't have any + well-known extension otherwise) =================== =========================================================== The theme has experimental support for inline code highlighting. Inline code is diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index aafe43fe..e828764f 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -1070,6 +1070,9 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # Pygments knows only .vert, .frag, .geo ('.glsl', 'glsl'), ('.conf', 'ini'), + ('.xml-jinja', 'xml+jinja'), + ('.html-jinja', 'html+jinja'), + ('.jinja', 'jinja'), ('.ansi', ansilexer.AnsiLexer)] for key, v in mapping: if not filename.endswith(key): continue