IF Commons GitHub

presentation

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

The presentations of the pages (docs 0001-docs FR-007): the pages are one model, and a presentation is a way of writing them as files. There are four. The web is the static site (a page of HTML for each page, the stylesheet, the script, the search index); the markdown is the Markdown twin of each page and llms.txt for a program; the data is the JSON the lenses add; the book is the AsciiDoc of the volumes of a book (docs 0001-docs FR-008). A presentation makes its files in memory, as a list, so that the same list is written (build), or compared with what is on disk (build --check), and the same pages give the same bytes in each.

Source: commons/docs/src/presentation.ts

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

Madeinterfaceno test imports it
interface Made

What a presentation makes: its files, and what it found while making them.

MemberTypeWhat it is
filesreadonly OutFile[]The files, by path.
foundreadonly Finding[]What was found.
OutFiletypeno test imports it
type OutFile = { readonly path: string; readonly text: string } | { readonly path: string; readonly from: string };

A file a presentation makes: its path from the output folder, and its text or the file it is copied from.

PRESENTATIONSconst
const PRESENTATIONS: readonly Presentation[]

The presentations there are.

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

Presentationinterfaceno test imports it
interface Presentation

A presentation: a name, and the files it makes of a built site.

MemberTypeWhat it is
id"book" | "data" | "markdown" | "web"Its name.
whatstringWhat it is, in a few words.
make(config: Config, built: Built) => MadeIts files.
presentationFilesfunction
function presentationFiles(config: Config, built: Built, ids: readonly ("book" | "data" | "markdown" | "web")[]): Made

The files of a set of presentations, in the order of the presentations and then of their paths; a path two presentations make is made by the first.

ParameterWhat it is
configthe configuration
builtthe site
idsthe presentations

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

staleFilesfunction
function staleFiles(out: string, files: readonly OutFile[]): Promise<string[]>

The files whose text is not what is in a folder: missing, or different.

ParameterWhat it is
outthe folder
filesthe files that should be there

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

writeFilesfunction
function writeFiles(out: string, files: readonly OutFile[]): Promise<void>

Files written into a folder.

ParameterWhat it is
outthe folder
filesthe files

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

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