ManuscriptExport.h header

#include <ew/app/ManuscriptExport.h>

Namespace ew::app

ManuscriptExportOptions struct

struct ew::app::ManuscriptExportOptions

Options controlling a manuscript compile/export.

Members

ew::core::foundation::ContentId ew::app::publishing::ManuscriptExportOptions::root

The subtree to export: the document whose branch to compile. A null id compiles the whole manuscript (every top-level document and its descendants).

QString ew::app::publishing::ManuscriptExportOptions::audience

When non-empty, only documents visible to this audience are included (see ContentObject::isVisibleTo) – so an export can be produced for a specific readership. A hidden document is skipped together with its whole subtree. Empty includes everything.

bool ew::app::publishing::ManuscriptExportOptions::includeSynopses = false

Whether to emit each document's synopsis before its body.

bool ew::app::publishing::ManuscriptExportOptions::expandEmbeds = false

When true, each visible ![[…]] block-embed marker in a body is replaced by a Markdown rendering of the embedded object (expandEmbedsToMarkdown), so a book export shows the transcluded content inline instead of a literal marker. The website generator leaves this false and expands embeds to rich HTML at page-render time (renderEmbeddedBodyHtml) instead. Runs after audience embed stripping (a hidden callout is removed, not expanded).

const ew::app::library::MountedLibraries* ew::app::publishing::ManuscriptExportOptions::libraries = nullptr

Optional mounted libraries; when set (and expandEmbeds is true) an embed naming a shared-library object is resolved and expanded too. Null resolves embeds within the project only. Not owned.

ManuscriptOutlineEntry struct

struct ew::app::ManuscriptOutlineEntry

One document in the manuscript's structure, for CHOOSING what to export – the counterpart of ManuscriptSection, which is what an export emits.

Members

ew::core::foundation::ContentId ew::app::publishing::ManuscriptOutlineEntry::id

The document's id; this is what goes in ManuscriptExportOptions::root.

int ew::app::publishing::ManuscriptOutlineEntry::level = 1

Nesting depth: 1 for a top-level document, +1 per level, matching ManuscriptSection::level.

QString ew::app::publishing::ManuscriptOutlineEntry::title

The document's title.

ManuscriptSection struct

struct ew::app::ManuscriptSection

One compiled section of a manuscript: a document rendered at a heading level (1 for a top-level document, deeper for nested ones), with its title, synopsis, and body (as stored, Markdown), in reading order.

Members

int ew::app::publishing::ManuscriptSection::level = 1

The heading depth: 1 for a top-level document, +1 per level of nesting.

QString ew::app::publishing::ManuscriptSection::title

The document's title (its heading text).

QString ew::app::publishing::ManuscriptSection::synopsis

The document's synopsis (empty unless requested and set).

QString ew::app::publishing::ManuscriptSection::body

The document's body, as stored (Markdown).

Functions

std::vector< ManuscriptSection > ew::app::publishing::compileManuscript(const ew::core::project::Project &project, const ManuscriptExportOptions &options)

Walks the manuscript from options.root (or the whole manuscript when it is null) in reading order – depth-first, each document before its children, siblings in manuscript order – and returns a section per document. A document not visible to options.audience is skipped along with its entire subtree, so an audience export never leaks a hidden branch. Non-document objects and missing ids are ignored.

std::vector< ManuscriptOutlineEntry > ew::app::publishing::manuscriptOutline(const ew::core::project::Project &project)

Every document in the manuscript in reading order with its depth and title – the choices for "which part of the manuscript should this export cover?".

Deliberately NOT filtered by audience. This names what a user may pick, not what an export emits: hiding a branch here would make it unselectable rather than merely unexported, and the audience filter is applied afterwards by compileManuscript either way. Cycle-safe on the same terms as compileManuscript (a malformed parent-cycle yields each document at most once).

QString ew::app::publishing::manuscriptToMarkdown(const std::vector< ManuscriptSection > &sections)

Renders compiled sections as one Markdown manuscript: each section's title as an ATX heading at its level (clamped to 1–6), its synopsis (when present) as a blockquote, then its body, separated by blank lines. An empty section list yields an empty string.