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

sushuang 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 eea4d0d  (1) `npm run localsite` to update example rapidly in dev. (2) 
add error hint. (3) tweak text in doc.
eea4d0d is described below

commit eea4d0d50c5d590534fafa9e3873d3e2e9f6f370
Author: 100pah <sushuang0...@gmail.com>
AuthorDate: Tue Aug 18 23:03:03 2020 +0800

    (1) `npm run localsite` to update example rapidly in dev. (2) add error 
hint. (3) tweak text in doc.
---
 en/tutorial/media-query.md |  2 +-
 package.json               |  1 +
 tool/md2json.js            | 14 +++++++++++++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/en/tutorial/media-query.md b/en/tutorial/media-query.md
index f126031..34d88ab 100644
--- a/en/tutorial/media-query.md
+++ b/en/tutorial/media-query.md
@@ -133,7 +133,7 @@ A `query` is in the following format:
 }
 ```
 
-Currently there are three supported attributes:`width`, `height`, 
`aspectRatio` (length-to-width ratio), each of which can add `min` or `max` as 
prefix. E.g., `minWidth: 200` stands for when width is greater than or equal to 
200px. When two attributes are written together, it means *and* in Bool logic. 
For example, `{minWidth: 200, maxHeight: 300}` stands for when width is greater 
than or equal to 200px and height is smaller than or equal to 300px.
+Currently there are three supported attributes:`width`, `height`, 
`aspectRatio` (height / width), each of which can add `min` or `max` as prefix. 
E.g., `minWidth: 200` stands for when width is greater than or equal to 200px. 
When two attributes are written together, it means *and* in Bool logic. For 
example, `{minWidth: 200, maxHeight: 300}` stands for when width is greater 
than or equal to 200px and height is smaller than or equal to 300px.
 
 
 **option: **
diff --git a/package.json b/package.json
index 91af066..89be2dc 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,7 @@
   "scripts": {
     "build": "node build.js --env asf",
     "watch": "node build.js --env dev --watch",
+    "localsite": "node build.js --env localsite",
     "build:site": "npx webpack --config build/webpack.config.js --mode 
production",
     "watch:site": "npx webpack --config build/webpack.config.js --mode 
development --devtool sourcemap --watch",
     "server": "node server.js",
diff --git a/tool/md2json.js b/tool/md2json.js
index bd8b2fc..bff7203 100644
--- a/tool/md2json.js
+++ b/tool/md2json.js
@@ -3,6 +3,7 @@ const marked = require('marked');
 const etpl = require('etpl');
 const glob = require('glob');
 const htmlparser2 = require('htmlparser2');
+const chalk = require('chalk');
 
 function convert(opts, cb) {
     const mdPath = opts.path;
@@ -42,7 +43,18 @@ function convert(opts, cb) {
             Object.prototype[key] = tplEnv[key];
         });
 
-        var mdStr = etplEngine.getRenderer(entry)({});
+        var mdStr;
+        var compileErr;
+        try {
+            mdStr = etplEngine.getRenderer(entry)({});
+        }
+        catch (err) {
+            compileErr = err;
+        }
+        if (compileErr) {
+            console.error(chalk.red('There is something illegal in doc md!'));
+            throw err;
+        }
 
         // Restore the global variables.
         Object.keys(tplEnv).forEach(function (key) {


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

Reply via email to