V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
sox
V2EX  ›  分享创造

docute 2.9.0 可以直接运行 markdown 里的代码

  •  
  •   sox ·
    egoist · 2017-03-10 14:28:58 +08:00 · 2517 次点击
    这是一个创建于 2603 天前的主题,其中的信息可能已经有所发展或是发生改变。

    前情提要: docute v2.6.2

    做了个 docute-iframe 插件可以让你的代码块高亮的同时用 iframe 来运行这个代码块。

    需要运行的代码块用 4 个反引号包裹:

    ````html
    <script>
        document.write('hello world')
    </script>
    ````
    

    Repo: https://github.com/egoist/docute

    6 条回复    2017-03-22 23:41:06 +08:00
    blanu
        1
    blanu  
       2017-03-10 23:39:32 +08:00 via iPhone
    Great !之前我用 stackedit.io 魔改了可以运行 vue 代码的,现在这个应该更方便
    hronro
        2
    hronro  
       2017-03-11 13:29:54 +08:00
    yangxuan8282
        3
    yangxuan8282  
       2017-03-22 22:29:32 +08:00
    更新的好快啊,到 3.0 了,问下作者大大以后会压缩 js 大小吗,现在 200k + 第一次加载起来有点慢
    sox
        4
    sox  
    OP
       2017-03-22 22:47:23 +08:00
    @yangxuan8282 vue + vuex + vue-router 就 120KB 了,是在不好弄小了 😂 你可以放在 CDN 上, 国内 unpkg.com 应该比较慢
    sox
        5
    sox  
    OP
       2017-03-22 22:48:05 +08:00
    @yangxuan8282 其实 3.0 没有太大的变化,只是有个细微的插件改动是 breaking change
    yangxuan8282
        6
    yangxuan8282  
       2017-03-22 23:41:06 +08:00
    @sox 今天发现之前用 docute 2.5 版本建立的一个页面不显示了了,看了下 github 发现好像得改 config.js ,暂时还没改,先用以前的 js
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4145 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 04:11 · PVG 12:11 · LAX 21:11 · JFK 00:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.