Open a Markdown preview in the browser - #38
Open
timsonner wants to merge 2 commits into
Open
Conversation
Ctrl+E renders the current document to HTML and opens it in the default browser. Fenced code is highlighted with highlight when that package is installed, using the live Omarchy theme colours.
The browser preview had forced every heading to body size so it would match the editor. Hash headings now render as h1–h6 with distinct sizes.
Author
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.

Closes #3.
Ctrl+E renders the current buffer (saved or not) to HTML and opens it in the default browser. The writing app stays a source editor; the preview is a snapshot tab.
This is not the in-app reader in #26. That PR keeps a second view inside Omawrite. This one follows the request in #3 to preview in the default browser so the app stays small.
Behaviour
Ctrl+Ewrites a themed HTML file and opens ithighlightpackage is installed; otherwise the code stays plaincolors.tomljavascript:links are strippedTests
./bin/test— 13 passedScreenshots
Please drag this onto the GitHub PR (
ghcannot upload images):/home/tim/omawrite-pr-screenshots/editor-and-preview.pngEditor on the left, browser preview on the right. Headings (
#/##/###) use a size scale in the preview.