Permalink
Browse files

Add language type attribute to programlisting tag

The current programlisting tag doesn't have any attribute to indicate
the code's language. This makes code highlighting customization
difficult.

For example, the current doxygen generated document doesn't hightlight
javascript code block. If one wants to customize the code block by
parsing the xml files and uses 3rd party syntax highlighter, there is
no way to tell from the xml file what language the code snippet is
using.

This change introduces an attribute "lang" to the programlisting tag.
  • Loading branch information...
shi-yan committed Aug 22, 2017
1 parent 76d2c2f commit 141dbfd5a4f79c98da14a1b414c6db4e1b34618b
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/xmldocvisitor.cpp
View
@@ -211,7 +211,7 @@ void XmlDocVisitor::visit(DocVerbatim *s)
switch(s->type())
{
case DocVerbatim::Code: // fall though
m_t << "<programlisting>";
m_t << "<programlisting lang=\"" << lang << "\">";
Doxygen::parserManager->getParser(lang)
->parseCode(m_ci,s->context(),s->text(),langExt,
s->isExample(),s->exampleFile());

0 comments on commit 141dbfd

Please sign in to comment.