Add txt2tags-to-Markdown conversion - #896
Open
jendrikseipp wants to merge 13 commits into
Open
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.