Skip to content

Commit

Permalink
docs: ecosystem section (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
Koooooo-7 committed Feb 7, 2024
1 parent a844c08 commit 64ca276
Show file tree
Hide file tree
Showing 4 changed files with 31,343 additions and 12 deletions.
7 changes: 3 additions & 4 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
- [Event and Action](en-us/event-and-action)
- Advanced
- [Render to Image](en-us/render-to-image)
- [Ecosystem](en-us/ecosystem)
- Chart Configration
- [Global](en-us/options/global)

[//]: # ( - [Series](en-us/options/series))

[//]: # ( - [Options](en-us/options/options))
- [Series](en-us/options/series)
- [Options](en-us/options/options)
- Showcases
- [Line](en-us/charts/line)
- [Bar](en-us/charts/bar)
Expand Down
7 changes: 7 additions & 0 deletions docs/en-us/ecosystem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ecosystem of go-echarts

?> Welcome to contribute your awesome integration case !!!

This part lists all the ecosystem of go-echarts. Thanks for those great works.


20 changes: 12 additions & 8 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,29 @@
},
plugins: [
function (hook) {
const rawApi = "https://raw.githubusercontent.com/go-echarts/examples/master/examples/"
const fetchTask = []
const exampleRegex = /\[(Examples|GoEcharts)CODE\s?=\s?(.*)\]/g;
const rawExampleApi = "https://raw.githubusercontent.com/go-echarts/examples/master/examples/"
const rawConfigApi = "https://raw.githubusercontent.com/go-echarts/go-echarts/master"
const fetchTasks = []
hook.beforeEach((html, next) => {
const regex = /\[ExamplesCODE\s?=\s?(.*)\]/g;
html.replace(regex, function (match, content) {
const api = rawApi + content;
html.replace(exampleRegex, function (match, tag, path) {
console.log(tag)
console.log(path)
const rawApi = tag === "Examples" ? rawExampleApi : rawConfigApi
const api = rawApi + path;
// fetch content
const task = fetch(api)
.then(resp => resp.text())
.then(data => {
html = html.replace(match, data);
});
fetchTask.push(task)
fetchTasks.push(task)
});

if (fetchTask.length === 0) {
if (fetchTasks.length === 0) {
next(html)
} else {
Promise.all(fetchTask).then(() => next(html))
Promise.all(fetchTasks).then(() => next(html))
}
});

Expand Down

0 comments on commit 64ca276

Please sign in to comment.