Skip to content

Add txt2tags-to-Markdown conversion - #896

Open
jendrikseipp wants to merge 13 commits into
masterfrom
claude/markdown-support-txt2tags-1zkbsr
Open

Add txt2tags-to-Markdown conversion#896
jendrikseipp wants to merge 13 commits into
masterfrom
claude/markdown-support-txt2tags-1zkbsr

Conversation

@jendrikseipp

Copy link
Copy Markdown
Owner

No description provided.

Route the live preview and the HTML, LaTeX and plain-text exporters through
markdown-it-py. Legacy txt2tags entries are converted to Markdown first, so
existing journals keep working. RedNotebook-specific constructs (#hashtags,
{text|color:...}, image widths, entry references and math) are handled by
inline plugins and pre-/post-processing.
Ship a customized copy of GtkSourceView's markdown.lang that also highlights
RedNotebook's #hashtags, {text|color:value} markup, entry references and
~~strikethrough~~, and load it instead of the txt2tags language.
The Bold/Italic/Monospace/Underline/Strikethrough buttons and the Insert menu
(lists, titles, links, images, separator and line break) now produce Markdown
instead of txt2tags markup.
The headers/options parameters are no longer needed now that conversion goes
through markdown-it-py. Whitelist the renderer methods that are dispatched
dynamically by token type so vulture does not report them as unused.
The bundled txt2tags module and its t2t.lang syntax file are no longer used
now that entries are rendered with markdown-it-py. Drop the dead t2t:* style
definitions and point the remaining comments to markdown.lang.
Skip the hidden paragraphs that markdown-it emits for tight list items and
collapse runs of blank lines, so lists no longer render with gaps.
@jendrikseipp jendrikseipp changed the title Add txt2tags-to-Markdown converter for legacy entries Add txt2tags-to-Markdown conversion Jun 13, 2026
Old journals may still contain txt2tags markup, so add highlighting contexts
for //italic//, --strikethrough--, '= heading =' titles, '[text url]' and
'[""image"".png]' links to markdown.lang next to the Markdown contexts.
Add a test that checks the patterns match both syntaxes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant