首页 > gitbook 运行代码实例 书写类

gitbook 运行代码实例 书写类

实例演示

http://rustbyexample.com/hello/comment.html

问题

访问上面网址可以看到 rust 代码实例, 点击 run 按钮的 时候 ,可以看到 有运行结果

如何 在使用 gitbook 书写 时 可以 有 上面的 代码运行实例呢


看实例演示的源码,我找到了它的 book.json 文件

{
    "plugins": ["rust-playpen"],
    "pluginsConfig": {
        "rust-playpen": {}
    }
}

可以看出它使用了一个插件叫 rust-playpen ,但貌似这个插件是作者自己写的,源码地址如下:

https://github.com/rust-lang/rust-by-example/tree/master/node_modules/gitbook-plugin-rust-playpen

希望有所帮助~ :)

【热门文章】
【热门文章】