Repository: incubator-weex Updated Branches: refs/heads/dev a52c861e1 -> f76aa0690
* [doc] add doc of idea plugin Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6e36b074 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6e36b074 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6e36b074 Branch: refs/heads/dev Commit: 6e36b0749f667c02107037ebde407d278ec6ac83 Parents: 9db8054 Author: misakuo <misa...@apache.org> Authored: Mon Aug 21 12:22:04 2017 +0800 Committer: misakuo <misa...@apache.org> Committed: Mon Aug 21 12:22:04 2017 +0800 ---------------------------------------------------------------------- doc/source/cn/guide/tools/index.md | 1 + doc/source/cn/guide/tools/plugin.md | 70 ++++++++++++++++++++++++ doc/source/guide/tools/index.md | 1 + doc/source/guide/tools/plugin.md | 61 +++++++++++++++++++++ doc/themes/weex/layout/_partial/sidebar.ejs | 3 + 5 files changed, 136 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6e36b074/doc/source/cn/guide/tools/index.md ---------------------------------------------------------------------- diff --git a/doc/source/cn/guide/tools/index.md b/doc/source/cn/guide/tools/index.md index cd2c226..6dacd4c 100644 --- a/doc/source/cn/guide/tools/index.md +++ b/doc/source/cn/guide/tools/index.md @@ -8,3 +8,4 @@ version: 2.1 # å¨è¾¹å·¥å · - [weex-toolkit](./toolkit.html) +- [Weex Language Supportæ件](./plugin.md) http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6e36b074/doc/source/cn/guide/tools/plugin.md ---------------------------------------------------------------------- diff --git a/doc/source/cn/guide/tools/plugin.md b/doc/source/cn/guide/tools/plugin.md new file mode 100644 index 0000000..467b890 --- /dev/null +++ b/doc/source/cn/guide/tools/plugin.md @@ -0,0 +1,70 @@ +# Weexè¯æ³æ¯ææ件 + +[Weex Language Support](https://plugins.jetbrains.com/plugin/9189-weex-language-support) æ件æ¯å®æ¹æä¾çä¸ä¸ªå·¥å ·ï¼ä½ å¯ä»¥ä½¿ç¨å®å¨IntelliJ IDEAï¼WebStormçä¸ç³»åIDEä¸å¯¹Weex DSLè¿è¡è¯æ³é«äº®ï¼èªå¨è¡¥å ¨åé误æ£æ¥çæä½ã + +### æ¯æçIDE +ä½ å¯ä»¥å¨ä»»ä½æä½ç³»ç»ä¸çä¸åIDEä¸å®è£ å使ç¨Weex Language Supportæä»¶ï¼ +**IntelliJ IDEA Ultimate, PhpStorm, WebStorm, PyCharm, RubyMine, AppCode, CLion, Gogland, Rider** + +### å®è£ +å¨IDEçæ件ä»åºä¸æç´¢`Weex Language Support`æ¥å®è£ 该æ件ï¼å®è£ å®æ¯åéå¯IDEå³å¯æ¿æ´»æ件ç¸å ³åè½ +![install plugin](https://img.alicdn.com/tfs/TB1y6nrXwvGK1Jjy0FdXXaxzVXa-1316-462.png) + +### é ç½® +æå¼`Preferences -> Other Settings -> Weex language support`å¯é ç½®æ件çç¸å ³åè½ +![plugin settings](https://img.alicdn.com/tfs/TB1FonrXwvGK1Jjy0FgXXX9hFXa-559-244.png) +- Target Weex Version: é ç½®æ件以åªä¸ä¸ªçæ¬çè¯æ³è§åæ¥å¯¹DSLè¿è¡æ示åæ£æ¥ï¼é»è®¤å¼`LATEST`表示æ»æ¯åºç¨æè¡æ°çæ¬weexçè¯æ³è§å +- Vue Support: é ç½®æ件æ¯å¦æ¯æWeex 2.0çæ¬çDSL(.vueæ件)ï¼å¼å¯åéå¯çæï¼æ³¨æï¼å¦æIDEå æå ¶ä»æ¯æVueè¯æ³çæ件ï¼åéè¦å ³éç¸åºçæ件åWeexæ件æè½çæï¼ +- Custom Rules: å¼å ¥èªå®ä¹çWeex DSLè§åï¼å¦æä½ å¨nativeä¸å®ä¹äºèªå·±çModuleæComponentï¼å¯éè¿èªå®ä¹è§åå¼å ¥æ件ä¸æ¥æä¾ç¸åºçæ示åè¡¥å ¨æ¯æï¼èªå®ä¹è§åçæ ¼å¼å°å¨åæååº +- Global Weex Components: é»è®¤å°ï¼æ件ä¼è§£æå½åå·¥ç¨ånpm rootè·¯å¾ä¸ç`node_modules`ç®å½ï¼è§£æå ¶ä¸å å«çWeex Componentså¹¶å¯¹å ¶æä¾è¡¥å ¨æ¯æãå¦æä½ ç项ç®ä¸å¼ç¨äºè¿ä¸¤ä¸ªè·¯å¾ä»¥å¤çComponentsï¼å¯ä»¥å¨æ¤å¤å°å ¶æ·»å å°æ索路å¾ä¸ï¼æ件å°ä¼å°å ¶ä¸çComponentsè½½å ¥ï¼å¹¶å¨ç¼åDSLæ¶ä¸ºç¸åºçæ ç¾æä¾è¡¥å ¨æ¯æ + +### èªå®ä¹è§åæ ¼å¼ +èªå®ä¹è§åå å«å¨ä¸ä¸ªjsonæ件ä¸ï¼jsonæ件çæ ¹èç¹ä¸ºæ°ç»ç±»åï¼æ°ç»ä¸çæ¯ä¸ä¸ªå ç´ å¯¹åºDSLä¸çä¸ä¸ªæ ç¾ã +æ们以`<loading>`æ ç¾çè§åæ¥ä¸¾ä¾ï¼ +```js +{ + "tag": "loading", //æ ç¾åï¼ä¸å¯ä¸ºç©º + "attrs": [ //æ ç¾å±æ§å表ï¼å¯ä¸ºç©º + { + "name": "display", //å±æ§åï¼ä¸å¯ä¸ºç©º + "valuePattern": null, //å±æ§å¼çæ£å表达å¼ï¼ç¨äºæ£æµå¼æ¯å¦åæ³ï¼å¯ä¸ºç©º + "valueEnum": [ //å±æ§å¼æ举ï¼å¯ä¸ºç©º + "show", + "hide" + ], + "valueType": "var", //å±æ§å¼ç±»åï¼å¿ é¡»æ¯varæfunctionï¼å³å®è¯¥ä»æ°æ®å表è¿æ¯å½æ°å表ä¸æ¥æ¾å±æ§å¼è¡¥å ¨çåéå¼ï¼ä¸å¯ä¸ºç©º + "since": 0, //该å±æ§ä½æ¶è¢«æ·»å å°sdkä¸ï¼ä¾å¦0.11ï¼é»è®¤ä¸º0 + "weexOnly": false //该å±æ§æ¯å¦ä» å¨1.0è¯æ³ä¸å¯ç¨ï¼é»è®¤ä¸ºfalse + } + ], + "events": [ //äºä»¶å表ãå¯ä¸ºç©º + { + "name": "loading", //äºä»¶å称ï¼ä¸å¯ä¸ºç©º + "since": 0 //该äºä»¶ä½æ¶è¢«æ·»å å°sdkä¸ + } + ], + "parents": [ //该æ ç¾å 许被ä½ä¸ºåªäºæ ç¾çåå ç´ ï¼ç©ºè¡¨ç¤ºå¯ä»¥ä½ä¸ºä»»æå ç´ çåå ç´ + "list", + "scroller" + ], + "childes": [ //该æ ç¾å 许åªäºå ç´ ä½ä¸ºèªå·±çåå ç´ ï¼ç©ºè¡¨ç¤ºä»»æå ç´ é½å¯ä½ä¸ºåå ç´ + "text", + "image", + "loading-indicator" + ], + "document": "/references/components/loading.html" //ææ¡£å°åï¼é 置该å±æ§ä¹åå¯å¨ç¼è¾çé¢ä¸å¯¹åºçæ ç¾ä¸ç´æ¥æå¼ææ¡£ + } +``` + +### ä½¿ç¨ +æ件çç»å¤§é¨ååè½è¢«éæå°ç¼è¾å¨ä¸ä¸æä¸ï¼ä¼éç¨æ·è¾å ¥å¨éè¦è¡¥å ¨ï¼æ示æLintæ¶è¢«è§¦åï¼æ éç¹æ®å¹²é¢ãä¸ååè½éè¦ç¨æ·æå¨è§¦åï¼ +#### ææ¡£æç´¢ +æå¼IDEå³ä¾§å·¥å ·æ ç`Weex Documents`å³å¯å¯¹ææ¡£è¿è¡æç´¢ï¼æç´¢ç»æä¸å®ç½ä¿æåæ¥ï¼å¾é `EN` å¯åæ¢æç´¢ç»æ为è±æå 容 +![doc search](https://img.alicdn.com/tfs/TB1ihvDXE6FK1Jjy0FoXXXHqVXa-360-430.png) + +#### æå¼æ ç¾å¯¹åºçææ¡£ +å°å æ å®ä½å°æ ç¾ä¸ï¼å¹¶éè¿`Show Intention Actions`æä½ï¼OSXä¸é»è®¤é®ä¸º option + enterï¼å¯éè¿Keymapæ¥çï¼æå¼Intenionèåï¼éæ©`Open Document`å¯æå¼æ ç¾å¯¹åºçææ¡£ +![open doc](https://img.alicdn.com/tfs/TB1LeLDXDzGK1JjSspjXXcHWXXa-416-86.png) + +### åä¸æ件建设 +请å°IssuesåPull Requestsæ交å°[weex-language-support](https://github.com/misakuo/weex-language-support)项ç®ä¸ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6e36b074/doc/source/guide/tools/index.md ---------------------------------------------------------------------- diff --git a/doc/source/guide/tools/index.md b/doc/source/guide/tools/index.md index 83ce4dc..74f8373 100644 --- a/doc/source/guide/tools/index.md +++ b/doc/source/guide/tools/index.md @@ -8,3 +8,4 @@ version: 2.1 # Tools - [weex-toolkit](./toolkit.html) +- [IDEA / WebStorm Plugin](./plugin.md) http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6e36b074/doc/source/guide/tools/plugin.md ---------------------------------------------------------------------- diff --git a/doc/source/guide/tools/plugin.md b/doc/source/guide/tools/plugin.md new file mode 100644 index 0000000..8ca1731 --- /dev/null +++ b/doc/source/guide/tools/plugin.md @@ -0,0 +1,61 @@ +# Weex Language Support Plugin + +[Weex Language Support](https://plugins.jetbrains.com/plugin/9189-weex-language-support) is a official tools to code highlight, automatic completionï¼lint and other functions in IDEA, WebStorm or the others IDEs. + +### Supported IDEs +You can install and use this plugin on the following IDEs on any operating system: +**IntelliJ IDEA Ultimate, PhpStorm, WebStorm, PyCharm, RubyMine, AppCode, CLion, Gogland, Rider** + +### Install +Just searching the `Weex Language Support` in plugin repo to install, next you need restart IDE to enable it. +![install plugin](https://img.alicdn.com/tfs/TB1y6nrXwvGK1Jjy0FdXXaxzVXa-1316-462.png) + +### Configurations +Open `Preferences -> Other Settings -> Weex language support` to configuration plugin +![plugin settings](https://img.alicdn.com/tfs/TB1FonrXwvGK1Jjy0FgXXX9hFXa-559-244.png) +- Target Weex Version: Config the version of Weex that your current project in use, default is `LATEST`, it means always using the latest version +- Vue Support: Config whether to support Vue, you need to restart IDE after turning on or off the set to take effect +- Custom Rules: Import the custom Weex DSL rules, The format of the custom rules will be listed later +- Global Weex Components: Sets the location of the module that is applied in the project, in particular, the `node_modules` directory in current project and npm root will be automatically included, you do not need to add them here + + +### Format of Custom DSL Rules +Custom rules are included in a json file, the root node of the json file is an array, each element in the array corresponds to a label in the DSL. +Let's take the example of the `loading>` tag: +```js +{ + "tag": "loading", //tag name, not null + "attrs": [ //attributes of tag, can be null + { + "name": "display", //attribute name, not null + "valuePattern": null, //pattern expression to check the attribute value, can be null + "valueEnum": [ //attribute value enumeration, can be null + "show", + "hide" + ], + "valueType": "var", //type of attribute value, must be var or function + "since": 0, //which version the attribute is added to sdk, such as 0.11 + "weexOnly": false //whether the attribute is available only in 1.0 syntax, default is false + } + ], + "events": [ //events list, can be null + { + "name": "loading", //event name, not null + "since": 0 //which version the event is added to sdk + } + ], + "parents": [ //The tag is allowed to be a child of which tags, null means no restrictions + "list", + "scroller" + ], + "childes": [ //which tags are allowed as their own child tags, null means no restrictions + "text", + "image", + "loading-indicator" + ], + "document": "/references/components/loading.html" //document link + } +``` + +### Contribution +Please commiting Issues and Pull Requests into the [weex-language-support](https://github.com/misakuo/weex-language-support) project \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6e36b074/doc/themes/weex/layout/_partial/sidebar.ejs ---------------------------------------------------------------------- diff --git a/doc/themes/weex/layout/_partial/sidebar.ejs b/doc/themes/weex/layout/_partial/sidebar.ejs index 3074b4a..9a9e2cf 100644 --- a/doc/themes/weex/layout/_partial/sidebar.ejs +++ b/doc/themes/weex/layout/_partial/sidebar.ejs @@ -41,6 +41,9 @@ <li> <a href="https://market.dotwe.org" target="_blank">Market</a> </li> + <li> + <a href="<%= url_for_lang('guide/tools/plugin.html') %>">Weex WebStorm Plugin</a> + </li> </ul> </li> <li>