Skip to content

VSC Extension that will copy selected code into Discord or Reddit markdown ready formats

License

Notifications You must be signed in to change notification settings

dlchamp/Code-to-MD

Repository files navigation

Code to Markdown for Visual Studio Code

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.

Installation

  • 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

Instructions

  1. Select a snippet of code from your project
  2. Right-click and Select Copy for Discord/New Reddit or Copy for Old Reddit
  3. Paste the selected and now formatted code within a Reddit post or comment, or Discord chat box.

Example

Example

Disclaimer and Notes:

  • 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.

About

VSC Extension that will copy selected code into Discord or Reddit markdown ready formats

Resources

License

Stars

Watchers

Forks

Packages

No packages published