readm3 can now change the file it is showing you, and it understands the markdown
dialects people actually write in.
Edit mode
Press e to put a caret in the file, esc to see it rendered again. Both modes read
one buffer, so the preview has already re-rendered by the time you get back to it.
There is no second preview to keep in step.
ctrl+s saves. Quitting or switching files with unsaved work asks first. enter
continues the list you are in: the same bullet, the next number, an unchecked box for
a task, and it ends the list when you press it on an empty item. --read-only turns
all of it off for pager use. Help is ctrl+g while editing, because ? is a
character in there.
There is no selection, and so no cut and paste. This is for fixing a typo and adding
a paragraph, not for replacing your editor.
Flavors
Parsing moved to marked, which is CommonMark plus GFM and carries no dependencies of
its own. readm3 has two dependencies in total. That alone fixed reference links,
nested and loose lists, bare URL autolinks and hard line breaks, all of which the old
hand-rolled parser got wrong.
--flavor picks which dialect's extras are live:
| flavor | adds |
|---|---|
commonmark |
nothing beyond CommonMark |
github (default) |
GFM, alerts, footnotes, :emoji: |
reddit |
GFM, spoilers, superscript, r/ and u/ links |
all |
both at once |
It is a switch rather than everything at once because the dialects disagree. 2^32 is
a number in a README and a superscript on Reddit. >!spoiler!< is a blockquote in
every dialect except Reddit.
Alerts get a gutter colored by severity. Footnotes are numbered in order of first
reference and collected under a rule at the foot. Superscript uses real Unicode glyphs
when every character has one, so mc^2 becomes mc², and keeps its caret when they do
not, because there is no superscript q. Spoilers are blocked out with solid blocks
rather than colored out, so they stay hidden in a pipe and under --color never.
Press s to reveal them, or pass --spoilers to --print.
Install
bun add -g @profullstack/readm3
144 tests, green on Node 22, Node 24 and Bun, across Linux, macOS and Windows.