npm.io
3.2.9 • Published 3 years agoCLI

gitbook-plugin-embed-file

Licence
MIT
Version
3.2.9
Deps
4
Size
112 kB
Vulns
0
Weekly
0

gitbook-plugin-embed-file

修改自:https://github.com/azu/gitbook-plugin-include-codeblock

兼容对docsify内嵌文件的引用方式。

[filename](../_media/example.md ':include')

安装使用

  • book.json 中添加配置
{
  "plugins": [
    "embed-file"
  ]
}
  • 执行安装命令
gitbook install

配置项

option value Description
template {"default","full","ace",...} or custom path reindent code if marker or slice is used
unindent {true,false} default:false reindent code if marker or slice is used
fixlang {true,false} default:false fix some errors with code lang (e.g C++, ...)
lang {"c_cpp","javascript", ...} lang color syntax (not set => auto deduce, see lang section).
edit {true,false} allow edit code (ace template required)
check {true,false} syntax validation (ace template required)
theme {"monokai","coffee",...} check syntax (ace template required)

book.json中配置,如:

{
    "gitbook": "3.x.x",
    "pluginsConfig": {
        "embed-file": {
            "template": "ace",
            "unindent": true,
            "theme": "monokai"
        }
    }
}

Keywords