IF Commons GitHub

logical/records/render

Written to: 1 requirement: 0 proved, 0 partly, 0 failing, 1 with no test recorded. 0003-planning-reconcile FR-013

Rendering items in a format (0037-planning FR-039): a pure function from items to text, Markdown or JSON5, that says what its format cannot hold and does not drop it silently. Markdown holds the title, the state (as a task list item), the labels, the assignees, the severity, the body and the links as text; it cannot hold the events, the actors with their principals or the carried fields, and says so.

import { renderMarkdown } from "./render.ts";
// renderMarkdown(items).text starts with "- [ ] "

Source: commons/planning/src/logical/records/render.ts

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

records.Renderedtypeno test imports it
type Rendered = { readonly text: string; readonly unexpressed: readonly { readonly field: Field; readonly reason: string }[] };

A rendering: the text, and what the format could not hold.

records.renderMarkdownfunctionno test imports it
function renderMarkdown(items: readonly Item[]): Rendered

The items as a Markdown task list: closed items checked; what Markdown cannot hold is named at the end.

records.renderJson5functionno test imports it
function renderJson5(items: readonly Item[]): Rendered

The items as JSON5, with the events of each in the order of their id and the keys in order: it holds every field.

Renderedtypeno test imports it
type Rendered = { readonly text: string; readonly unexpressed: readonly { readonly field: Field; readonly reason: string }[] };

A rendering: the text, and what the format could not hold.

renderMarkdownfunctionno test imports it
function renderMarkdown(items: readonly Item[]): Rendered

The items as a Markdown task list: closed items checked; what Markdown cannot hold is named at the end.

renderJson5functionno test imports it
function renderJson5(items: readonly Item[]): Rendered

The items as JSON5, with the events of each in the order of their id and the keys in order: it holds every field.

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