mjbvz / vscode-github-markdown-preview-style

VS Code extension that changes the built-in markdown preview to match Github's styling
https://marketplace.visualstudio.com/items?itemName=bierner.markdown-preview-github-styles
MIT License
308 stars 57 forks source link

How to toggle this extension without removing or disabling it? #94

Open Nos78 opened 1 year ago

Nos78 commented 1 year ago

Having read through the README and briefly scanned the extension.js, I cannot see a way to toggle the markdown styling so that I can revert to rendering normal markdown or apply github styling on the fly, without having to remove or disable the extension - which I imagine is going to be quite annoying for me as I have uses other than github for markdown documents.

Is there a keyboard shortcut for the extension, or can one be provided? For example, in my file-header-comments extension, CTRL+ALT+I inserts a file-header-description block by calling registerCommand() from activate(), and providing a callback function. In a similar way, a keyboard shortcut (or maybe a context menu?) could be added to toggle the preview using github or normal styling.

Thanks in advance, and apologies if there is already a way to do this that I have missed.

Nos78 commented 1 year ago

Kudos on a rather nice little extension! Can't believe I've not thought of using it before now - TBF I rarely use the vscode preview window (until now!), getting by with viewing markdown via my browser.

I did a quick modification for this - added a boolean into the configuration for enabled state, and in the plugin function, do stuff if its true, otherwise just return md without doing stuff.

Seems this was wishful thinking, it's not as simple as that as there is other stuff going on behind the scenes - css changes to the default markdown?

Can do a pull request Jumping the gun with this one :smile:

Nos78 commented 1 year ago

Oops - I had the whole extension pack installed, hence seeing the smiley rendered (its not this plugin that does that bit, silly silly, using that as the test to see if it turned off...)