Crates.io | mdbook-echarts |
lib.rs | mdbook-echarts |
version | 0.0.4 |
source | src |
created_at | 2022-11-21 02:28:13.018787 |
updated_at | 2022-11-28 15:55:15.244867 |
description | A preprocessor and cli tool for mdbook to show chart use echarts.js. |
homepage | https://crates.io/crates/mdbook-echarts |
repository | https://github.com/zhuangbiaowei/mdbook-echarts |
max_upload_size | |
id | 719628 |
size | 79,944 |
A preprocessor and cli tool for mdbook to show chart use Apache Echarts.
cargo install mdbook-echarts
#cat /path/to/your/mdbook/book.toml
[book]
authors = []
language = "en"
multilingual = false
src = "src"
[build]
create-missing = false
#use as mdbook preprocessor
[preprocessor.echarts]
[output.html]
additional-js = ["assets/echarts.min.js"]
[output.html.fold]
enable = true
level = 0
```echarts
{
xAxis: {
data: ['A', 'B', 'C', 'D', 'E']
},
yAxis: {},
series: [
{
data: [10, 22, 28, 43, 49],
type: 'bar',
stack: 'x'
},
{
data: [5, 4, 3, 5, 10],
type: 'bar',
stack: 'x'
}
]
};
```
or
{% echarts %}
{
xAxis: {
data: ['A', 'B', 'C', 'D', 'E']
},
yAxis: {},
series: [
{
data: [10, 22, 28, 43, 49],
type: 'bar',
stack: 'x'
},
{
data: [5, 4, 3, 5, 10],
type: 'bar',
stack: 'x'
}
]
};
{% endchart %}
When you run
mdbook serve
Or
mdbook build
this will do something to make sure your chart show as you wish.