-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Help test and implement the markdown custom editor preview #84520
Comments
Expression of thanksFirst of all: thank you very much for taking this feature request serious and starting first attemps implementing it! Experimental SetupSystem
SettingsFor setting it up as realistic as possible - in relation of how I am using markdown files every day - I created an example "wiki" that I would like to use as a place for every-day note-taking and as a knowledge-base. I had also enabled the custom editor settings permanently by adding... "workbench.experimental.editorAssociations": [
{
"viewType": "vscode.markdown.preview.editor",
"filenamePattern": "*.md"
}
] ...to the user setting.json. Opening markdown filesIt does exactly what it should: opening markdown files directly in preview mode! Perfect! At this (early) point it is already possible to read through my notes in a "wiki-style" way...just click and read without an additional distracting source-code view. Links. (For example, where do links open?)I linked my example markdown files with...
I also added external links and images. The result is what I expected...
This behavior should not be changed. This way you can read through (a collection of) markdown files like reading a book without distracting new windows popping up every time you click on another file. Switching editorsThis is not implemented yet. Switching editors - meaning switching between view and edit mode - should be realized with keyboard shortcuts. For example we could use...
Toggling between modes should take place in the same current window. This way you'll get a smooth create-read-modify experience. For references have a look at typora.io or notable.md where this is perfectly implemented. As an alternative, toggling to edit mode could open the well-known side-by-side preview mode. When saving the changes (by pressing CMD+S) the side-by-side view closes and you'll have only the preview mode again. Outline ViewThe outline view in the sidebar has no entries at the moment. This should be visible in the same way as it is when one is editing a markdown file in source mode. This could be a good way to have a table of content. I hope this first brief testing experience could help you with upcoming attemps for implementing this highly desirable feature. |
Thanks. Can you please split individual problems to separate issue so we can track them better (link them back to this issue). Also note that I am looking for the community to implement this, so please submit PRs with fixes if you want to see this stabilized. |
@mjbvz @jcgerhard I am considering tackling the editor toggle; this will be my first dive into open-source and could use a quick pointer as to where I should be looking! I have the preview Markdown editor up and running on my fork, but where may I look in src? I can make and link an issue once I get my bearings. |
@sverg1 This should likely not be a markdown specific command but a generic for custom editors. Something like: Here's where the custom editor commands live:
The
Since this change would be going into core VS Code, it should not hardcode anything markdown specific |
@mjbvz @jcgerhard Is help still wanted on the Outline View? This would also be my first dive into open source, so I was wondering if this would be a good task to work on and if I could have quick pointer as to where I should be looking in src? I have the preview Markdown editor up and running on my fork. Thanks! |
Usage notes of odd and errant behavior when double clicking within an Given that the Further, when double-clicking regular text within the file's
Also, the scroll position of the preview tab does not persist after changing away from, and then returning to the tab, as the above mentioned reference links to a known issue. Otherwise, the |
I want to report that Markdown files opened by default in the preview that have links that point to other Markdown files do not seem to load the other file. No matter how many times I click the link just wouldn't work. However, if I double-click the preview (hence entering edit mode) and then open up the preview again from the icon in the top right, then the links work fine. |
I can confirm what @s1-en described. Could this be fixed? Links only working in edit mode...NOT in preview mode! |
Hey @mjbvz i really like this, does this work on stable VSCode? I can see the I agree with @jcgerhard there needs to be some variable bindings to switch back and forth between preview and code. |
Yes it should work in stable but the setting is no longer experimental Still waiting for community help with the know issues, such as saving and restoring scroll position |
I agree, a lot of fixes here can be broken up. |
CMD + E is already assigned to "Find with selection" We would need another shortcut that lets you toggle between edit mode and preview. Suggestions welcome. "ctrl + cmd + p" could work |
Find widget |
Passing |
Background
Users would like the markdown preview to be opened when they open a markdown file. Feature requests #2766 and #54776 track a few different use cases, but the main one we are interested in right now is: when I open a markdown file, instead of opening the normal text editor, the markdown preview is opened instead.
This can now be implemented using custom editors: #77131
Current Status
The current insiders (1.41) contributes a custom editor for the markdown preview. It is not enabled by default by can be selected by running
View: Reopen with
with a markdown file open. You can also use the following setting to always open markdown files in preview mode instead of in the editor:The custom editor should look identical to the existing markdown preview.
How to help
The markdown custom editor needs testing and polish before it can be shipped. We are looking for the community to drive this. I've created this issue to collect feedback and discussion of this work.
Before we ship this feature, we need to make sure that custom editor based previews work as existing VS Code users would expect and work with the existing markdown preview's behavior and settings. This issue is intentionally open ended. Try playing around with the custom editor based markdown preview and exploring what works as expected and what doesn't
Some starting areas to focus on:
The text was updated successfully, but these errors were encountered: