This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch feat-cartesian-layout in repository https://gitbox.apache.org/repos/asf/echarts-doc.git
commit b06f22973794054f8011ace8e6e6efd942062873 Author: 100pah <[email protected]> AuthorDate: Wed Jul 30 04:05:19 2025 +0800 supplement doc and support `config/env.dev-local.js` as a git-non-tracked local config file. --- .gitignore | 4 +++- README.md | 29 +++++++++++++++++++++-------- build.js | 5 +++++ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 28eee55c..e3f8c759 100644 --- a/.gitignore +++ b/.gitignore @@ -188,4 +188,6 @@ slides/webgl /tool/blocks-zh.json /zh-src -/en-src \ No newline at end of file +/en-src + +/config/env.*-local.js diff --git a/README.md b/README.md index 12797ee7..0aa1c614 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ It will: + Watch doc site src change and rebuild. + Watch doc markdown change and rebuild. +### Local Config + +To customize the links of `echarts-examples` and other configurations, you can create a local config file `echarts-doc/config/env.dev-local.js`, which is not tracked by git. The content can be copied from `echarts-doc/config/env.dev.js`, and then modify it as needed. `npm run dev` will use this local config file, if it exists, to replace `echarts-doc/config/env.dev.js`. + ## Tips About Writing Doc @@ -42,34 +46,41 @@ For example, ### Global Variables These global variables can be used in doc: -+ galleryViewPath -+ galleryEditorPath -+ websitePath ++ `${galleryViewPath}` ++ `${galleryEditorPath}` ++ `${websitePath}` + +See samples in "Reference of echarts-examples or other links" + +### Reference of echarts-examples or Other Links -For example: -Embed a example in doc: +Embed an example in doc: ```md +~[700X300](${galleryEditorPath}pie-legend&edit=1&reset=1) ~[700x300](${galleryViewPath}doc-example/aria-pie&edit=1&reset=1) ``` -Provide a example link in doc: + +Provide an example link in doc: ```md [vertically scrollable legend](${galleryEditorPath}pie-legend&edit=1&reset=1) +[aria pie](${galleryViewPath}doc-example/aria-pie&edit=1&reset=1) ``` + Provide a website link in doc: ```md [Apache ECharts website](${websitePath}/en/download.html) ``` -### Reference of Option +### Reference of Other ECharts Option A `~` can be used to refer to a option item in the same doc. For example: - ```md [xAxis.name](~xAxis.name) ``` If intending to reference an anchor in different doc, it can be: ```md +In api.html, reference [itemStyle](option.html#series.itemStyle) ``` @@ -233,6 +244,8 @@ Concatenation operator `+` can be used in that string. ### Document Embedded Examples +This is the embedded example that can be opened by clicking "try it" and then appears on the right side of the doc page. + Declare the base echarts options (`ExampleBaseOption`), whose scope is each echarts component or series. A `ExampleBaseOption` can be shared by multiple options. e.g., ```md <ExampleBaseOption name="cartesian-bar" title="直角坐标系上的柱状图" title-en="Bar on Cartesian"> diff --git a/build.js b/build.js index 0f5e71f0..22e6e729 100644 --- a/build.js +++ b/build.js @@ -46,6 +46,11 @@ function initEnv() { let config = require('./config/env.' + envType); + const localOverridePath = './config/env.' + envType + '-local.js'; + if (fs.existsSync(path.join(__dirname, localOverridePath))) { + config = require(localOverridePath); + } + assert(path.isAbsolute(config.releaseDestDir) && path.isAbsolute(config.ecWWWGeneratedDir)); config.envType = envType; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
