Remove documentation generator

This commit is contained in:
Ylva Selling
2023-04-25 16:44:10 -04:00
parent 948fdd024b
commit d267bc0dad
17 changed files with 24 additions and 182 deletions

View File

@@ -25,8 +25,6 @@
#ifndef __OPENSPACE_CORE___DOCUMENTATIONENGINE___H__
#define __OPENSPACE_CORE___DOCUMENTATIONENGINE___H__
#include <openspace/documentation/documentationgenerator.h>
#include <openspace/documentation/documentation.h>
#include <openspace/json.h>
#include <ghoul/misc/exception.h>
@@ -38,7 +36,7 @@ namespace openspace::documentation {
* produced in the application an write them out as a documentation file for human
* consumption.
*/
class DocumentationEngine : public DocumentationGenerator {
class DocumentationEngine {
public:
/**
* This exception is thrown by the addDocumentation method if a provided Documentation

View File

@@ -1,89 +0,0 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2023 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___DOCUMENTATIONGENERATOR___H__
#define __OPENSPACE_CORE___DOCUMENTATIONGENERATOR___H__
#include <openspace/json.h>
#include <string>
#include <vector>
namespace openspace {
/*
* This abstract class is used for instances when another class has the ability to
* generate a Handlebar generated documentation file that contains valuable information
* for the user. Instances of this are the DocumentationEngine results, the list of
* Property%s generated by the Scene, or the FactoryEngine results. The documentation is
* generated through the writeDocumentation method.
*
* The concrete subclass needs to overload the generateJson class that will return the
* Json that is parsed by Handlebar to generate the webpage.
*
* A list of Handlebar templates, the variable name for the result of the generateJson
* method, and the Javascript file that contains additional logic is passed in the
* constructor.
*/
class DocumentationGenerator {
public:
static const std::string NameTag;
static const std::string DataTag;
/**
* The constructor that is used to set the member variables later used in the
* writeDocumentation method.
*
* \param name The name of the written documentation
* \param jsonName The variable name of the value generated by the generateJson
*
* \pre name must not be empty
* \pre jsonName must not be empty
* \pre javascriptFilename must not be empty
*/
DocumentationGenerator(std::string name, std::string jsonName);
/// Default constructor
virtual ~DocumentationGenerator() = default;
//getter for identifier
std::string jsonName();
/**
* This abstract method is used by concrete subclasses to provide the actual data that
* is used in the documentation written by this DocumentationGenerator class. The JSON
* string returned by this function will be stored in the variable with the
* `jsonName` as passed in the constructor.
*
* \return A JSON script that is parsed and stored in the variable passed in the
* DocumentationGenerator constructor
*/
virtual std::string generateJson() const = 0;
private:
const std::string _name;
const std::string _jsonName;
};
} // namespace openspace
#endif // __OPENSPACE_CORE___DOCUMENTATIONGENERATOR___H__

View File

@@ -25,8 +25,6 @@
#ifndef __OPENSPACE_CORE___KEYBINDINGMANAGER___H__
#define __OPENSPACE_CORE___KEYBINDINGMANAGER___H__
#include <openspace/documentation/documentationgenerator.h>
#include <openspace/util/keys.h>
namespace openspace {
@@ -38,7 +36,7 @@ namespace openspace::scripting { struct LuaLibrary; }
namespace openspace::interaction {
class KeybindingManager : public DocumentationGenerator {
class KeybindingManager {
public:
KeybindingManager();

View File

@@ -25,7 +25,6 @@
#ifndef __OPENSPACE_CORE___MISSIONMANAGER___H__
#define __OPENSPACE_CORE___MISSIONMANAGER___H__
#include <openspace/documentation/documentationgenerator.h>
#include <openspace/mission/mission.h>
#include <ghoul/misc/assert.h>

View File

@@ -25,8 +25,6 @@
#ifndef __OPENSPACE_CORE___PROPERTYOWNER___H__
#define __OPENSPACE_CORE___PROPERTYOWNER___H__
#include <openspace/documentation/documentationgenerator.h>
#include <openspace/json.h>
#include <map>
#include <string>
@@ -49,7 +47,7 @@ class Property;
* (`.`), the first name before the separator will be used as a subOwner's name and the
* search will proceed recursively.
*/
class PropertyOwner : public DocumentationGenerator {
class PropertyOwner {
public:
/// The separator that is used while accessing the properties and/or sub-owners
static constexpr char URISeparator = '.';
@@ -76,7 +74,7 @@ public:
* The destructor will remove all Propertys and PropertyOwners it owns along with
* itself.
*/
virtual ~PropertyOwner() override;
virtual ~PropertyOwner();
/**
* Sets the identifier for this PropertyOwner. If the PropertyOwner does not have an

View File

@@ -25,14 +25,12 @@
#ifndef __OPENSPACE_CORE___SCENELICENSEWRITER___H__
#define __OPENSPACE_CORE___SCENELICENSEWRITER___H__
#include <openspace/documentation/documentationgenerator.h>
#include <openspace/json.h>
#include <vector>
namespace openspace {
class SceneLicenseWriter : public DocumentationGenerator {
class SceneLicenseWriter {
public:
SceneLicenseWriter();
std::string generateJson() const;

View File

@@ -26,7 +26,6 @@
#define __OPENSPACE_CORE___SCRIPTENGINE___H__
#include <openspace/util/syncable.h>
#include <openspace/documentation/documentationgenerator.h>
#include <openspace/scripting/lualibrary.h>
#include <openspace/json.h>
#include <ghoul/lua/luastate.h>
@@ -49,7 +48,7 @@ namespace openspace::scripting {
* `openspace` namespace prefix in Lua. The same functions can be exposed to
* other Lua states by passing them to the #initializeLuaState method.
*/
class ScriptEngine : public Syncable, public DocumentationGenerator {
class ScriptEngine : public Syncable {
public:
using ScriptCallback = std::function<void(ghoul::Dictionary)>;
BooleanType(RemoteScripting);

View File

@@ -25,8 +25,6 @@
#ifndef __OPENSPACE_CORE___FACTORYMANAGER___H__
#define __OPENSPACE_CORE___FACTORYMANAGER___H__
#include <openspace/documentation/documentationgenerator.h>
#include <openspace/json.h>
#include <ghoul/misc/exception.h>
#include <ghoul/misc/templatefactory.h>
@@ -39,7 +37,7 @@ namespace openspace {
* them available through the #addFactory and #factory methods. Each
* ghoul::TemplateFactory can only be added once and can be accessed by its type.
*/
class FactoryManager : public DocumentationGenerator {
class FactoryManager {
public:
/// This exception is thrown if the ghoul::TemplateFactory could not be found in the
/// #factory method