MD::Document Class

class MD::Document

Document. More...

Header: #include <md4qt/doc.h>
CMake: find_package(md4qt REQUIRED COMPONENTS md4qt)
target_link_libraries(mytarget PRIVATE md4qt::md4qt)
Inherits: MD::Block

Public Types

Public Functions

Document()
const MD::Document::AuxLabelsMap &auxLabelsMap() const
const MD::Document::Footnotes &footnotesMap() const
qsizetype getAuxLabelCounter(const QString &label, const QString &path)
void incrementAuxLabelCounter(const QString &label, const QString &path)
void insertAuxLabel(const QString &label, const QString &path)
void insertFootnote(const QString &id, MD::Document::FootnoteSharedPointer fn)
void insertLabeledHeading(const QString &label, MD::Document::HeadingSharedPointer h)
void insertLabeledLink(const QString &label, MD::Document::LinkSharedPointer lnk)
const MD::Document::LabeledHeadings &labeledHeadings() const
const MD::Document::LabeledLinks &labeledLinks() const
void setAuxLabelsMap(const MD::Document::AuxLabelsMap &m)
void setFootnotesMap(const MD::Document::Footnotes &f)
void setLabeledHeadings(const MD::Document::LabeledHeadings &h)
void setLabeledLinks(const MD::Document::LabeledLinks &l)

Reimplemented Public Functions

virtual QSharedPointer<MD::Item> clone(MD::Document *doc = nullptr) const override
virtual MD::ItemType type() const override

Detailed Description

Markdown document.

Member Type Documentation

[alias] Document::AuxLabelsMap

Type of an auxiliary map of labels for headings. Usually it's not needed for user but serves for resolving of conflict of the headings with the same content.

[alias] Document::FootnoteSharedPointer

Type of a smart pointer to footnote.

[alias] Document::Footnotes

Type of a map of footnotes.

[alias] Document::HeadingSharedPointer

Type of a smart pointer to heading.

[alias] Document::LabeledHeadings

Type of a map of headings.

Type of a map of shortcut links.

[alias] Document::LinkSharedPointer

Type of a smart pointer to link.

Member Function Documentation

Document::Document()

Default constructor.

const MD::Document::AuxLabelsMap &Document::auxLabelsMap() const

Returns auxiliary map for resolving headings' ids labels.

See also setAuxLabelsMap().

[override virtual] QSharedPointer<MD::Item> Document::clone(MD::Document *doc = nullptr) const

Reimplements: Item::clone(MD::Document *doc) const.

Clone this document.

doc Parent of new item.

const MD::Document::Footnotes &Document::footnotesMap() const

Returns map of footnotes.

See also setFootnotesMap().

qsizetype Document::getAuxLabelCounter(const QString &label, const QString &path)

Returns auxiliary label current counter.

label Label.

path Path.

void Document::incrementAuxLabelCounter(const QString &label, const QString &path)

Increment auxiliary label counter.

label Label.

path Path.

void Document::insertAuxLabel(const QString &label, const QString &path)

Insert auxiliary label.

label Label.

path Path.

void Document::insertFootnote(const QString &id, MD::Document::FootnoteSharedPointer fn)

Insert footnote with the give ID.

id ID.

fn Footnote.

void Document::insertLabeledHeading(const QString &label, MD::Document::HeadingSharedPointer h)

Insert heading with the given label.

label Label.

h Heading.

Insert shortcut link with the given label.

label Label.

lnk Link.

const MD::Document::LabeledHeadings &Document::labeledHeadings() const

Returns map of headings.

See also setLabeledHeadings().

Returns map of shortcut links.

See also setLabeledLinks().

void Document::setAuxLabelsMap(const MD::Document::AuxLabelsMap &m)

Set auxiliary map for resolving headings' ids labels.

m Auxiliary map for resolving headings' ids labels.

See also auxLabelsMap().

void Document::setFootnotesMap(const MD::Document::Footnotes &f)

Set map of footnotes.

f Map of footnotes.

See also footnotesMap().

void Document::setLabeledHeadings(const MD::Document::LabeledHeadings &h)

Set map of headings.

h Labeled headings.

See also labeledHeadings().

Set map of shortcut links.

l Map of labeled links.

See also labeledLinks().

[override virtual] MD::ItemType Document::type() const

Reimplements: Item::type() const.

Returns type of the item.