Skip to main content

Coding

Less than 1 minute

This plugin provides the following features to enhance coding:

  • Code Tabs: Add tabs to your code block.
  • Code Demo: Display and run code snippets in browser.
  • Playground: Embed external playground site.
  • Kotlin Playground: Reactive kotlin playground.
  • Vue Playground: Reactive vue playground.

Demo

Code Tabs

npm
npm i -D vuepress-plugin-md-enhance

Code Demo

A normal demo
<h1>VuePress Theme Hope</h1>
<p>Is <span id="very">very</span> powerful!</p>
document.querySelector("#very").addEventListener("click", () => {
  alert("Very powerful!");
});
span {
  color: red;
}

Playground

TS demo

Kotlin Playground

Kotlin Playground
class Contact(val id: Int, var email: String)

fun main(args: Array<String>) {
    val contact = Contact(1, "mary@gmail.com")
    println(contact.id)
}

Vue Playground

Vue Playground

Sandpack

Vue Playground
<script setup>
import { ref } from "vue";

const msg = ref("Hello World!");
</script>

<template>
  <h1>{{ msg }}</h1>
  <input v-model="msg" />
</template>