improve documentation
diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml
index 25fc853..cddd438 100644
--- a/.github/workflows/documentation.yml
+++ b/.github/workflows/documentation.yml
@@ -7,7 +7,7 @@
jobs:
build-deploy:
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 1e26a59..9da5c41 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -38,7 +38,7 @@
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 2.0.0
+PROJECT_NUMBER = 2.1.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -51,7 +51,7 @@
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
# the logo to the output directory.
-PROJECT_LOGO = "./logo.jpg"
+PROJECT_LOGO = "./logo-doxygen.jpg"
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
@@ -792,7 +792,8 @@
# Note: If this tag is empty the current directory is searched.
INPUT = ../include/inja \
- ../README.md
+ ../README.md \
+ support.md
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -908,7 +909,7 @@
# that contain example code fragments that are included (see the \include
# command).
-EXAMPLE_PATH =
+EXAMPLE_PATH = ./examples
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -922,7 +923,7 @@
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.
-EXAMPLE_RECURSIVE = NO
+EXAMPLE_RECURSIVE = YES
# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
@@ -1657,7 +1658,7 @@
# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
# The default value is: YES.
-GENERATE_LATEX = YES
+GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
diff --git a/doc/logo-doxygen.jpg b/doc/logo-doxygen.jpg
new file mode 100644
index 0000000..e318fbe
--- /dev/null
+++ b/doc/logo-doxygen.jpg
Binary files differ
diff --git a/doc/support.md b/doc/support.md
new file mode 100644
index 0000000..9d4101d
--- /dev/null
+++ b/doc/support.md
@@ -0,0 +1,3 @@
+@page support_page Support
+
+If you have questions or issues regarding the use of doxygen, please use the Github [Issue Tracker](https://github.com/pantor/inja/issues). You can always contribute by helping with programming, testing and filing bug reports, and improving documentation!
\ No newline at end of file
diff --git a/include/inja/config.hpp b/include/inja/config.hpp
index d7f16b9..bf943f1 100644
--- a/include/inja/config.hpp
+++ b/include/inja/config.hpp
@@ -14,6 +14,9 @@
Pointer
};
+/*!
+ * \brief Class for lexer configuration.
+ */
struct LexerConfig {
std::string statement_open {"{%"};
std::string statement_close {"%}"};
@@ -44,6 +47,9 @@
}
};
+/*!
+ * \brief Class for parser configuration.
+ */
struct ParserConfig {
ElementNotation notation {ElementNotation::Dot};
};
diff --git a/include/inja/environment.hpp b/include/inja/environment.hpp
index b794e36..378a916 100644
--- a/include/inja/environment.hpp
+++ b/include/inja/environment.hpp
@@ -22,6 +22,9 @@
using namespace nlohmann;
+/*!
+ * \brief Class for changing the configuration.
+ */
class Environment {
class Impl {
public:
diff --git a/include/inja/function_storage.hpp b/include/inja/function_storage.hpp
index 9fdddab..7a6f3db 100644
--- a/include/inja/function_storage.hpp
+++ b/include/inja/function_storage.hpp
@@ -12,6 +12,9 @@
using Arguments = std::vector<const json*>;
using CallbackFunction = std::function<json(Arguments& args)>;
+/*!
+ * \brief Class for builtin functions and user-defined callbacks.
+ */
class FunctionStorage {
public:
void add_builtin(nonstd::string_view name, unsigned int num_args, Bytecode::Op op) {
diff --git a/include/inja/lexer.hpp b/include/inja/lexer.hpp
index ebad0f7..28d5b89 100644
--- a/include/inja/lexer.hpp
+++ b/include/inja/lexer.hpp
@@ -11,6 +11,9 @@
namespace inja {
+/*!
+ * \brief Class for lexing an inja Template.
+ */
class Lexer {
enum class State {
Text,
diff --git a/include/inja/parser.hpp b/include/inja/parser.hpp
index 9992ea4..cc80535 100644
--- a/include/inja/parser.hpp
+++ b/include/inja/parser.hpp
@@ -58,6 +58,9 @@
FunctionStorage functions;
};
+/*!
+ * \brief Class for parsing an inja Template.
+ */
class Parser {
public:
explicit Parser(const ParserConfig& parser_config, const LexerConfig& lexer_config, TemplateStorage& included_templates): m_config(parser_config), m_lexer(lexer_config), m_included_templates(included_templates), m_static(ParserStatic::get_instance()) { }
diff --git a/include/inja/renderer.hpp b/include/inja/renderer.hpp
index 2266c9a..4cd530d 100644
--- a/include/inja/renderer.hpp
+++ b/include/inja/renderer.hpp
@@ -24,6 +24,9 @@
return nonstd::string_view(out.data(), out.size());
}
+/*!
+ * \brief Class for rendering a Template with data.
+ */
class Renderer {
std::vector<const json*>& get_args(const Bytecode& bc) {
m_tmp_args.clear();
diff --git a/include/inja/template.hpp b/include/inja/template.hpp
index 2e171e1..b3c77db 100644
--- a/include/inja/template.hpp
+++ b/include/inja/template.hpp
@@ -9,6 +9,9 @@
namespace inja {
+/*!
+ * \brief The main inja Template.
+ */
struct Template {
std::vector<Bytecode> bytecodes;
std::string content;
diff --git a/include/inja/token.hpp b/include/inja/token.hpp
index f979e24..5755956 100644
--- a/include/inja/token.hpp
+++ b/include/inja/token.hpp
@@ -6,6 +6,9 @@
namespace inja {
+/*!
+ * \brief Helper-class for the inja Parser.
+ */
struct Token {
enum class Kind {
Text,