Add LaTeX, super/subscript, pull quotes, callouts, and Markdown docs#65
Open
MattFisher wants to merge 5 commits into
Open
Add LaTeX, super/subscript, pull quotes, callouts, and Markdown docs#65MattFisher wants to merge 5 commits into
MattFisher wants to merge 5 commits into
Conversation
GFM tables (`| col | col |`) map to Substack's table/table_row/ table_header/table_cell schema. Table node shape was confirmed by probing the live API. LaTeX math blocks ($$...$$) map to latex_block via mdit_py_plugins' dollarmath plugin. Both features are covered by unit tests and the e2e fixture/golden file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Inline math ($x$ and $$x$$ via dollarmath's double_inline) now maps to Substack's inline `latex` node, confirmed against the live API. Previously inline math tokens were silently dropped. Also restores the [^unused] and [^listnote] footnote definitions in the e2e fixture, which had been corrupted, dropping footnote ma2za#4 from coverage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Drop dollarmath's double_inline option so $$...$$ is only ever a display block, matching the common Markdown convention. Inline math stays $...$. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Substack has no table renderer or insert UI, so the table node (added earlier) stored but never displayed. Removed it in favor of features Substack actually supports, confirmed by round-tripping editor-authored nodes through the live API: - pullquote and calloutBlock via `:::pullquote` / `:::callout` containers - superscript (`^x^`) and subscript (`~x~`) inline marks Subscript's single-tilde syntax coexists with `~~strikethrough~~`. The sub/superscript plugins require mdit-py-plugins >= 0.5, so the constraint and lockfile are updated (now resolves 0.6.1). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add docs/markdown.md covering every Markdown construct from_markdown() converts (formatting, headings, lists, images, footnotes, math, pull quotes, callouts) plus what is intentionally unsupported (tables, editor-only widgets). Link it from the README. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Builds on the
from_markdownwork from #61, adding several Markdown constructs that map to Substack nodes, plus a documentation page. Node shapes were confirmed by round-tripping editor-authored drafts through the live API.Closes #63
New Markdown features
$…$(→latexnode) and block$$…$$(→latex_block), viamdit_py_plugins.dollarmath.^x^) and subscript (~x~) inline marks. Subscript's single-tilde syntax coexists with~~strikethrough~~.:::pullquote/:::callout), since they have no native Markdown equivalent.Tables: intentionally not supported
An earlier iteration added a
tablenode, but Substack has no table renderer or editor UI — the node stored but never displayed. It's been removed to avoid producing silently-broken drafts.docs/markdown.mddocuments this and points users at Datawrapper embeds for tabular data.Docs
New
docs/markdown.mddocuments every supported construct with examples, plus what's intentionally unsupported. Linked from the README's Markdown section.Dependencies
The sub/superscript plugins require
mdit-py-plugins >= 0.5; the constraint (>=0.5,<0.7) and lockfile are updated accordingly (resolves 0.6.1).Testing
test_from_markdown_features.py.RUN_SUBSTACK_E2E=1).