diff --git a/include/openspace/documentation/documentationengine.h b/include/openspace/documentation/documentationengine.h index 980af4ee3c..71554ac004 100644 --- a/include/openspace/documentation/documentationengine.h +++ b/include/openspace/documentation/documentationengine.h @@ -86,8 +86,6 @@ public: */ static DocumentationEngine& ref(); - std::string generateJson() const; - void writeDocumentation() const; nlohmann::json generateScriptEngineJson() const; diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index e76b021d24..a93aecf0ab 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -115,69 +115,6 @@ DocumentationEngine& DocumentationEngine::ref() { return *_instance; } -nlohmann::json generateJsonDocumentation(const Documentation& d) { - nlohmann::json json; - - json["name"] = d.name; - json["id"] = d.id; - json["description"] = d.description; - json["properties"] = nlohmann::json::array(); - - for (const DocumentationEntry& p : d.entries) { - nlohmann::json entry; - entry["key"] = p.key; - entry["optional"] = p.optional ? true : false; - entry["type"] = p.verifier->type(); - entry["documentation"] = p.documentation; - - TableVerifier* tv = dynamic_cast(p.verifier.get()); - ReferencingVerifier* rv = dynamic_cast(p.verifier.get()); - - if (rv) { - const std::vector& documentations = DocEng.documentations(); - auto it = std::find_if( - documentations.begin(), - documentations.end(), - [rv](const Documentation& doc) { return doc.id == rv->identifier; } - ); - - if (it == documentations.end()) { - entry["reference"]["found"] = false; - } - else { - nlohmann::json reference; - reference["found"] = true; - reference["name"] = it->name; - reference["identifier"] = rv->identifier; - - entry["reference"] = reference; - } - } - else if (tv) { - Documentation doc = { .entries = tv->documentations }; - nlohmann::json restrictions = generateJsonDocumentation(doc); - // We have a TableVerifier, so we need to recurse - entry["restrictions"] = restrictions; - } - else { - entry["description"] = p.verifier->documentation(); - } - json["properties"].push_back(entry); - } - - return json; -} - -std::string DocumentationEngine::generateJson() const { - nlohmann::json json; - - for (const Documentation& d : _documentations) { - json["data"].push_back(generateJsonDocumentation(d)); - } - - return json.dump(); -} - nlohmann::json DocumentationEngine::generateScriptEngineJson() const { ZoneScoped;