Skip to content
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

Markdown preview #3176

Open
maxild opened this issue Feb 22, 2021 · 4 comments
Open

Markdown preview #3176

maxild opened this issue Feb 22, 2021 · 4 comments
Labels
A-markdown Area: Markdown authoring / editing enhancement New feature or request

Comments

@maxild
Copy link

maxild commented Feb 22, 2021

I just blindly bought a license without even knowing much about the state of onivim2, because I wish to support and use any 'VIM style' editor. My initial plan was to use 'oni2' to edit markdown docs in some of my projects, but I couldn't get 'preview' to work. Is this supported somehow (even through plugins) or is the problem no embedded browser support?

@bryphe
Copy link
Member

bryphe commented Feb 24, 2021

Hi @maxild ,

I just blindly bought a license without even knowing much about the state of onivim2, because I wish to support and use any 'VIM style' editor.

Thanks for supporting the editor and for logging the issue, appreciate it!

Is this supported somehow (even through plugins) or is the problem no embedded browser support?

We're missing this at the moment - we actually have some limited markdown rendering capabilities (https://github.com/revery-ui/revery/blob/18eb60e6d5b99adebcf5912d05c447e83a0f7e0b/src/UI_Components/Markdown.re) which we use today to render extension details. It isn't the full Github markdown implementation, though - missing some things like tables and images. Synchronizing the scroll position may also be challenging with this implementation.

I anticipate we will need to support embedding some sort of webview eventually - it is required for new capabilities of the vscode extension host (ie, #3128 ), and would be helpful in terms of a fully baked markdown preview experience.

In the meantime - we could look at using our current markdown renderer for preview, and then swapping in the webview to provide more fidelity in the preview once that is available.

@bryphe bryphe added A-markdown Area: Markdown authoring / editing enhancement New feature or request labels Feb 24, 2021
@MAHDTech
Copy link

MAHDTech commented Feb 24, 2021

@bryphe, just a thought,

What about getting an extension like instant markdown working?

This means the preview portion is run though an external web browser and the editor is just serving the pages.

I just searched open-vsx and doesn't look like it's there at the moment, but it's potentially a smaller hurdle then full integrated markdown preview at this time?

Although i'm not sure what underlying wiring would be required to get the pages served... so could be harder 😁 but interested to get your thoughts.

I find my self currently editing markdown in vscode and Go and Rust in Onivim2 so it's definetly one to consider for the daily driver blocker list 😃

@bryphe
Copy link
Member

bryphe commented Feb 26, 2021

Thanks for the suggestion @MAHDTech ! I didn't know about that plugin.

I just tested it out (by manually git clone'ing into ~/.config/oni2 and running npm install); seems like it'd be a reasonable stop-gap in the meantime until we have a hosted webview.

The auto-open functionality seems to work; but we're missing the events the extension needs to synchronize and update the markdown (sending visible ranges + selection position) - this extension would actually be a nice test case for these. And lots of other extensions rely on those events (https://github.com/onivim/vscode-exthost/blob/0d6b39803352369daaa97a444ff76352d8452be2/src/vs/workbench/api/common/extHost.protocol.ts#L1083)

@abers
Copy link

abers commented Mar 23, 2021

On a slightly related note, I noticed in the VimConf.live presentation the ability to switch to non-monospaced fonts. How difficult would it be to implement different font sizes for header lines and using two different fonts in the same pane? You could turn oni2 into a fantastic markdown editor with those two features. I'd kill for a vim-powered GUI that let's users have more prose-friendly fonts when working in markdown files, including changing line size for header lines to give a 'lite' preview, but keeping monospaced fonts for code-blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-markdown Area: Markdown authoring / editing enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants