#ifndef MACRODOWN_H
#define MACRODOWN_H
#include <string>
#include <memory>
#include <vector>
#include "nodes.h"
#include "macro_engine.h"
#include "markups.h"
namespace macrodown
{
class MacroDown
{
public:
MacroDown();
/**
* Step 1: Parse the document into a syntax tree.
* @param input The Markdown source text.
* @return The root node of the syntax tree.
*/
std::unique_ptr<Node> parse(const std::string& input);
/**
* Step 2: Render the syntax tree into HTML.
* @param root The root node of the syntax tree (from Step 1).
* @return The rendered HTML string.
*/
std::string render(const Node& root);
/**
* Access the evaluator to define custom macros.
*/
Evaluator& evaluator() { return evaluator_; }
/**
* Define a prefix markup.
*/
void definePrefixMarkup(const PrefixMarkup& markup);
/**
* Define a delimited markup.
*/
void defineDelimitedMarkup(const DelimitedMarkup& markup);
private:
Evaluator evaluator_;
std::vector<PrefixMarkup> prefix_markups_;
std::vector<DelimitedMarkup> delimited_markups_;
};
} // namespace macrodown
#endif // MACRODOWN_H