A simple tool that will take your selected/highlighted code snippet from within VS Code, format it for Reddit or Discord markdown before placing it on your system's clipboard, ready to paste in either program.
The goal of this extension is to provide a utility that helps users always have nicely formatted code blocks when asking for help within various help/support servers and subreddits.
-
Installing via .vsix file (windows)
- Download the latest release
- Open Windows Command Prompt in at the location where you downloaded the file to
- run
code --install-extension code-to-markdown-0.5.5.vsix
-
Installing via VSCode
- Navigate to Extensions (Ctrl+Shift+X)
- Search
Code to Markdown
- Install
-
Install via Marketplace Link:
-
Install via Open-VSX
- Select a snippet of code from your project
- Right-click and Select
Copy for Discord/New Reddit
orCopy for Old Reddit
- Paste the selected and now formatted code within a Reddit post or comment, or Discord chat box.
- You can use the "Copy for Discord/New Reddit" or "Copy for Old Reddit" when copying to New Reddit, but you must be in markdown mode. Fancy Pants editor seems to cause weird issues when pasting
- When using the "Copy for Discord/New Reddit" button, it will include the language for proper syntax highlighting (ex: ```lang {code} ```)
- When copying functions or code that is indented away from the left margin, be sure to highlight all the way to the margin before copying so that it knows how to properly handle formatting the code under the first line
- It's only been tested with Python, JS/TS, and JSON. It might work with other languages, but I can't guarantee its success.