CitationFormatter.h header
#include <ew/app/CitationFormatter.h>
Namespace ew::app
Enumerations
enum class CitationStyle { Apa, Mla, Chicago }
A citation style: the rule set governing how a source is written in text and in the reference list. Three common styles are supported; APA and Chicago are author-date, MLA is author-page.
Functions
QString ew::app::citationStyleLabel(CitationStyle style)
A human-readable label for style, for pickers and menus (e.g. "APA").
QString ew::app::formatBibliography(const std::vector< const ew::core::Source * > &sources, CitationStyle style)
A reference list for sources in style: one formatted entry per source, each on its own line, sorted by first-author family name then year. Null pointers are skipped.
QString ew::app::formatBibliographyEntry(const ew::core::Source &source, CitationStyle style)
The full reference-list (bibliography) entry for source in style, as plain text: author list, year, title, and the container/publisher/volume/pages/URL details appropriate to the source's kind. Titles are rendered in plain text (visual italicization is a presentation-layer concern); empty fields are omitted without leaving dangling punctuation.
QString ew::app::formatInTextCitation(const ew::core::Source &source, CitationStyle style, const QString &locator={})
The in-text citation for source in style, e.g. APA "(Tolkien, 1947)", MLA "(Tolkien 25)", Chicago "(Tolkien 1947, 25)". locator is an optional page or section reference placed in the citation (a page number for MLA/Chicago, "p. N" for APA). Two authors are joined per style and three or more collapse to "First et al.". Falls back to the source title when it has no author.