Skip to content

Instantly share code, notes, and snippets.

@connorshea
Last active April 25, 2019 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save connorshea/0bb1fb18afb2d84e72f00c53c29bc048 to your computer and use it in GitHub Desktop.
Save connorshea/0bb1fb18afb2d84e72f00c53c29bc048 to your computer and use it in GitHub Desktop.
An idea for a 'Learn X in Y Minutes' extension.

Make a VS Code extension that displays content from Learn X in Y Minutes.

I imagine this'd work as follows:

  • Open the Command Palette
  • Run the command 'Show example from Learn X in Y Minutes'
  • Pick a page from the list of options (Essentially just the page names, Ruby, Go, PHP, Python, etc.)
  • The extension opens a view that displays the formatted Markdown. (Use VS Code's built-in Markdown renderer to render the Markdown.)

The extension would only support English to start with, I guess. I'm not sure if it'd be sufficient to download the markdown file from the Learn X in Y Minutes repo on-demand or if it'd be better to bundle it in the extension. The license for LXIYM is CC-BY-SA so credit needs be given, obviously.

It could also just open in a separate browser window.

Implementation

Can probably create a simple script to pull in the LXIYM git repo, pull out all the Markdown files, and then turn them into the HTML that can be packaged with the extension (the official markdown preview extension uses markdown-it I think?). The command would trigger the creation of a Webview which would display one of the HTML documents that's included with the extension.

Can probably also take the Markdown styling from the Markdown Preview extension?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment