Skip to content

MarkdownGenerator

class MarkdownGenerator

Markdown generator.

Variables

Name Description
files Set of files generated during the last call to generate().

Functions

Name Description
generate Generate documentation.
clean Clean up after generation, removing files from old runs.
frontmatter Produce the YAML frontmatter for an entity.
title Produce title for an entity.
brief Produce brief description for an entity.
line Reduce to a single line.
indent Indent lines.
stringify Sanitize for a string, escaping double quotes and backslashes.
htmlize Sanitize for HTML, replacing special characters with entities.
sanitize Sanitize for a file name or internal anchor.
view Convert a list of entities to a list of pointers to entities, optionally sorting by name.

Variable Details

files

std::unordered_set<std::filesystem::path> files

Set of files generated during the last call to generate().

Function Details

brief

static std::string brief(const Entity& entity)

Produce brief description for an entity.

clean

void clean(const std::filesystem::path& output)

Clean up after generation, removing files from old runs. Traverses the output directory, removing any Markdown files with 'generator: doxide' in their YAML frontmatter that were not generated by previous calls of generate().

output
Output directory.

frontmatter

static std::string frontmatter(const Entity& entity)

Produce the YAML frontmatter for an entity.

generate

void generate(const std::filesystem::path& dir, const Entity& node)

Generate documentation.

output
Output directory.
node
Root node.

htmlize

static std::string htmlize(const std::string& str)

Sanitize for HTML, replacing special characters with entities. Also replaces some characters that might trigger Markdown formatting.

indent

static std::string indent(const std::string& str)

Indent lines.

line

static std::string line(const std::string& str)

Reduce to a single line.

sanitize

static std::string sanitize(const std::string& str)

Sanitize for a file name or internal anchor.

stringify

static std::string stringify(const std::string& str)

Sanitize for a string, escaping double quotes and backslashes.

title

static std::string title(const Entity& entity)

Produce title for an entity.

view

static std::list<const Entity*> view(const std::list<Entity>& entities, const bool sort)

Convert a list of entities to a list of pointers to entities, optionally sorting by name.

entities
List of entities.
sort
Sort by name?