IF Commons GitHub

emit/asciidoc

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-docs FR-008

A page as AsciiDoc (docs 0001-docs FR-008): the writer of the book presentation. Like the HTML and the Markdown writers it matches every case of a block and an inline with a switch that ends in absurd, so that a case added to the page model and left out here does not compile. What it writes is the text of a chapter of a book of erga (kind: book): sections with anchors, source blocks, admonitions and tables, with no attribute, no include and no macro that needs an extension, so that AsciidoctorJ makes the PDF, the EPUB and the web edition of it as it is.

Source: commons/docs/src/emit/asciidoc.ts

3 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

AdocScopeinterface
interface AdocScope

What a page of a volume needs to know to write a link: which pages are in the volume, the anchors they hold, and where the rest of the site is.

MemberTypeWhat it is
pagesReadonlyMap<string, string>The anchor of a page that is in the volume, by its path.
anchorsReadonlySet<string>Every anchor the volume writes.
sitestring | undefinedThe address of the site, ending in /, where a link to a page that is not in the volume goes; none: the link is its text.

Imported by 9 tests of the run (9 passed, 0 failed): the library's results

inlinesAdocfunction
function inlinesAdoc(xs: readonly Inline[], scope: AdocScope): string

Inlines as AsciiDoc.

Imported by 9 tests of the run (9 passed, 0 failed): the library's results

pageAdocfunction
function pageAdoc(page: Page, scope: AdocScope, at: Omit<AdocPage, "seen">): string[]

A page as the text of a chapter: its anchor, its title at a marker of level =, its description, its badges and its blocks.

ParameterWhat it is
pagethe page
scopethe volume it is in
atits anchor and the length of its title's marker

Imported by 9 tests of the run (9 passed, 0 failed): the library's results

pageAnchorconstno test imports it
const pageAnchor: (volume: string, path: string) => string

The anchor of a page in a volume: its path as words.

Titles, headings, exports, tables, columns and requirements. Esc closes.