diff --git a/.gitignore b/.gitignore index 3b94161ec7..9ec2a23d14 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ shaders/ABuffer/constants.hglsl LuaScripting.txt Properties.txt log.html +Documentation.html data/scene/rosetta/67P/obj/67P_rotated_5_130.obj data/spice/NewHorizonsKernels/ data/scene/newhorizons/pluto/pluto/textures/ diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index 7d32f09a4a..2489730b41 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -106,37 +106,44 @@ std::string generateJsonDocumentation(const Documentation& d) { std::string generateHtmlDocumentation(const Documentation& d) { std::stringstream html; - html << "\n" - << "\t\n\n" - << "\t\n" - << "\t\t\n" - << "\t\t\t\n" - << "\t\t\t\n" - << "\t\t\t\n" - << "\t\t\t\n" - << "\t\t\t\n" - << "\t\t\n" - << "\t\n" - << "\t\n"; - + + html << "\t\n" + << "\t\t\n"; + for (const auto& p : d.entries) { html << "\t\n" + << "\t\t\n" << "\t\t\n" << "\t\t\n" << "\t\t\n"; TableVerifier* tv = dynamic_cast(p.verifier.get()); if (tv) { // We have a TableVerifier, so we need to recurse - html << "\t\t\n"; + html << "\n"; } else { html << "\t\t\n"; } + html << "\t\t\n" + << "\t\n"; } - html << "\t\n" - << "
" << d.name << "
KeyOptionalTypeRestrictionsDocumentation
" << d.name << "
" << p.key << "" << (p.optional ? "true" : "false") << "" << p.verifier->type() << "" << generateHtmlDocumentation(tv->doc) << "\n" + << "\t\n" + << "\t\t\n" + << "\t\t\t\n" + << "\t\t\t\n" + << "\t\t\t\n" + << "\t\t\t\n" + << "\t\t\t\n" + << "\t\t\t\n" + << "\t\t\n" + << "\t\n" + << "\t\n" + << generateHtmlDocumentation(tv->doc) + << "\t\n" + << "
KeyOptionalTypeRestrictionsDocumentation
\n" + << "
" << p.verifier->documentation() << "" << p.documentation << "
\n"; return html.str(); } @@ -177,10 +184,32 @@ void DocumentationEngine::writeDocumentation(const std::string& f, const std::st << "\t\n" << "\n"; + + html << "\n" + << "\t\n\n" + << "\t\n" + << "\t\t\n" + << "\t\t\t\n" + << "\t\t\n" + << "\t\t\n" + << "\t\t\t\n" + << "\t\t\t\n" + << "\t\t\t\n" + << "\t\t\t\n" + << "\t\t\t\n" + << "\t\t\n" + << "\t\n" + << "\t\n"; + for (const Documentation& d : _documentations) { html << generateHtmlDocumentation(d); + + html << "\t\n"; } + html << "\t\n" + << "
Documentation
Name
KeyOptionalTypeRestrictionsDocumentation

\n"; + html << "\n"; html << "\n";