Closed tsung-wei-huang closed 3 years ago
You can do this adding a bit of your own CSS: https://stackoverflow.com/questions/10340276/how-to-add-section-numbers-1-2-3-4-1-automatically-using-css
When I ass that customized css into HTML_STYLESHEET = custom.css
, the result of the HTML totally got screw up.
body {counter-reset:section;}
h1 {counter-reset:subsection;}
h2 {counter-reset:subsubsection;}
h1:before
{
counter-increment:section;
content:counter(section) ". ";
}
h2:before
{
counter-increment:subsection;
content:counter(section) "." counter(subsection) " ";
}
h3:before
{
counter-increment:subsubsection;
content:counter(section) "." counter(subsection) "." counter(subsubsection) " ";
}
Am I doing it correctly?
You might want to use HTML_EXTRA_STYLESHEET
instead, so it doesn't overwrite the standard stylesheets.
The result is the same. The default m-dark+documentation.compiled.css
is not overwritten but the who documentation got screwed up. This is my Doxyfile-mcss.
@INCLUDE = Doxyfile
HTML_EXTRA_STYLESHEET = custom.css
GENERATE_HTML = YES
GENERATE_XML = YES
XML_PROGRAMLISTING = NO
PROJECT_NAME = Taskflow
PROJECT_BRIEF = QuickStart
I'm afraid you ran into a not-really-well-documented corner case with the HTML_EXTRA_STYLESHEET
option. While Doxygen has no default value for it, m.css uses it to supply its own style and if you override it, you lose the default style. The fix is to include the default there as well -- I think this could work in your case:
HTML_EXTRA_STYLESHEET = \
https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600 \
../css/m-dark+documentation.compiled.css \
custom.css
@mosra thanks, this fixes my problem.
Is there a way to number each section in addition to the heading? Without numbers, it is not very clear to see the hierarchies of a page which has subsections and so on. For example: