You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/09/04 06:57:36 UTC

[incubator-echarts-doc] branch next updated: fix doc format.

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts-doc.git


The following commit(s) were added to refs/heads/next by this push:
     new 4dd5e75  fix doc format.
4dd5e75 is described below

commit 4dd5e75f582962406c1f89300a71f7e59e7c4ad2
Author: pissang <bm...@gmail.com>
AuthorDate: Fri Sep 4 14:55:43 2020 +0800

    fix doc format.
---
 README.md                          | 30 ++++++++++++++++++++++++++++--
 editor/common/blockHelper.js       |  2 +-
 en/option/component/timeline.md    |  1 -
 en/option/partial/selected-mode.md |  3 +--
 en/option/partial/zr-graphic.md    |  1 -
 en/option/series/bar.md            |  2 --
 en/option/series/treemap.md        | 37 +++++++++++++++++++++++++------------
 zh/option/series/treemap.md        | 14 ++++++++++++--
 8 files changed, 67 insertions(+), 23 deletions(-)

diff --git a/README.md b/README.md
index f292b00..c20281e 100644
--- a/README.md
+++ b/README.md
@@ -49,9 +49,9 @@ Provide a website link in doc:
 [Apache ECharts (incubating) website](${websitePath}/en/download.html)
 ```
 
-Notes: formatter will treat {{use}} as a block. So don't use it inline.
+Notes:
 
-Some examples.
+1. Formatter will treat {{use}} as a block. So don't use it **inline**.
 
 ```js
 // Good
@@ -62,6 +62,32 @@ Some other description
 Some description about {{ use: partial-inline-xxx }}
 ```
 
+2. Don't use to complex **inline** {{if}} {{else}} structure. It will make reading and patching between different languages harder.
+
+```js
+// Good
+{{ if: ${prefix} !== '#' }}
+表示同一层级的节点的颜色饱和度 选取范围。
+{{ else }}
+本系列默认的节点的颜色饱和度 选取范围。
+{{ /if }}
+数值范围 0 ~ 1。
+
+// Bad
+{{ if: ${prefix} !== '#' }}表示同一层级的节点的{{ else }}本系列默认的{{ /if }} 颜色饱和度 选取范围。数值范围 0 ~ 1。
+
+// Good
+{{ if: ${prefix} !== '#' }}
+It indicates the range of saturation (color alpha) for nodes in a level.
+{{ else }}
+It indicates the range of saturation (color alpha) for nodes  of the series.
+{{ /if }}
+The range of values is 0 ~ 1.
+
+// Bad
+It indicates the range of saturation (color alpha) {{ if: ${prefix} !== '#' }}for nodes in a level {{ else }} of the series{{ /if }}. The range of values is 0 ~ 1.
+
+```
 #### Format Option Docs
 
 Option docs needs to be formatted before commit.
diff --git a/editor/common/blockHelper.js b/editor/common/blockHelper.js
index d79aa37..eb2e340 100644
--- a/editor/common/blockHelper.js
+++ b/editor/common/blockHelper.js
@@ -339,7 +339,7 @@ module.exports.compositeBlocks = function (blocks) {
             let prefix = '\n\n';
             // A bit format here. No extra newline between if/for block.
             if ((prevBlock && (prevBlock.type === 'if' || prevBlock.type === 'elif' || prevBlock.type === 'else' || prevBlock.type === 'for')) ||
-                block.type === 'endif' || block.type === 'endfor') {
+                block.type === 'endif' || block.type === 'endfor' || block.type === 'else') {
                 prefix = '\n';
             }
             blockStr = prefix + blockStr;
diff --git a/en/option/component/timeline.md b/en/option/component/timeline.md
index 03375a5..950f688 100644
--- a/en/option/component/timeline.md
+++ b/en/option/component/timeline.md
@@ -435,7 +435,6 @@ Rotation angle of `label`, in which positive values refer to counter clockwise r
     name = "timeline.lable." + ${state},
     defaultColor = ${textStyleDefaultColor}
 ) }}
-
 {{ else }}
 {{ use: partial-text-style(
     prefix = ${prefix},
diff --git a/en/option/partial/selected-mode.md b/en/option/partial/selected-mode.md
index 11ab4fe..a916684 100644
--- a/en/option/partial/selected-mode.md
+++ b/en/option/partial/selected-mode.md
@@ -9,8 +9,7 @@
 ) }}
 {{ /if }}
 
-<ExampleUIControlEnum options="true,false,single,multiple" />
-
 Selected mode.  It is enabled by default, and you may set it to be `false` to disabled it.
 
 Besides, it can be set to `'single'` or `'multiple'`, for single selection and multiple selections.
+
diff --git a/en/option/partial/zr-graphic.md b/en/option/partial/zr-graphic.md
index 0ef9079..24a5a6d 100644
--- a/en/option/partial/zr-graphic.md
+++ b/en/option/partial/zr-graphic.md
@@ -1151,7 +1151,6 @@ Optional values:
 Only one between [left](~${optionPath}.${hostName}${symbolVisit}polygon.left) and [right](~${optionPath}.${hostName}${symbolVisit}polygon.right) can work.
 
 If [left](~${optionPath}.${hostName}${symbolVisit}polygon.left) or [right](~${optionPath}.${hostName}${symbolVisit}polygon.right) is specified, positioning attributes in [shape](~${optionPath}.${hostName}${symbolVisit}polygon.shape) (like `x`, `cx`) will not work.
-
 {{ else }}
 Only one between [top](~${optionPath}.${hostName}${symbolVisit}polygon.top) and [bottom](~${optionPath}.${hostName}${symbolVisit}polygon.bottom) can work.
 
diff --git a/en/option/series/bar.md b/en/option/series/bar.md
index 5db4ca2..618fb2e 100644
--- a/en/option/series/bar.md
+++ b/en/option/series/bar.md
@@ -219,7 +219,6 @@ The value of a single data item.
 
 {{ if: ${topLevel} }}
 {{ use: partial-label-desc() }}
-
 {{ else }}
 单个数据的文本配置。
 {{ /if }}
@@ -234,7 +233,6 @@ The value of a single data item.
 
 {{ if: ${topLevel} }}
 {{ use: partial-item-style-desc() }}
-
 {{ else }}
 单个数据的图形样式设置。
 {{ /if }}
diff --git a/en/option/series/treemap.md b/en/option/series/treemap.md
index a400f84..4340f23 100644
--- a/en/option/series/treemap.md
+++ b/en/option/series/treemap.md
@@ -285,6 +285,12 @@ When is no content in breadcrumb, this minimal width need to be set up.
     defaultColor = "#fff"
 ) }}
 
+## labelLayout(Object|Function)
+
+{{ use: partial-label-layout(
+    prefix = "##"
+) }}
+
 ## data(Array)
 
 the the data format of [series-treemap.data](~series-treemap.data) is a forest. For example:
@@ -424,7 +430,14 @@ A color list for a level. Each node in the level will obtain a color from the co
 
 #${prefix} colorAlpha(Array) = null
 
-It indicates the range of tranparent rate (color alpha) {{ if: ${prefix} !== '#' }}for nodes in a level {{ else }} of the series{{ /if }}. The range of values is 0 ~ 1.
+{{ if: ${prefix} !== '#' }}
+It indicates the range of tranparent rate (color alpha) for nodes in a level
+{{ else }}
+It indicates the range of tranparent rate (color alpha) for nodes of the series
+{{ /if }}
+
+.
+The range of values is 0 ~ 1.
 
 For example, `colorAlpha` can be `[0.3, 1]`.
 
@@ -436,7 +449,13 @@ For example, `colorAlpha` can be `[0.3, 1]`.
 
 #${prefix} colorSaturation(number) = null
 
-It indicates the range of saturation (color alpha) {{ if: ${prefix} !== '#' }}for nodes in a level {{ else }} of the series{{ /if }}. The range of values is 0 ~ 1.
+{{ if: ${prefix} !== '#' }}
+It indicates the range of saturation (color alpha) for nodes in a level.
+{{ else }}
+It indicates the range of saturation (color alpha) for nodes  of the series.
+{{ /if }}
+
+The range of values is 0 ~ 1.
 
 For example, `colorSaturation` can be `[0.3, 1]`.
 
@@ -590,9 +609,7 @@ Height of label area.
 <br>
 > Tps: In treemap, `${name}` attribute could appear in more than one places:
 
-{{ if: ${name} !== 'color' }}
-> * It could appear in [sereis-treemap](~series-treemap), indicating the unified setting of the series.
-{{ /if }}
+{{ if: ${name} !== 'color' }}> * It could appear in [sereis-treemap](~series-treemap), indicating the unified setting of the series.{{ /if }}
 
 > * It could appear in each array element of  [series-treemap.levels](~series-treemap.levels), indicating the unified setting of each level of the tree.
 
@@ -649,13 +666,9 @@ In this way, a effect can be implemented: different sections have different hue
 
 {{ use: partial-treemap-borderColor-setting() }}
 
-#${prefix} strokeColor(Color) = null
-
-Stroke color of each rect.
-
-#${prefix} strokeWidth(number) = null
-
-Stroke width of each rect.
+{{ use: partial-style-shadow-opacity(
+    prefix = ${prefix}
+) }}
 {{ /if }}
 
 
diff --git a/zh/option/series/treemap.md b/zh/option/series/treemap.md
index af7e020..9fa7ea3 100644
--- a/zh/option/series/treemap.md
+++ b/zh/option/series/treemap.md
@@ -588,7 +588,12 @@ treemap 默认把第一个维度(Array 第一项)映射到『面积』上。
 
 #${prefix} colorAlpha(Array) = null
 
-{{ if: ${prefix} !== '#' }}表示同一层级的节点的{{ else }}本系列默认的{{ /if }} 颜色透明度 选取范围。数值范围 0 ~ 1。
+{{ if: ${prefix} !== '#' }}
+表示同一层级的节点的颜色透明度选取范围。
+{{ else }}
+本系列默认的颜色透明度选取范围。
+{{ /if }}
+数值范围 0 ~ 1
 
 例如, `colorAlpha` 可以是 `[0.3, 1]`.
 
@@ -600,7 +605,12 @@ treemap 默认把第一个维度(Array 第一项)映射到『面积』上。
 
 #${prefix} colorSaturation(number) = null
 
-{{ if: ${prefix} !== '#' }}表示同一层级的节点的{{ else }}本系列默认的{{ /if }} 颜色饱和度 选取范围。数值范围 0 ~ 1。
+{{ if: ${prefix} !== '#' }}
+表示同一层级的节点的颜色饱和度 选取范围。
+{{ else }}
+本系列默认的节点的颜色饱和度 选取范围。
+{{ /if }}
+数值范围 0 ~ 1。
 
 例如, `colorSaturation` 可以是 `[0.3, 1]`.
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org