Repository navigation
flowdown 0.9.0
Minor Changes
-
1bb649e: Formulas and diagrams are built in, with no dependency.
- Math is MathML.
@localix-ai/flowdown/mathwrites$…$,$$…$$and```mathas
MathML the browser lays out itself (@localix-ai/math, 11 KB), nine times faster than KaTeX on the
formulas agents write. Import@localix-ai/flowdown/math.css(the math font) in place of KaTeX's
stylesheet, and drop thekatexdependency: it is no longer a peer. A formula is now
<span class="fd-math">(withfd-math-displayfor a display formula) around a<math>; a page
that styled.katexstyles.fd-math. A formula cut off or with an unknown command is drawn as far
as it goes, never an error. - Diagrams without Mermaid.
<Markdown mermaid>(true) draws```mermaidfences with
@localix-ai/diagram: every kind Mermaid has, as modern SVG in the page's colours, fetched with the
first diagram, over 20 times faster than Mermaid and 56 KB against its 1.6 MB. A loader
(() => import('mermaid')) still draws with Mermaid.builtInDiagramsis exported from
@localix-ai/flowdown/mermaidfor a frame of your own. - The terminal reads formulas with the same parser as a page: every environment, typefaces as
Unicode's math letters, braces with their labels,\xrightarrow.
- Math is MathML.
Patch Changes
- A code block still being written now draws, at every character, what one parse of it draws: its
language's escapes and character references are resolved as they are once it closes
(```foo\+barnamesfoo+bar), and a block of one empty line keeps that line. Every example of
CommonMark's and GitHub's specifications is now fed to the renderer a character at a time, and
every frame, streaming and finished, must be what one parse of that frame draws. - A token costs less of the main thread: a reply is compared with the last one once, not four
times. The document checks it and hands what it checked down, so the scan for an open fence,
the splitter, a growing fence and its colourer, and a long list or quote compare only what is
new. The reply is no longer scanned for\rthree times a token, a fence still being written is
no longer searched whole for a form's[!, and a block with no<before a letter is no longer
parsed only to learn that it has no HTML. A long fence, the dialect's forms and a long report
stream in less main-thread time. Nothing drawn changes: a page that is edited, cut back or
regenerated while it streams draws, at every step, what a new page draws. @localix-ai/flowdown/documentexportsgrownOf(block): what the document checked of its last
block against the last update's. A renderer of its own passes it togrowingFenceasgrown.