This commit is contained in:
Ylva Selling
2023-04-12 18:27:35 -04:00
parent e998df55b0
commit 150c1457c0
2 changed files with 10 additions and 10 deletions
+7 -8
View File
@@ -1070,16 +1070,15 @@ void OpenSpaceEngine::writeDocumentation() {
sceneGraph["Name"] = "Scene";
sceneGraph["Data"] = scene.get();
nlohmann::json documentation;
documentation["documentation"].push_back(sceneGraph);
documentation["documentation"].push_back(sceneProperties);
documentation["documentation"].push_back(keybindings);
documentation["documentation"].push_back(license);
documentation["documentation"].push_back(scripting);
documentation["documentation"].push_back(factory);
nlohmann::json documentation = {
sceneGraph, sceneProperties, keybindings, license, scripting, factory
};
nlohmann::json result;
result["documentation"] = documentation;
std::ofstream out(absPath("${DOCUMENTATION}/documentationData.js"));
out << "var data = " << documentation.dump();
out << "var data = " << result.dump();
out.close();
}
+3 -2
View File
@@ -99,16 +99,17 @@ namespace {
using namespace openspace::scripting;
nlohmann::json function;
function["Name"] = f.name;
function["Arguments"] = nlohmann::json::array();
nlohmann::json arguments = nlohmann::json::array();
for (const LuaLibrary::Function::Argument& arg : f.arguments) {
nlohmann::json argument;
argument["Name"] = arg.name;
argument["Type"] = arg.type;
argument["Default Value"] = arg.defaultValue.value_or("");
function["Arguments"].push_back(argument);
arguments.push_back(argument);
}
function["Arguments"] = arguments;
function["Return Type"] = f.returnType;
function["Help"] = f.helpText;