Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/q9090960bnb3/gitbook-plugin-gbook-codetab
https://github.com/q9090960bnb3/gitbook-plugin-gbook-codetab
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/q9090960bnb3/gitbook-plugin-gbook-codetab
- Owner: q9090960bnb3
- License: mit
- Created: 2024-06-19T09:57:56.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-25T09:12:42.000Z (5 months ago)
- Last Synced: 2024-10-30T02:32:47.274Z (about 2 months ago)
- Language: JavaScript
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gitbook-plugin-gbook-code-tab
thanks for [gitbook-plugin-prism-codetab-fox](https://www.npmjs.com/package/gitbook-plugin-prism-codetab-fox)
## demo
``````md
{% codetab %}```js {group: "g1", title: "helloworld"}
console.log('hi')
console.log('hi-----')console.log("good job")
console.log(1+2)
``````js {group: "g1"}
console.log('+++++')
``````go
fmt.Println("hi go")
``````py {title: 'job py'}
print('xxxxx')
```@import "testcode/11.ts" {group: 'g2'}
@import "testcode/1.ts" {group: 'g2'}@import "testcode/1.py" {lang: 'go', title: 'not go is python'}
@import "testcode/1.html" {dbe: true}
{% endcodetab %}
``````说明:
- lang: 指定语言类型
- title: 给定tab标题,无则默认为对应语言类型
- group: 分组,可将同一分组合并到一格tab中
- dbe: 双大括号编码是否开启,默认false, 开启此项,代码内容 `{{` `}}` 将会加上转义,防止 gitbook 引擎将其内容解析为空,如果手写代码块需自己对内容加上转义
- 使用 @import 需要引入 [gbook-import-code](https://www.npmjs.com/package/gitbook-plugin-gbook-import-code)## use in book.json
```json
{
"plugins": ["gbook-codetab"]
}
```