GithubHelp home page GithubHelp logo

orta / playground-plugin-codeblock-examples Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 1.44 MB

Convert a markdown file into a set of clickable samples in the TypeScript Playground

JavaScript 41.01% TypeScript 58.99%

playground-plugin-codeblock-examples's Introduction

Markdown Codeblock Examples

Takes a markdown document and lets you click through all of the TypeScript samples as a sidebar. Perfect for talks where you have all the code ahead of time and want to talk through each bit one by one.

So, first you put in your markdown.

./screenshots/before.png

Then you click through the code samples from each codeblock

./screenshots/after.png

How it works

The parser will pick up any codeblock like this:

Some preamble:

```ts
type MyThing = {

}
```
  • Language - is important, any language other than ts or tsx will show when selected, but with TypeScript's error handling disabled
  • Whitespace - is unimportant in detection, so fenced codeblocks will turn up too
  • Keyboard-only - once you have selected a codeblock, when in the editor you can press cmd/ctrl + g to move to the next codeblock

Running this plugin

or

  • Open up the TypeScript Playground
  • Go the "Plugins" in the sidebar
  • Look for "Plugins from npm"
  • Add "playground-plugin-codeblocks-examples"
  • Reload the browser

Then it will show up as a tab in the sidebar.

Contributing

See CONTRIBUTING.md for the full details, however, TLDR:

git clone ...
yarn install
yarn start

Then tick the box for starting plugin development inside the TypeScript Playground.

playground-plugin-codeblock-examples's People

Contributors

orta avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.