Skip to content

Commit

Permalink
improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pantor committed Sep 8, 2019
1 parent d25937a commit 466caea
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build-deploy:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

Expand Down
13 changes: 7 additions & 6 deletions doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Inja"
# 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
Expand All @@ -51,7 +51,7 @@ PROJECT_BRIEF = "A Template Engine for Modern C++"
# 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
Expand Down Expand Up @@ -792,7 +792,8 @@ WARN_LOGFILE =
# 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
Expand Down Expand Up @@ -908,7 +909,7 @@ EXCLUDE_SYMBOLS = stdinja
# 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
Expand All @@ -922,7 +923,7 @@ EXAMPLE_PATTERNS = *
# 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
Expand Down Expand Up @@ -1657,7 +1658,7 @@ EXTRA_SEARCH_MAPPINGS =
# 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
Expand Down
Binary file added doc/logo-doxygen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions doc/support.md
Original file line number Diff line number Diff line change
@@ -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!
6 changes: 6 additions & 0 deletions include/inja/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ enum class ElementNotation {
Pointer
};

/*!
* \brief Class for lexer configuration.
*/
struct LexerConfig {
std::string statement_open {"{%"};
std::string statement_close {"%}"};
Expand Down Expand Up @@ -44,6 +47,9 @@ struct LexerConfig {
}
};

/*!
* \brief Class for parser configuration.
*/
struct ParserConfig {
ElementNotation notation {ElementNotation::Dot};
};
Expand Down
3 changes: 3 additions & 0 deletions include/inja/environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace inja {

using namespace nlohmann;

/*!
* \brief Class for changing the configuration.
*/
class Environment {
class Impl {
public:
Expand Down
3 changes: 3 additions & 0 deletions include/inja/function_storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ using namespace nlohmann;
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) {
Expand Down
3 changes: 3 additions & 0 deletions include/inja/lexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

namespace inja {

/*!
* \brief Class for lexing an inja Template.
*/
class Lexer {
enum class State {
Text,
Expand Down
3 changes: 3 additions & 0 deletions include/inja/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class ParserStatic {
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()) { }
Expand Down
3 changes: 3 additions & 0 deletions include/inja/renderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ inline nonstd::string_view convert_dot_to_json_pointer(nonstd::string_view dot,
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();
Expand Down
3 changes: 3 additions & 0 deletions include/inja/template.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

namespace inja {

/*!
* \brief The main inja Template.
*/
struct Template {
std::vector<Bytecode> bytecodes;
std::string content;
Expand Down
3 changes: 3 additions & 0 deletions include/inja/token.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace inja {

/*!
* \brief Helper-class for the inja Parser.
*/
struct Token {
enum class Kind {
Text,
Expand Down

0 comments on commit 466caea

Please sign in to comment.