Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhuangbiaowei/mdbook-echarts
mdbook chart
https://github.com/zhuangbiaowei/mdbook-echarts
Last synced: about 1 month ago
JSON representation
mdbook chart
- Host: GitHub
- URL: https://github.com/zhuangbiaowei/mdbook-echarts
- Owner: zhuangbiaowei
- License: mit
- Fork: true (cococolanosugar/mdbook-chart)
- Created: 2022-11-20T10:29:11.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-28T15:53:12.000Z (about 2 years ago)
- Last Synced: 2024-09-16T16:08:05.842Z (3 months ago)
- Language: Rust
- Size: 29.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-echarts - mdbook-echarts - A preprocessor and cli tool to use Apache ECharts in mdbook. (Tools / Markdown)
README
# mdbook-echarts
A preprocessor and cli tool for mdbook to show chart use [Apache Echarts](https://echarts.apache.org/).#### install
```bash
cargo install mdbook-echarts
```#### 1. Use as mdbook preprocessor.
```bash
#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```
### 2. edit your markdown file
````text```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
```bash
mdbook serve
```
Or
```bash
mdbook build
```
this will do something to make sure your chart show as you wish.![demo](./demo.png)