Skip to content

Fallback render - #66

Merged
ondratu merged 12 commits into
masterfrom
fallback-render
Sep 21, 2026
Merged

ondratu merged 12 commits into
masterfrom
fallback-render

Conversation

@ondratu

@ondratu ondratu commented Sep 20, 2026

Copy link
Copy Markdown
Owner

No description provided.

The error dialog could not be created, so no message was shown.
Linux (with distribution and kernel), Windows and macOS are reported, plus the Flatpak runtime inside a Flatpak. Adds PyGObject to the listed packages.
Renderer no longer touches gi.repository.WebKit directly - all
WebKit-specific API (JS evaluation, find controller, print operations,
navigation policy) now lives in webkit_browser.py behind the new
BrowserView interface (browser.py), so a different rendering backend
can be swapped in later. json_preview.py degrades JS-only features
(folding, JSONPath highlight scripts) gracefully when a backend can't
run scripts.

The About dialog's debug info no longer imports WebKit either.
Behaviour is unchanged: the three copies of the same focus checks are
now one helper, with tests.
Such a link did not scroll and its anchor text was run as script in the preview.
Such a key produced a broken node path, and markup in the key was inserted into the page.
Each edit added another click handler, so an even number of them toggled a node twice.
…t changed

Re-rendering unchanged content no longer moves the preview back to the editor position, while a reload or typing at the end of the document still does.
…n Windows/macOS)

Renders the preview via litehtml/Cairo/Pango instead of WebKit. On Linux
it stays opt-in (FORMIKO_BROWSER=litehtml); on Windows and macOS, where
WebKitGTK isn't a realistic dependency, it's now picked by default, with
FORMIKO_BROWSER still able to force either backend on any platform. Adds
the "litehtml" install extra pulling the required litehtmlpy build.

Not a feature-complete replacement yet - no JavaScript (so JSON folding
stays expanded), no incremental re-render, printing not implemented,
text selection/search only at whole-text-node granularity. See the
module docstring for details and the litehtmlpy patches this currently
depends on.
Formiko code changes needed to run the frozen app on Windows, kept
portable rather than Windows-specific where the fix generalizes.

- Look up the correct cairo library name per platform.
- Copy the litehtmlpy render buffer instead of aliasing it, which
  caused an intermittent access violation after a render.
- Point fontconfig, GSettings and XDG_DATA_DIRS at the bundled copies
  when frozen, so the app starts and GtkSourceView finds its schemas.
- Enable faulthandler (only when stderr exists) to diagnose native
  crashes in the windowed build.
- Add the symbolic toolbar icons (inline code, blockquote, header
  level) missing from the MSYS2 Adwaita theme.
Builds the litehtml + SourceView variant on MSYS2, bundles it with
PyInstaller and packages it with Inno Setup. The installer has an app
icon and wizard images, full version/publisher metadata, licences, file
associations for .rst, .md and .json, and per-user or system-wide
install. Spell checking works through Enchant with a thread-safe
winspell provider.

The build runs on pushes to master, on relevant pull requests and on
tags; for a tag the installer is attached to the release (a draft is
fine). Build details are documented in packaging/windows/README.md.
@ondratu
ondratu merged commit 3a82116 into master Sep 21, 2026
8 checks passed
@ondratu
ondratu deleted the fallback-render branch September 21, 2026 08:51
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