-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add markdown-native-preview-mode to view previewed output within emacs #36
Conversation
add markdown-preview-window-function and markdown-preview-buffer for support
Thanks, I really like this idea. I didn't know about eww previously. I didn't have a whole lot of time to test it this morning but I did notice a few issues:
If you can take a look at 1 and 2 (3 and 4 can wait), then I'd be very happy to merge this. |
For some reason, I don't see the |
Somehow the font lock tests aren't reliable when running interactively. I run
Also, just to make sure it wasn't due to my local config, I double-checked 2 and 3 above with |
make test was complaining that font-lock-fontify-buffer shouldn't be run in interactive mode. this silences those.
Gotcha, the tests work now (some obsoleted functions in 25.1 tripped me up but that's just cause I'm running from master). I just added the I've also made a few changes to the use of Please tell me if the markdown buffer is still being killed or if the changes I made to |
Hey, so I've checked this out on |
native-preview -> live-preview keybinding and menu item (with checkbox!) added documentation in "Markdown and Maintenance Commands" added
Renamed |
add mention of arg BUF in `markdown-window-redisplay-preview'
This is looking great. I'm still seeing some window issues on Emacs 24, however. Now, when I enable I tested this on a recent build of Emacs 25 and it works as it should. The |
For some reason |
I simplified the window handling code and refactored the live-preview-window-function definition so that it works for me now on Emacs 24 and 25. See commit 97cae6e in my I admit that I didn't fully understand what the additional window handling code was doing. I'm simply using |
Took me a bit, but I figured out that the complex window handling code was because in my own config I change the name of the I'd prefer it if I also added the export function to |
Removed the |
markdown-export-and-preview
is great for running glossy live-updating markdown viewer nightmare children and is very idiomatic emacs lisp.markdown-native-preview-mode
is an alternative usingeww
(built in to emacs since 24.4) to view compiled HTML output within emacs, live-updating as the file is saved. The functionmarkdown-export-native-preview
will runmarkdown-export
, then openeww
to the exported file. Ifeww
is not already displaying a preview of the exported output, it will pop to a neweww
buffer displaying it; otherwise, it will update all windows displaying the exported output to their respective points in a new eww buffer rendering the new export. Ifmarkdown-native-preview-mode
is turned on, rendering occurs synchronously on every save.The defcustom
markdown-preview-window-function
can be used to customize the method of displaying the exported output in emacs, allowing the user to choose an alternative html viewer within emacs such asw3m
. The defcustommarkdown-native-preview-delete-export
determines whether to delete the exported file, which is typically not required after rendering within emacs, unlike with external html viewers.