improved styles-auto-doc-generation

This commit is contained in:
jkriege2 2023-07-02 23:19:05 +02:00
parent aee3b23696
commit 55912ad931
4 changed files with 53 additions and 11 deletions

View File

@ -40,7 +40,7 @@ These are also linked into the JKQTPlotter library as Qt ressource into the subd
\endcode
Here is a table with all available ready-made styles:
\htmlinclude styles.html
\include{doc} styles.dox
\see Classes are documented in \ref jkqtpplotter_styling_classes .
<br>See \ref JKQTPlotterStyling for a detailed example.

View File

@ -0,0 +1,46 @@
<table>
<tr>
<th>Style-file
<th>Screenshot
<th>Symbols
<tr>
<td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/blackandwhite.ini"><code>:/JKQTPlotter/styles/blackandwhite.ini</code></a>
<td>\image html blackandwhite.ini.png
<td>\image html blackandwhite.ini.symbols.png
<tr>
<td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/blueprint.ini"><code>:/JKQTPlotter/styles/blueprint.ini</code></a>
<td>\image html blueprint.ini.png
<td>\image html blueprint.ini.symbols.png
<tr>
<td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/dark.ini"><code>:/JKQTPlotter/styles/dark.ini</code></a>
<td>\image html dark.ini.png
<td>\image html dark.ini.symbols.png
<tr>
<td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/default.ini"><code>:/JKQTPlotter/styles/default.ini</code></a>
<td>\image html default.ini.png
<td>\image html default.ini.symbols.png
<tr>
<td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/legacy_default_style.ini"><code>:/JKQTPlotter/styles/legacy_default_style.ini</code></a>
<td>\image html legacy_default_style.ini.png
<td>\image html legacy_default_style.ini.symbols.png
<tr>
<td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/seaborn.ini"><code>:/JKQTPlotter/styles/seaborn.ini</code></a>
<td>\image html seaborn.ini.png
<td>\image html seaborn.ini.symbols.png
<tr>
<td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/simple_arrowsaxes.ini"><code>:/JKQTPlotter/styles/simple_arrowsaxes.ini</code></a>
<td>\image html simple_arrowsaxes.ini.png
<td>\image html simple_arrowsaxes.ini.symbols.png
<tr>
<td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/simple_axesoffset.ini"><code>:/JKQTPlotter/styles/simple_axesoffset.ini</code></a>
<td>\image html simple_axesoffset.ini.png
<td>\image html simple_axesoffset.ini.symbols.png
<tr>
<td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/simple_axesoffset_plotbox.ini"><code>:/JKQTPlotter/styles/simple_axesoffset_plotbox.ini</code></a>
<td>\image html simple_axesoffset_plotbox.ini.png
<td>\image html simple_axesoffset_plotbox.ini.symbols.png
<tr>
<td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/simple_gridandticks.ini"><code>:/JKQTPlotter/styles/simple_gridandticks.ini</code></a>
<td>\image html simple_gridandticks.ini.png
<td>\image html simple_gridandticks.ini.symbols.png
</table>

View File

@ -1,3 +0,0 @@
<table class="doxtable">
<tr><th>Style-file </th><th>Screenshot </th><th>Symbols </th></tr>
<tr><td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/blackandwhite.ini"><code>:/JKQTPlotter/styles/blackandwhite.ini</code></a></td><td><div class="image"><img src="blackandwhite.ini.png" alt=""/></div></td><td><div class="image"><img src="blackandwhite.ini.symbols.png" alt=""/></div></td></tr> <tr><td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/blueprint.ini"><code>:/JKQTPlotter/styles/blueprint.ini</code></a></td><td><div class="image"><img src="blueprint.ini.png" alt=""/></div></td><td><div class="image"><img src="blueprint.ini.symbols.png" alt=""/></div></td></tr> <tr><td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/dark.ini"><code>:/JKQTPlotter/styles/dark.ini</code></a></td><td><div class="image"><img src="dark.ini.png" alt=""/></div></td><td><div class="image"><img src="dark.ini.symbols.png" alt=""/></div></td></tr> <tr><td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/default.ini"><code>:/JKQTPlotter/styles/default.ini</code></a></td><td><div class="image"><img src="default.ini.png" alt=""/></div></td><td><div class="image"><img src="default.ini.symbols.png" alt=""/></div></td></tr> <tr><td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/legacy_default_style.ini"><code>:/JKQTPlotter/styles/legacy_default_style.ini</code></a></td><td><div class="image"><img src="legacy_default_style.ini.png" alt=""/></div></td><td><div class="image"><img src="legacy_default_style.ini.symbols.png" alt=""/></div></td></tr> <tr><td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/seaborn.ini"><code>:/JKQTPlotter/styles/seaborn.ini</code></a></td><td><div class="image"><img src="seaborn.ini.png" alt=""/></div></td><td><div class="image"><img src="seaborn.ini.symbols.png" alt=""/></div></td></tr> <tr><td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/simple_arrowsaxes.ini"><code>:/JKQTPlotter/styles/simple_arrowsaxes.ini</code></a></td><td><div class="image"><img src="simple_arrowsaxes.ini.png" alt=""/></div></td><td><div class="image"><img src="simple_arrowsaxes.ini.symbols.png" alt=""/></div></td></tr> <tr><td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/simple_axesoffset.ini"><code>:/JKQTPlotter/styles/simple_axesoffset.ini</code></a></td><td><div class="image"><img src="simple_axesoffset.ini.png" alt=""/></div></td><td><div class="image"><img src="simple_axesoffset.ini.symbols.png" alt=""/></div></td></tr> <tr><td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/simple_axesoffset_plotbox.ini"><code>:/JKQTPlotter/styles/simple_axesoffset_plotbox.ini</code></a></td><td><div class="image"><img src="simple_axesoffset_plotbox.ini.png" alt=""/></div></td><td><div class="image"><img src="simple_axesoffset_plotbox.ini.symbols.png" alt=""/></div></td></tr> <tr><td><a href="https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/simple_gridandticks.ini"><code>:/JKQTPlotter/styles/simple_gridandticks.ini</code></a></td><td><div class="image"><img src="simple_gridandticks.ini.png" alt=""/></div></td><td><div class="image"><img src="simple_gridandticks.ini.symbols.png" alt=""/></div></td></tr></table>

View File

@ -608,10 +608,10 @@ void plotStyleSymbols(JKQTBasePlotter& plotExtra, const JKQTBasePlotter& plot) {
void doListStyles(const QDir& outputDir, const QDir& docoutputDir, int iconsize, QColor backgroundColor) {
QDir dir(":/JKQTPlotter/styles/", "*.ini");
QFile fhtml(docoutputDir.absoluteFilePath("styles.html"));
QFile fhtml(docoutputDir.absoluteFilePath("styles.dox"));
fhtml.open(QFile::WriteOnly|QFile::Text);
QTextStream shtml(&fhtml);
shtml<<"<table class=\"doxtable\">\n <tr><th>Style-file </th><th>Screenshot </th><th>Symbols </th></tr>\n";
shtml<<"<table>\n <tr>\n <th>Style-file\n <th>Screenshot\n <th>Symbols\n";
for (auto& f: dir.entryList()) {
qDebug()<<"plotting example for style "<<f;
@ -626,11 +626,10 @@ void doListStyles(const QDir& outputDir, const QDir& docoutputDir, int iconsize,
plotStyleSymbols(plotExtra, plot);
plotExtra.grabPixelImage(QSize(plotExtra.getWidth(),plotExtra.getHeight()), false).copy(0,0,plotExtra.getWidth(),plotExtra.getHeight()).save(outputDir.absoluteFilePath(f+".symbols.png"), "png");
shtml<<" <tr>"
<<"<td><a href=\"https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/"<<f<<"\"><code>"<<dir.absoluteFilePath(f)<<"</code></a></td>"
<<"<td><div class=\"image\"><img src=\""<<f<<".png\" alt=\"\"/></div></td>"
<<"<td><div class=\"image\"><img src=\""<<f<<".symbols.png\" alt=\"\"/></div></td>"
<<"</tr>";
shtml<<" <tr>\n"
<<" <td><a href=\"https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/"<<f<<"\"><code>"<<dir.absoluteFilePath(f)<<"</code></a>\n"
<<" <td>\\image html "<<f<<".png\n"
<<" <td>\\image html "<<f<<".symbols.png\n";
}
shtml<<"</table>";
}