Tianhe Gao

Klipse 嵌入可执行代码片段

https://github.com/viebel/klipse

新建一个 HTML 文档,输入以下内容:

 1<div class="klipse">
 2  function foo(name) {
 3  return "Hello " + name;
 4  }
 5  foo("Klipse");
 6</div>
 7<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/viebel/klipse@master/dist/codemirror.css">
 8<script>
 9  window.klipse_settings = {
10    selector_eval_js: '.klipse', // css selector for the html elements you want to klipsify
11  };
12</script>
13<script src="https://cdn.jsdelivr.net/gh/viebel/klipse@master/dist/klipse_plugin.min.js"></script>

No notes link to this note

Welcome to tell me your thoughts via "email"
UP