Skip to content

include/Doxybook/Renderer.hpp

Namespaces

Name
inja
Doxybook2

Classes

Name
classDoxybook2::Renderer

Source code

cpp
#pragma once
#include "Config.hpp"
#include "JsonConverter.hpp"
#include "Doxygen.hpp"
#include <memory>
#include <nlohmann/json.hpp>
#include <optional>
#include <string>
#include <unordered_map>

namespace inja {
    struct Template;
    class Environment;
} // namespace inja

namespace Doxybook2 {
    class Renderer {
    public:
        explicit Renderer(const Config& config, const Doxygen& doxygen, const JsonConverter& jsonConverter, const std::optional<std::string>& templatesPath = std::nullopt);
        ~Renderer();

        void render(const std::string& name, const std::string& path, const nlohmann::json& data) const;
        std::string render(const std::string& name, const nlohmann::json& data) const;

    private:
        const Config& config;
        const Doxygen& doxygen;
        const JsonConverter& jsonConverter;

        std::unique_ptr<inja::Environment> env;
        std::unordered_map<std::string, std::unique_ptr<inja::Template>> templates;
    };
} // namespace Doxybook2

Updated on 2026-05-17 at 13:22:38 +0000

Built with VitePress