From 6529281dd084f48141ca920812a5e84fbcaca65f Mon Sep 17 00:00:00 2001 From: Aditya Shankar Date: Tue, 7 Jul 2020 06:30:59 +0530 Subject: [PATCH] added pug example --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index fbe38a8..2bb4b4b 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,22 @@ all language modes/themes are dynamically loaded, and the css is dynamically loa ``` +**Example in pug !** + +**JavaScript example** + +```pug +doctype html +html(lang="en") + script(type="module" src="https://cdn.jsdelivr.net/gh/vanillawc/wc-code@0.2.1/build/index.min.js") +body + wc-code(mode="javascript" theme="monokai") + script(type="wc-content"). + const resp = await fetch("https://sv443.net/jokeapi/v2/joke/Any?blacklistFlags=nsfw,racist,sexist&format=txt"); + const text = await resp.text(); + console.log(text); +``` + see https://codemirror.net/theme/ for a list of supported themes ## Contributing