From fe760977e2cb643b94fbf21847e0c81e8a080966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 25 Nov 2017 20:02:49 +0100 Subject: Expose TOC placeholder in XML output. Currently the XML output for a page was generated the same independently of whether the \tableofcontents command was present in the page source or not. Because of that, the users of the XML output had no chance of knowing whether given page should have a TOC or not. There's now a new element that gets added in case the TOC was requested. As it is trivial to populate the TOC on user side by simply enumerating the elements, the element is empty and acts just as a boolean. --- src/xmlgen.cpp | 4 ++++ templates/xml/compound.xsd | 1 + testing/043/mypage.xml | 1 + testing/043_page.dox | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 81fba40..4aea4e9 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1825,6 +1825,10 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample) } } writeInnerPages(pd->getSubPages(),t); + if(pd->showToc()) + { + t << " " << endl; + } t << " " << endl; writeXMLDocBlock(t,pd->briefFile(),pd->briefLine(),pd,0,pd->briefDescription()); t << " " << endl; diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd index 8affc20..3cc39bc 100644 --- a/templates/xml/compound.xsd +++ b/templates/xml/compound.xsd @@ -29,6 +29,7 @@ + diff --git a/testing/043/mypage.xml b/testing/043/mypage.xml index 589df5b..79fb7ae 100644 --- a/testing/043/mypage.xml +++ b/testing/043/mypage.xml @@ -4,6 +4,7 @@ mypage Page Title Another Page + Page brief description. diff --git a/testing/043_page.dox b/testing/043_page.dox index 096f998..38c1894 100644 --- a/testing/043_page.dox +++ b/testing/043_page.dox @@ -4,6 +4,8 @@ /** \page mypage Page Title * \brief Page brief description. * + * @tableofcontents + * * Text at page level. See \ref mysect for more. * \section mysect Section Title. * Text at section level. See \ref mysubsect for more. -- cgit v0.12