* [doc] Update cn docs, all changes are shown below:

- Weex supports horizontalpan/verticalpan currently;
- weex-toolkit@release supports Vue 2.0 template;
- Fix typo.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f6838783
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f6838783
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f6838783

Branch: refs/heads/master
Commit: f683878399471b8171127983ec078cf22879328b
Parents: 9dd6bdd
Author: Yun Dong <[email protected]>
Authored: Tue Mar 7 14:31:02 2017 +0800
Committer: Yun Dong <[email protected]>
Committed: Tue Mar 7 14:31:02 2017 +0800

----------------------------------------------------------------------
 doc/source/cn/guide/set-up-env.md               |   8 +-
 doc/source/cn/guide/tools/weexpack.md           |   2 +-
 .../cn/references/advanced/extend-to-ios.md     | 231 ++++++++++---------
 doc/source/cn/references/components/cell.md     |   2 +-
 doc/source/cn/references/gesture.md             |   3 +-
 doc/source/guide/intro/devtools.md              | 100 --------
 doc/source/guide/set-up-env.md                  |   2 +-
 doc/source/guide/tools/weexpack.md              |   2 +
 8 files changed, 131 insertions(+), 219 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f6838783/doc/source/cn/guide/set-up-env.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/guide/set-up-env.md 
b/doc/source/cn/guide/set-up-env.md
index 79ff249..5d77a45 100644
--- a/doc/source/cn/guide/set-up-env.md
+++ b/doc/source/cn/guide/set-up-env.md
@@ -12,7 +12,7 @@ has_chapter_content: true
 
 ## 第一步:安装依赖
 
-Weex 官方提供了 weex-toolkit 的脚手架工具来辅
助开发和调试。首先,你需要 Node.js 和 weex-toolkit。
+Weex 官方提供了 weex-toolkit 的脚手架工具来辅
助开发和调试。首先,你需要 Node.js 和 [Weex 
CLi](https://github.com/weexteam/weex-toolkit)。
 
 安装 Node.js 方式多种多样,最简单的方式是在 [Node.js 
官网](https://nodejs.org/en/) 下载可执行程序直接安装即可。
 
@@ -46,12 +46,14 @@ $ weex -v
 v1.0.3
 weex-builder : v0.2.4
 weex-previewer : v1.3.4
-```      
+```
+
 
 国内开发者可以考虑使用淘宝的 npm 镜像 —— 
[cnpm](https://npm.taobao.org/) 安装 weex-toolkit
 
+
 ```bash
-$ npm install -g cnpm
+$ npm install -g cnpm --registry=https://registry.npm.taobao.org
 $ cnpm install -g weex-toolkit
 ```
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f6838783/doc/source/cn/guide/tools/weexpack.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/guide/tools/weexpack.md 
b/doc/source/cn/guide/tools/weexpack.md
index ac64dd7..ee1a26c 100644
--- a/doc/source/cn/guide/tools/weexpack.md
+++ b/doc/source/cn/guide/tools/weexpack.md
@@ -372,7 +372,7 @@ weexplugin
 
 ## 插件开发文档
 
-+ [开发 web 的插件教程](./doc/plugin-devloping-web.md)
++ [开发 web 
的插件教程](https://github.com/weexteam/weex-pack/blob/master/doc/plugin-devloping-web.md)
 
 
 ## 示例

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f6838783/doc/source/cn/references/advanced/extend-to-ios.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/advanced/extend-to-ios.md 
b/doc/source/cn/references/advanced/extend-to-ios.md
index 4edecf4..25872bb 100644
--- a/doc/source/cn/references/advanced/extend-to-ios.md
+++ b/doc/source/cn/references/advanced/extend-to-ios.md
@@ -11,119 +11,126 @@ version: 2.1
 
 Weex SDK 只提供渲染,而不是其他的能力,如果你需要 
像网络,图片,URL跳转这些特性,需要自己动手实现他们
 例如,如果你想实现一个url地址跳转函数,你可以按ç…
§å¦‚下步骤实现一个 Module
-1. **自定义module的步骤**
-   1. 自定义的module类 必须实现 `WXModuleProtocol`
-   2. 必须添加宏`WX_EXPORT_METHOD`, 
它可以被weex识别,它的参数是 JavaScript调用 
module指定方法的参数
-   3. 添加`@synthesized 
weexInstance`,每个moudle对象被绑定到一个指定的实例上
-   4. Module 
方法会在UI线程中被调用,所以不要做太多耗时的任务在这里,如果要在å
…¶ä»–线程执行整个module 方法,需要实现`WXModuleProtocol`中`- 
(NSThread *)targetExecuteThread`的方法,这æ 
·ï¼Œåˆ†å‘到这个module的任务会在指定的线程中运行
-   5. Weex 的参数可以是 String 或者Map
-   6. Module 支持返回值给 
JavaScript中的回调,回调的类型是`WXModuleCallback`,回调的参数可以是String或è€
…Map
-      
-      ```object-c
-      @implementation WXEventModule
-      @synthesize weexInstance;
-         WX_EXPORT_METHOD(@selector(openURL:callback))
-      - (void)openURL:(NSString *)url callback:(WXModuleCallback)callback
-      {
-          NSString *newURL = url;
-          if ([url hasPrefix:@"//"]) {
-              newURL = [NSString stringWithFormat:@"http:%@", url];
-          } else if (![url hasPrefix:@"http"]) {
-             newURL = [NSURL URLWithString:url 
relativeToURL:weexInstance.scriptURL].absoluteString;
-          }
-      
-          UIViewController *controller = [[WXDemoViewController alloc] init];
-          ((WXDemoViewController *)controller).url = [NSURL 
URLWithString:newURL];
-      
-          [[weexInstance.viewController navigationController] 
pushViewController:controller animated:YES];
-          callback(@{@"result":@"success"});
-      }
-      
-      @end
-      ```
-2. **Register the module**
-   通过调用 WXSDKEngine 中的 
`registerModule:withClass`方法来注册自己的module
-   
-   ```object-c
-   WXSDKEngine.h
-   /**
-   *  @abstract Registers a module for a given name
-   *  @param name The module name to register
-   *  @param clazz  The module class to register
-   **/
-   + (void)registerModule:(NSString *)name withClass:(Class)clazz;
-   [WXSDKEngine registerModule:@"event" withClass:[WXEventModule class]];
-   ```
-3. **使用自己的module**
-    这里的  require 里面的event 就是在 
上一步调用`registerModule:` 注册module 时候的name
-   
-   ```javascript
-    var eventModule = weex.requireModule('event'); 
-    eventModule.openURL('url',function(ret) {   
-        nativeLog(ret);
-    });
-   ```
-   
-   Weex SDK没有 图片下载,navigation 
操作的能力,请大家自己实现这些 protocol
-
-4. **WXImgLoaderProtocol**  
-
-   weexSDK 没有图片下载的能力,需要实现 
WXImgLoaderProtocol,参考下面的例子
-   
-   ```object-c
-   WXImageLoaderProtocol.h
-   @protocol WXImgLoaderProtocol <WXModuleProtocol>
-   /**
-    * @abstract Creates a image download handler with a given URL
-    * @param imageUrl The URL of the image to download
-    * @param imageFrame  The frame of the image you want to set
-    * @param options : The options to be used for this download
-    * @param completedBlock : A block called once the download is completed.
-      image : the image which has been download to local.
-      error : the error which has happened in download.
-      finished : a Boolean value indicating whether download action has 
finished.
-   */
-   -(id<WXImageOperationProtocol>)downloadImageWithURL:(NSString *)url 
imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)options 
completed:(void(^)(UIImage *image,  NSError *error, BOOL 
finished))completedBlock;
-   @end
-   ```
-   
-   实现上述协议  
-   
-   ```object-c
-   @implementation WXImgLoaderDefaultImpl
-   #pragma mark -
-   #pragma mark WXImgLoaderProtocol
-   
-   - (id<WXImageOperationProtocol>)downloadImageWithURL:(NSString *)url 
imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)userInfo 
completed:(void(^)(UIImage *image,  NSError *error, BOOL 
finished))completedBlock
-   {
-       if ([url hasPrefix:@"//"]) {
-           url = [@"http:" stringByAppendingString:url];
-       }
-       return (id<WXImageOperationProtocol>)[[SDWebImageManager sharedManager] 
downloadImageWithURL:[NSURL URLWithString:url] options:0 progress:^(NSInteger 
receivedSize, NSInteger expectedSize) {     
-       } completed:^(UIImage *image, NSError *error, SDImageCacheType 
cacheType, BOOL finished, NSURL *imageURL) {
-       if (completedBlock) {
-           completedBlock(image, error, finished);
-       }
-       }];
-   }
-   @end
-   ```
-
-5. **handler注册** 
+
+### **自定义module的步骤**
+1. 自定义的module类 必须实现 `WXModuleProtocol`
+2. 必须添加宏`WX_EXPORT_METHOD`, 它可以被weex识别,它的参数是 
JavaScript调用 module指定方法的参数
+3. 添加`@synthesized 
weexInstance`,每个moudle对象被绑定到一个指定的实例上
+4. Module 
方法会在UI线程中被调用,所以不要做太多耗时的任务在这里,如果要在å
…¶ä»–线程执行整个module 方法,需要实现`WXModuleProtocol`中`- 
(NSThread *)targetExecuteThread`的方法,这æ 
·ï¼Œåˆ†å‘到这个module的任务会在指定的线程中运行
+5. Weex 的参数可以是 String 或者Map
+6. Module 支持返回值给 
JavaScript中的回调,回调的类型是`WXModuleCallback`,回调的参数可以是String或è€
…Map
+    
+    ```object-c
+    @implementation WXEventModule
+    @synthesize weexInstance;
+        WX_EXPORT_METHOD(@selector(openURL:callback))
+    - (void)openURL:(NSString *)url callback:(WXModuleCallback)callback
+    {
+        NSString *newURL = url;
+        if ([url hasPrefix:@"//"]) {
+            newURL = [NSString stringWithFormat:@"http:%@", url];
+        } else if (![url hasPrefix:@"http"]) {
+            newURL = [NSURL URLWithString:url 
relativeToURL:weexInstance.scriptURL].absoluteString;
+        }
+    
+        UIViewController *controller = [[WXDemoViewController alloc] init];
+        ((WXDemoViewController *)controller).url = [NSURL 
URLWithString:newURL];
+    
+        [[weexInstance.viewController navigationController] 
pushViewController:controller animated:YES];
+        callback(@{@"result":@"success"});
+    }
+    
+    @end
+    ```
+
+另外,`0.10.0` 开始支持同步模块 API 调用,您可以使用宏 
`WX_EXPORT_METHOD_SYNC` 导出模块方法,这些方法可以使 JavaScript 
接受从 native 返回的值,它只能在 JS 线程被调用。
+
+### 注册 module
+
+通过调用 WXSDKEngine 中的 
`registerModule:withClass`方法来注册自己的module
+
+```object-c
+WXSDKEngine.h
+/**
+*  @abstract Registers a module for a given name
+*  @param name The module name to register
+*  @param clazz  The module class to register
+**/
++ (void)registerModule:(NSString *)name withClass:(Class)clazz;
+[WXSDKEngine registerModule:@"event" withClass:[WXEventModule class]];
+```
+
+### 使用自己的 module
+
+这里的 require 里面的 event 就是在 上一步调用 `registerModule:` 
注册 module 时候的 name
+
+```javascript
+var eventModule = weex.requireModule('event'); 
+eventModule.openURL('url',function(ret) {   
+    nativeLog(ret);
+});
+```
+
+Weex SDK 没有 图片下载,navigation 
操作的能力,请大家自己实现这些 protocol
+
+## WXImgLoaderProtocol
+
+weexSDK 没有图片下载的能力,需要实现 WXImgLoaderProtocol, 
参考下面的例子
+
+```object-c
+WXImageLoaderProtocol.h
+@protocol WXImgLoaderProtocol <WXModuleProtocol>
+/**
+* @abstract Creates a image download handler with a given URL
+* @param imageUrl The URL of the image to download
+* @param imageFrame  The frame of the image you want to set
+* @param options : The options to be used for this download
+* @param completedBlock : A block called once the download is completed.
+    image : the image which has been download to local.
+    error : the error which has happened in download.
+    finished : a Boolean value indicating whether download action has finished.
+*/
+-(id<WXImageOperationProtocol>)downloadImageWithURL:(NSString *)url 
imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)options 
completed:(void(^)(UIImage *image,  NSError *error, BOOL 
finished))completedBlock;
+@end
+```
+
+实现上述协议  
+
+```object-c
+@implementation WXImgLoaderDefaultImpl
+#pragma mark -
+#pragma mark WXImgLoaderProtocol
+
+- (id<WXImageOperationProtocol>)downloadImageWithURL:(NSString *)url 
imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)userInfo 
completed:(void(^)(UIImage *image,  NSError *error, BOOL 
finished))completedBlock
+{
+    if ([url hasPrefix:@"//"]) {
+        url = [@"http:" stringByAppendingString:url];
+    }
+    return (id<WXImageOperationProtocol>)[[SDWebImageManager sharedManager] 
downloadImageWithURL:[NSURL URLWithString:url] options:0 progress:^(NSInteger 
receivedSize, NSInteger expectedSize) {     
+    } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, 
BOOL finished, NSURL *imageURL) {
+    if (completedBlock) {
+        completedBlock(image, error, finished);
+    }
+    }];
+}
+@end
+```
+
+### handler注册
  
-   你可以通过WXSDKEngine 中的 
`registerHandler:withProtocol`注册handler
-   
-   ```object-c
-   WXSDKEngine.h
-   /**
-   * @abstract Registers a handler for a given handler instance and specific 
protocol
-   * @param handler The handler instance to register
-   * @param protocol The protocol to confirm
-   */
-   + (void)registerHandler:(id)handler withProtocol:(Protocol *)protocol;
-   
-   [WXSDKEngine registerHandler:[WXImgLoaderDefaultImpl new] 
withProtocol:@protocol(WXImgLoaderProtocol)]
-   ```
+你可以通过WXSDKEngine 中的 `registerHandler:withProtocol`注册handler
+
+```object-c
+WXSDKEngine.h
+/**
+* @abstract Registers a handler for a given handler instance and specific 
protocol
+* @param handler The handler instance to register
+* @param protocol The protocol to confirm
+*/
++ (void)registerHandler:(id)handler withProtocol:(Protocol *)protocol;
+
+[WXSDKEngine registerHandler:[WXImgLoaderDefaultImpl new] 
withProtocol:@protocol(WXImgLoaderProtocol)]
+```
 
 ## Components 扩展
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f6838783/doc/source/cn/references/components/cell.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/components/cell.md 
b/doc/source/cn/references/components/cell.md
index 8f90d9c..f4baaae 100644
--- a/doc/source/cn/references/components/cell.md
+++ b/doc/source/cn/references/components/cell.md
@@ -17,7 +17,7 @@ version: 2.1
 
 **注意:**
 
-你不能给 `<cell>` 设定`flex`值。 `<cell>`的宽度等于父组件 
`<list>` 的宽度,并且 `<cell>` 高度自适应。
+由于 `<cell>` 本身是一个容器,其布局由 `<list>` 
进行管理,你不能给 `<cell>` 设定`flex`值。 
`<cell>`的宽度等于父组件 `<list>` 的宽度,并且 `<cell>` 
高度自适应,指定 `margin` 样式也不起作用。
 
 - 通用样式:支持所有通用样式
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f6838783/doc/source/cn/references/gesture.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/gesture.md 
b/doc/source/cn/references/gesture.md
index f4d566d..be81e45 100644
--- a/doc/source/cn/references/gesture.md
+++ b/doc/source/cn/references/gesture.md
@@ -26,7 +26,8 @@ Weex 封装
了原生的触摸事件以提供手势系统。使用手势类似于
        - `panstart`
        - `panmove`
        - `panend`
-
+       - `horizontalpan` <span class="api-version">v0.10+</span>:手势的 
`start/move/end` 状态保存在 `state` 特性中。目前该手势在 Android 
下会与 click 事件冲突。
+       - `verticalpan` <span class="api-version">v0.10+</span>:势的 
`start/move/end` 状态保存在 `state` 特性中。目前该手势在 Android 
下会与 click 事件冲突。
 - **Swipe**:`swipe` 
将会在用户在屏幕上滑动时触发,一次连续的滑动只会触发一次
 `swiper` 手势。
 - **LongPress**:`LongPress` 将会在触摸点连续保持 500 
ms以上时触发。
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f6838783/doc/source/guide/intro/devtools.md
----------------------------------------------------------------------
diff --git a/doc/source/guide/intro/devtools.md 
b/doc/source/guide/intro/devtools.md
deleted file mode 100644
index f9b32b4..0000000
--- a/doc/source/guide/intro/devtools.md
+++ /dev/null
@@ -1,100 +0,0 @@
----
-title: Using Devtools  
-type: guide
-order: 5.7
-version: 2.1
----
-
-# Devtools
-
-Weex devtools is a custom devtools for weex that implements [Chrome Debugging 
Protocol](https://developer.chrome.com/devtools/docs/debugger-protocol), it is 
designed to help you quickly inspect your app and debug your JS bundle source 
in a chrome web page, both Android and IOS platform are supported.
-
-## Install
-
-```
-   $ npm install  -g  weex-toolkit
-```
-#### usage
-```
-weex debug [options] [we_file|bundles_dir]
-
-  Options:
-
-    -h, --help           output usage information
-    -V, --verbose        display logs of debugger server
-    -v, --version        display version
-    -p, --port [port]    set debugger server port
-    -e, --entry [entry]  set the entry bundlejs path when you specific the 
bundle server root path
-    -m, --mode [mode]    set build mode [transformer|loader]
-    -w, --watch          watch we file changes auto build them and refresh 
debugger page![default enabled]
-```
-
-#### start debugger
-```
-$weex debug
-```
-this command will start debug server and launch a chrome opening `DeviceList` 
page.
-this page will display a qrcode ,you can use `Playground App` scan it for 
starting debug.
-
-#### start debugger with a we file
-```
-$weex debug your_weex.we
-```
-this command will compile `your_weex.we` to `your_weex.js`  and start the 
debug server as upon command.
-`your_weex.js` will deploy on the server and displayed in `DeviceList` page as 
 another qrcode contain the url of your_weex.js
-
-
-#### start debugger with a directory of we files
-```
-$weex debug your/we/path  -e index.we
-```
-this command will build every file in your/we/path and deploy them on the 
bundle server. your directory will mapping to  http://localhost:port/weex/ 
-use -e to set the entry of these bundles. and the url of "index.we" will 
display on device list page as another qrcode.
-
-## Features
-
-### Connect devices
-![devtools-main](https://img.alicdn.com/tps/TB13fwSKFXXXXXDaXXXXXXXXXXX-887-828.png
 "connecting (multiple) devices")
-
-### Inspector
- Inspector can be used to show your `Element` \ `Network` \ `Console log` \ 
`ScreenCast` \ `BoxModel` \ `Native View` and so on.
-
-![devtools-inspector](https://img.alicdn.com/tps/TB1O.nwKFXXXXX8XpXXXXXXXXXX-1436-811.png
 "devtools-inspector")
-
-#### Element
-##### native view element
-![native-element](https://img.alicdn.com/tps/TB16L3ENXXXXXcsXVXXXXXXXXXX-2878-1798.png
 "native-element")
-
-##### weex dom element
-![dom-element](https://img.alicdn.com/tps/TB1TsMuNXXXXXcsaXXXXXXXXXXX-2450-1460.png
 "dom-element")
-
-#### Network
-
-##### show the total time and latency
-![inspector-network](https://img.alicdn.com/tps/TB1NjO_KFXXXXcaaXXXXXXXXXXX-2880-1800.png
 "inspector-network")
-
-##### show the header and response
-![inspector-network](https://img.alicdn.com/tps/TB1ck6lKFXXXXbZXFXXXXXXXXXX-2880-1800.png
 "inspector-network")
-
-#### Console
-![inspector-console](https://img.alicdn.com/tps/TB1a7HqKFXXXXXMXFXXXXXXXXXX-2880-1800.png
 "inspector-console")
-
-#### Resource
-![inspector-resource](https://img.alicdn.com/tps/TB1oY6cKFXXXXXQaXXXXXXXXXXX-2880-1800.png
 "inspector-resource")
-
-### Debugger
-
- Debugger can be used to debug your bundle js source, you can set `Breakpoint` 
\ watch `CallStack`.
- 
-![devtools-debugger](https://img.alicdn.com/tps/TB1aPTEKFXXXXXaXXXXXXXXXXXX-1436-813.png
 "devtools-debugger")
-
-#### Breakpoint and CallStack
-![debugger-breakpoint](https://img.alicdn.com/tps/TB1_trbKFXXXXc0XVXXXXXXXXXX-2880-1800.png
 "debugger-breakpoint")
-
-
-## Integrate devtools
-
-* Android
-    * See the doc [Weex devtools 
(Android)](../../references/advanced/integrate-devtool-to-android.html), it 
will lead you to config and use it step by step.
-* IOS
-    * See the doc [Weex devtools 
(iOS)](../../references/advanced/integrate-devtool-to-ios.html), it will lead 
you to config and use it step by step.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f6838783/doc/source/guide/set-up-env.md
----------------------------------------------------------------------
diff --git a/doc/source/guide/set-up-env.md b/doc/source/guide/set-up-env.md
index 338502b..71ad2fd 100644
--- a/doc/source/guide/set-up-env.md
+++ b/doc/source/guide/set-up-env.md
@@ -10,7 +10,7 @@ has_chapter_content: true
 
 Use dotWe is a good choice, But if you want to develop locally on your own 
machine, you will set up your development environment.
 
-You will need Node.js and the Weex CLi.
+You will need Node.js and the [Weex 
CLi](https://github.com/weexteam/weex-toolkit).
 
 You can installing Node using [nvm](https://github.com/creationix/nvm) (Simple 
bash script to manage multiple active node.js versions). Run the following 
commands in a Terminal after installing nvm:
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f6838783/doc/source/guide/tools/weexpack.md
----------------------------------------------------------------------
diff --git a/doc/source/guide/tools/weexpack.md 
b/doc/source/guide/tools/weexpack.md
index 699431f..dd0ee36 100644
--- a/doc/source/guide/tools/weexpack.md
+++ b/doc/source/guide/tools/weexpack.md
@@ -283,6 +283,8 @@ After all above steps, you could modify your application 
we/vue files under src
 
 
![weexpack2](https://img.alicdn.com/tps/TB18hxjPXXXXXXgapXXXXXXXXXX-248-258.png)
 
+[Plugin development 
guide](https://github.com/weexteam/weex-pack/blob/master/doc/plugin-devloping-web.md)
+
 ## Examples
 
  [Create Weex One App with 
Weexpack](https://github.com/weexteam/weex-pack/wiki/Create-Weex-One-App-with-Weexpack)

Reply via email to