Skip to content

Releases: feibuilds/MarkdownGlance

0.5.2 — Render failures say what failed

Choose a tag to compare

@feibuilds feibuilds released this 10 Oct 01:54

A render failure now says what failed. Every exception on the render pool used to become the card "Serialise / Render failed", with nothing in the console and nothing more in the diagnostics. The card now names the stage that failed (parse, asset or serialise) and carries the exception's class and message, the traceback is printed to the console whether or not debug_logging is on, and Copy Diagnostics carries it under last_error, together with the version and location of the Markdown and pymdown-extensions libraries the host actually imports. Prompted by #5.

Nothing else changed since 0.5.1. Package Control messages remain limited to the install note.

Requires Sublime Text build 4200 or newer. To install by hand, download Source code (zip) below and follow the README.

Changelog · Compare 0.5.1...0.5.2

0.5.1 — Superscript and subscript in the preview

Choose a tag to compare

@feibuilds feibuilds released this 15 Sep 08:45

<sup> and <sub> in raw HTML are now raised and lowered in the preview. Sublime Text's minihtml implements neither tag, so x<sup>2</sup> used to read as x2; each is now a span that the stylesheet shrinks and moves off the baseline, which minihtml can do. The line height is unchanged, and Open in Browser keeps the real tags. Reported in #2.

Nothing else changed since 0.5.0. Package Control messages remain limited to the install note.

Requires Sublime Text build 4200 or newer. To install by hand, download Source code (zip) below and follow the README.

Changelog · Compare 0.5.0...0.5.1

0.5.0 — One preview per window, SVG images

Choose a tag to compare

@feibuilds feibuilds released this 15 Sep 08:31

A window now has one preview and one contents panel, and both follow the file you are working on instead of piling up a tab per document. The panel shows the source outline while you edit and the rendered table of contents while you read the preview; clicking a heading takes you there in both panes. Where you had scrolled in each document comes back with it, and reopening Sublime Text brings the preview back on the same document, in the same pane, at the same zoom.

Ctrl+= and Ctrl+- zoom the preview from your Markdown file, and Ctrl-scroll over the preview zooms it without clicking it first. SVG images, a diagram beside the document or the badges at the top of a README, are drawn as PNG on your machine by resvg; nothing is uploaded, and without resvg the image says so in place. An image the preview cannot draw, WebP most often, names the reason, and Open in Browser shows it.

The install note Package Control shows once after installing now gives the quick start, the key bindings per platform, and which features are opt-in and why. Package Control messages remain limited to that install note. Several fixes to pane layout, focus following and the self-opening table of contents are listed in the changelog.

Requires Sublime Text build 4200 or newer. To install by hand, download Source code (zip) below and follow the README.

Changelog · Compare 0.4.2...0.5.0

0.4.2 — LaTeX math and browser rendering

Choose a tag to compare

@feibuilds feibuilds released this 06 Sep 05:42

LaTeX math is now supported in the Sublime Text preview. It is off by default; enable enable_math to render formulas as images through the configured HTTPS math server (CodeCogs by default). Enabling it sends formula source to that server.

MarkdownGlance: Open in Browser now renders Mermaid diagrams and LaTeX math locally in the browser, using pinned Mermaid and KaTeX assets from jsDelivr. When those assets are unavailable, the source remains readable. The browser page is a snapshot; live preview stays in Sublime Text.

This release also includes the 0.4.0–0.4.1 parser migration to Package Control libraries, the browser export command and its fixes. Package Control messages remain limited to the install note.

Changelog · Verification

0.3.1 — Installing without Git

Choose a tag to compare

@feibuilds feibuilds released this 01 Sep 23:22

Documentation only. No code, settings or key bindings change; rendering is byte-for-byte what 0.3.0 produced.

Changed

Installing by hand no longer assumes you use Git. The README's manual installation section now carries the other route, in plain steps: download Source code (zip) from the latest release, unzip it, rename the folder from MarkdownGlance-0.3.1 to MarkdownGlance — the name has to be exact, or Sublime Text will not load the package — and move it into the directory Preferences → Browse Packages… opens. Restart, and the preview is there. Updating later is the same steps over a deleted folder.

The Installation section also says plainly that the Package Control submission is still pending, rather than leaving you to find that out from the channel. And the README's preview screenshot is now a light and dark pair behind <picture>, so the shot follows the colour scheme of whoever is reading it — the same thing the preview itself does.

ADR 0002 gains an addendum recording why MarkdownPreviewPlus and MarkdownPreviewExtended were considered and rejected, and that the name is frozen once the channel pull request is merged. docs/ is export-ignore'd, so that reaches the repository only; the package differs from 0.3.0 by the README text alone.

The feature to try is still the one 0.3.0 shipped: enable_toc, off by default, which puts a navigable table of contents in the group beside the preview.

Full changelog: 0.3.0...0.3.1

0.3.0 — The right colour scheme, and a much cheaper repaint

Choose a tag to compare

@feibuilds feibuilds released this 30 Aug 01:36

The preview follows the colour scheme your Markdown file resolved, the table of contents is opt-in, and a repaint no longer relays out the whole document.

Upgrading from 0.2.x

The table of contents no longer opens on its own. It takes an editor group of a document you did not ask it for, so it is now behind enable_toc, defaulting to false. Set it in Preferences → Package Settings → MarkdownGlance → Settings:

"enable_toc": true

Everything else about it is unchanged, except that closing it from its tab now keeps it closed for that preview instead of having it return a second later.

Changed

A Mermaid diagram now follows the editor's colour scheme. The request asked mermaid.ink for the light theme on a transparent background, so on a dark scheme every label drawn straight onto that background — sequence messages, loop and note text — was near-black on near-black while the filled actor boxes stayed readable. The request now carries Mermaid's dark theme and the preview's own background colour. A diagram is baked by the server and cannot be recoloured by a repaint, so changing scheme under an open preview renders the document again for the new URLs.

The table of contents and the outline drop the document's page margins for 0.8rem of padding — they are lists in a narrow group, not pages.

Added

auto_width, defaulting to true. The table of contents and the outline are given the width their longest heading needs instead of a fixed share of the window, so the rest goes to the content. It is a ceiling, not a target: neither group is ever wider than it used to be. Dragging the divider turns it off for that group; "auto_width": false restores the fixed share everywhere. ADR 0011 has the reasoning.

MarkdownGlance: Copy Diagnostics now reports what a repaint cost — recent_renders with the Markdown in and the HTML out, and recent_paints with the wall clock around PhantomSet.update and whether the paint was skipped as unchanged.

Performance

Editing a 69 KB document pinned one core in sublime_text with plugin_host near idle. The cost was native minihtml layout, and almost all of it was avoidable.

  • A repaint that changes nothing no longer relays out the document. PhantomSet.update identifies a phantom by its region, content, layout and its on_navigate callback; the backend built that callback fresh every repaint, so the set never recognised the phantom already on screen — it erased it and added it back. One callback per surface now lives for the life of the surface, and identical HTML never reaches the phantom set.
  • Repainting the table of contents no longer spins the window's focus. It called reveal, which focuses the group, the view, then the previous group back; each of those fires on_activated, which re-reads the theme and repaints, landing back in the same place. Creation and a mode switch still reveal; a repaint does not.
  • Indentation in a code block no longer costs an element per space. A run of two or more spaces is now U+00A0 rather than one <i class="space">.</i> each — 5774 of them in this repository's own design document. Its HTML falls from 296 KB to 178 KB, and from 9332 elements to 3558.
  • The vendored parser drew a megabyte-sized hash salt. Upstream markdown2 writes SECRET_SALT = bytes(randint(0, 1000000)) — not a random salt but a zero-filled buffer of random length, re-hashed on each of the several hundred _hash_text calls a parse makes. Drawn once per plugin_host, it meant the same document parsed in 123 ms or in 1628 ms depending on the launch. Three random bytes keep the intent.

Fixed

Every surface now follows the colour scheme the Markdown file itself resolved. A Markdown buffer usually has one: MarkdownEditing: Select Color Scheme writes color_scheme into Markdown.sublime-settings, and a syntax-specific setting beats the global UI: Select Color Scheme. The preview, the table of contents and the outline are plain scratch views, so they inherited the global scheme — and that is the scheme minihtml resolves var(--background), var(--foreground) and var(--bluish) against, which is what preview.css is built out of. A light MarkdownEditing scheme over a dark editor rendered as a dark preview beside a light source. Each surface is now put on the source's scheme, and re-put on it whenever the source's moves.

Closing the table of contents from its tab no longer leaves its empty group behind.

Full changelog: 0.2.1...0.3.0

0.2.1 — The README shows the plugin

Choose a tag to compare

@feibuilds feibuilds released this 29 Aug 09:28

Documentation only. No code, settings or key bindings change; rendering is byte-for-byte what 0.2.0 produced.

Changed

The README now opens with the thing it describes — the preview in an editor group, with a Mermaid diagram, an aligned monospace table and the table of contents in the group beside it — and the outline screenshot shows the outline reading this repository's own README, level indent and active entry included.

Both images moved to docs/screenshots/ under names that say what they show. docs/ is export-ignore'd, so neither reaches the archive Package Control installs; the package differs from 0.2.0 by the README text alone.

If you are arriving from 0.1.x, 0.2.0 is the release with the feature: an outline of the Markdown source on Ctrl+Shift+B / Cmd+Shift+B.

Full changelog: 0.2.0...0.2.1

0.2.0 — Outline of the Markdown source

Choose a tag to compare

@feibuilds feibuilds released this 29 Aug 08:47

An outline of the Markdown source, beside the file you are editing. The preview and its table of contents are unchanged.

Added

Ctrl+Shift+B / Cmd+Shift+B — MarkdownGlance: Toggle Outline. It lists the headings as they are written in the buffer — # markers, raw text, indented by level — in a group of its own beside the file, never as a tab in the preview's group.

  • The entry holding the caret is highlighted, with the headings above it marked, and both follow the caret as you move it.
  • The list re-scans as you type, after update_delay_ms.
  • Clicking an entry moves the caret to that heading and centres it, leaving focus in the outline so you can keep clicking.
  • The key toggles the way Zed's outline panel does: open and focus, focus if it is already open, close on a press from inside it.
  • One outline per file. It is revealed when its source is activated, renamed with it, and closed with it.

This reads the buffer, not the rendered document, so it needs no preview and no successful render — which is what separates it from the table of contents inside the preview. That TOC still comes out of the parsed document, still appears on its own once toc_minimum_length and toc_minimum_headings are met, and still scrolls the preview. Both can be open at once.

The scan handles ATX (#…######, closing hashes stripped) and setext (===, ---) headings, and skips fenced code blocks and YAML front matter, so a # comment inside a fence and the closing --- of front matter are not mistaken for headings.

One more Sublime Text default changes, in Markdown only

Ctrl+Shift+B is Build With… (build with select: true, measured in build 4200). This binding applies only while a Markdown source view or an outline this package created is focused; plain Ctrl+B is untouched everywhere, and Markdown has no build system. It is the key Zed gives its outline panel, which is the point of matching it.

To keep the key, delete that one entry from Preferences → Package Settings → MarkdownGlance → Key Bindings; MarkdownGlance: Toggle Outline stays in the command palette without it.

ADR 0010 records the decision, the measured defaults and why the outline is a separate surface rather than a mode of the preview's TOC. The feature note has a screenshot and the file map.

Full changelog: 0.1.4...0.2.0

MarkdownGlance 0.1.4

Choose a tag to compare

@feibuilds feibuilds released this 29 Aug 01:10

Package Control review housekeeping. Nothing you press changes, and rendering is byte-for-byte the same.

Changed

The Settings entry calls edit_settings directly. Preferences → Package Settings → MarkdownGlance → Settings and the Preferences: MarkdownGlance Settings palette entry used to route through a package command that did nothing but forward to Sublime Text's own. They now pass base_file themselves, the form every other package uses.

The bundled copy of markdown2 no longer carries its command-line mainline. A Sublime Text package never runs it, and it brought optparse, a Markdown.pl comparison through subprocess.Popen with no hidden-window handling on Windows, and a sys.path insert along with it. Two regex literals became raw strings so recent Python versions stop warning about invalid escape sequences. The library API is untouched, and THIRD_PARTY_NOTICES records the divergence from upstream.

Removed

The mdglance_open_settings command. Anything bound to it should call edit_settings with "base_file": "${packages}/MarkdownGlance/MarkdownGlance.sublime-settings".

MarkdownGlance 0.1.3

Choose a tag to compare

@feibuilds feibuilds released this 28 Aug 23:11

Fixed

The Full Screen toggle is Ctrl+Shift+V again (Cmd+Shift+V on macOS).

The Ctrl+K, Shift+V chord that 0.1.2 moved it to never fired: Sublime Text lists it in the command palette but does not dispatch it, and its own keymap binds no chord whose second key is bare or shift-only.

The key is shadowed only while a Markdown source view or a preview this package owns is focused — the same key VS Code and Zed give their Markdown preview, next to the Ctrl+K, V this package already borrowed from them. It costs Paste and Indent in Markdown buffers, where Edit → Paste and Indent still runs the command by name; removing one entry from Preferences → Package Settings → MarkdownGlance → Key Bindings undoes it entirely.

ADR 0009 records the measurements and the decision.