diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index 5f396d68f9..64fbb91be7 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -566,6 +566,7 @@ void ScriptEngine::writeDocumentation(const std::string& filename, const std::st file.exceptions(~std::ofstream::goodbit); file.open(filename); +#ifdef JSON // Create JSON std::stringstream json; json << "["; @@ -589,7 +590,61 @@ void ScriptEngine::writeDocumentation(const std::string& filename, const std::st std::string jsonText = json.str(); +#else + std::stringstream html; + html << "\n" + << "\t\n" + << "\t\tScript Log\n" + << "\t\n" + << "\n" + << "\n" + << "\t\n\n" + << "\t\n" + << "\t\t\n" + << "\t\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\n" + << "\t\n" + << "\t\n"; + + + + for (const LuaLibrary& l : _registeredLibraries) { + html << "\t\n"; + + if (l.name.empty()) { + html << "\t\t\n"; + } + else { + html << "\t\t\n"; + } + html << "\t\t\n" + << "\t\"; + + for (const LuaLibrary::Function& f : l.functions) { + html << "\t\n" + << "\t\t\n" + << "\t\t\n" + << "\t\t\n" + << "\t\t\n" + << "\t\n"; + } + + html << "\t\n"; + } + + html << "\t\n" + << "
Script Log
LibraryFunctions
NameArgumentsHelp
openspaceopenspace." << l.name << "
" << f.name << "" << f.argumentText << "" << f.helpText << "
\n" + << ""; + + file << html.str(); +#endif } else { throw ghoul::RuntimeError("Undefined type '" + type + "' for Lua documentation");