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

sushuang pushed a commit to branch security-related
in repository https://gitbox.apache.org/repos/asf/echarts-doc.git

commit b4b36c7f67c0957bd678586f229bae7bf4870a4e
Author: 100pah <[email protected]>
AuthorDate: Sat Oct 18 17:38:48 2025 +0800

    support security warning common mixin.
---
 README.md                             | 23 +++++++++++++++++++++++
 en/option/partial/security-warning.md |  5 +++++
 src/style/mixin.scss                  |  9 +++++++++
 zh/option/partial/security-warning.md |  5 +++++
 4 files changed, 42 insertions(+)

diff --git a/README.md b/README.md
index 18040d3b..2337ae6b 100644
--- a/README.md
+++ b/README.md
@@ -55,8 +55,31 @@ For example,
 {{ use: partial-version(version = ${version|minVersion('6.0.0')}) }}
     That is, if the ${version} is empty or smaller than '6.0.0', use '6.0.0'.
     Follow the version comparison rules in Semver 2.0 .
+
+{{ use: partial-version(
+    feature = '`dataIndex` is available',
+    version = '5.3.0'
+) }}
+
+{{ use: partial-version(
+    deprecated = 'Use xxx instead',
+    version = '5.1.0'
+) }}
 ```
 
+### Security Warning
+Security waning is required for unsafe APIs/options.
+For example,
+```
+{{ use: security-warning }}
+Or
+{{ use: security-warning(
+    desc: 'Raw HTML is allowed in this option.'
+)}}
+```
+
+See 
["Security"](https://echarts.apache.org/handbook/en/best-practices/security) 
for more details.
+
 ### Global Variables
 
 These global variables can be used in doc:
diff --git a/en/option/partial/security-warning.md 
b/en/option/partial/security-warning.md
new file mode 100644
index 00000000..e9c293e3
--- /dev/null
+++ b/en/option/partial/security-warning.md
@@ -0,0 +1,5 @@
+{{ target: security-warning }}
+<div class="doc-partial-security-warning">
+**[WARNING]:** ${desc} Security risks must be considered here. See 
["Security"](${handbookPath}best-practices/security) for recommendations on 
safe usage.
+</div>
+{{ /target }}
diff --git a/src/style/mixin.scss b/src/style/mixin.scss
index 9dc0917f..4ef90f4c 100644
--- a/src/style/mixin.scss
+++ b/src/style/mixin.scss
@@ -93,4 +93,13 @@
             color: #0086b3;
         }
     }
+
+    .doc-partial-security-warning {
+        font-size: 13px;
+        background: rgba(254, 226, 226, 1);
+        margin: 10px 20px 10px 0;
+        padding: 10px;
+        border-left: 2px solid rgba(248, 113, 113, 1);
+        color: rgb(100, 116, 139);
+    }
 }
diff --git a/zh/option/partial/security-warning.md 
b/zh/option/partial/security-warning.md
new file mode 100644
index 00000000..66bc89a1
--- /dev/null
+++ b/zh/option/partial/security-warning.md
@@ -0,0 +1,5 @@
+{{ target: security-warning }}
+<div class="doc-partial-security-warning">
+**[警告]:** ${desc} 使用时必须考虑安全风险。文档 
[“安全性”](${handbookPath}best-practices/security) 给出了安全使用建议。
+</div>
+{{ /target }}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to