Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
Update url validator to scan local path and fix 404 local path (#118)
Browse files Browse the repository at this point in the history
close #105
  • Loading branch information
Hanks10100 committed Mar 22, 2018
2 parents 4dedcdf + 15a0788 commit da4a81e
Show file tree
Hide file tree
Showing 52 changed files with 203 additions and 148 deletions.
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"find-line-column": "^0.5.2",
"glob": "^7.1.2",
"node-fetch": "^2.1.1",
"string-similarity": "^1.2.0",
"url-extractor": "^2.0.2"
}
}
8 changes: 4 additions & 4 deletions source/cn/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Weex 的另一个主要目标是跟进当代先进的 Web 开发和原生开发

![Weex Example](../../guide/images/weex-example-yo.png)

这个例子在屏幕正中间渲染了一个单词 “Yo”。 如果你想在移动设备上预览渲染结果,你只需要安装[Weex playground app](https://weex.apache.org/cn/tools/playground.html) 或将 Weex SDK 集成到您自己的应用程序中,然后使用扫描网页右侧的二维码。
这个例子在屏幕正中间渲染了一个单词 “Yo”。 如果你想在移动设备上预览渲染结果,你只需要安装[Weex playground app](/cn/tools/playground.html) 或将 Weex SDK 集成到您自己的应用程序中,然后使用扫描网页右侧的二维码。

在源代码的 `<template>` 中,`<div>` 你应该很熟悉了,它在 Weex 平台上也是一个通用容器。但是 `<text>` 组件是由 Weex 特有的,它是一个块级的文本容器,可以用来渲染文字。

Expand Down Expand Up @@ -83,13 +83,13 @@ Weex 可以只编写一份代码,开发出三端都可用的页面。

> Vue.js 和 Rax 都已经集成进了 Weex SDK,你不需要再额外引入。
然而 Weex 也不是只支持 Vue 和 Rax,你也可以把自己喜欢的前端框架集成到 Weex 中。有一个文档*[扩展前端框架](./advanced/extend-js-framework.html)*描述了如何实现,但是这个过程仍然非常复杂和棘手,你需要了解关于 js-native 之间通信和原生渲染引擎的许多底层细节。
然而 Weex 也不是只支持 Vue 和 Rax,你也可以把自己喜欢的前端框架集成到 Weex 中。有一个文档*[扩展前端框架](/cn/guide/extend-js-framework.html)*描述了如何实现,但是这个过程仍然非常复杂和棘手,你需要了解关于 js-native 之间通信和原生渲染引擎的许多底层细节。

## 创建一个 App

> 以下步骤假设您已经了解了 Node.js 和 npm 的基本知识。如果对它们不熟悉,可以访问 [https://docs.npmjs.com/](https://docs.npmjs.com/) 来了解更多关于 npm 的用法。
Weex 提供了一个命令行工具 [weex-toolkit](http://weex-project.io/tools/toolkit.html) 来帮助开发者使用 Weex。它可以用来快速创建一个空项目、初始化 iOS 和 Android 开发环境、调试、安装插件等操作。
Weex 提供了一个命令行工具 [weex-toolkit](/cn/tools/toolkit.html) 来帮助开发者使用 Weex。它可以用来快速创建一个空项目、初始化 iOS 和 Android 开发环境、调试、安装插件等操作。

目前 `weex-toolkit` 只支持创建 Vue.js 的项目。创建 Rax 的项目可以使用 `rax-cli`,参考 [Rax 的官方网站](https://alibaba.github.io/rax/) 了解其用法。

Expand Down Expand Up @@ -123,7 +123,7 @@ npm start

![Preview](../../guide/images/toolkit-preview.png)

除此之外,你还可以打开 `http://localhost:8081/preview.html` 开启一个预览页面,它会把 web 端的页面放在一个 iframe 中渲染,而且在右侧生成一个二维码。用 [Weex playground app](http://weex-project.io/playground.html) 扫描这个二维码可以看到页面在手机上渲染的真实效果。
除此之外,你还可以打开 `http://localhost:8081/preview.html` 开启一个预览页面,它会把 web 端的页面放在一个 iframe 中渲染,而且在右侧生成一个二维码。用 [Weex playground app](/cn/tools/playground.html) 扫描这个二维码可以看到页面在手机上渲染的真实效果。

### 编译和运行

Expand Down
2 changes: 1 addition & 1 deletion source/cn/guide/use-vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Vue 中的[单文件组件](https://cn.vuejs.org/v2/guide/single-file-components

### 使用weex-loader

[weex-loader](https://github.com/weexteam/weex-loader) 是一个 webpack 的 [loader](https://webpack.js.org/concepts/loaders/#using-loaders),它能把`*.vue`文件转化为简单的javascript 模块用于安卓以及 iOS 平台。所有的特性和配置都是跟 [vue-loader](https://vue-loader.vuejs.org/en/) 一样的。
[weex-loader](https://github.com/weexteam/weex-loader) 是一个 webpack 的 [loader](http://webpack.github.io/docs/using-loaders.html),它能把`*.vue`文件转化为简单的javascript 模块用于安卓以及 iOS 平台。所有的特性和配置都是跟 [vue-loader](https://vue-loader.vuejs.org/en/) 一样的。

需要注意的是,如果您的Webpack配置的*entry*选项是一个`*.vue`文件的话,你仍需要传递一个额外的`entry`参数。

Expand Down
4 changes: 2 additions & 2 deletions source/cn/references/components/cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ version: 2.1
- `opacity`
- `background-color`

查看 [组件通用样式](../common-style.html)
查看 [组件通用样式](/cn/wiki/common-styles.html)

## 事件

Expand All @@ -44,7 +44,7 @@ version: 2.1
- `appear`
- `disappear`

查看 [通用事件](../common-event.html)
查看 [通用事件](/cn/wiki/common-events.html)

## 示例

Expand Down
4 changes: 2 additions & 2 deletions source/cn/references/components/div.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ version: 2.1
- `opacity`
- `background-color`

查看 [组件通用样式](../common-style.html)
查看 [组件通用样式](/cn/wiki/common-styles.html)

## 事件

Expand All @@ -62,7 +62,7 @@ version: 2.1
- `appear`
- `disappear`

查看 [通用事件](../common-event.html)
查看 [通用事件](/cn/wiki/common-events.html)

## 约束

Expand Down
4 changes: 2 additions & 2 deletions source/cn/references/components/indicator.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ version: 2.1
- `opacity`
- `background-color`

查看 [组件通用样式](../common-style.html)
查看 [组件通用样式](/cn/wiki/common-styles.html)

**注意 1:**

Expand All @@ -51,7 +51,7 @@ version: 2.1
- `appear`
- `disappear`

查看 [通用事件](../common-event.html)
查看 [通用事件](/cn/wiki/common-events.html)

## 约束

Expand Down
6 changes: 3 additions & 3 deletions source/cn/references/components/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Weex 内置的 `<input>` 组件用来创建接收用户输入字符的输入组
- 支持 `font-weight`
- 支持 `text-align`

查看 [文本样式](../text-style.html)
查看 [文本样式](/cn/wiki/text-styles.html)

- 通用样式:支持所有通用样式
- 盒模型
Expand All @@ -61,7 +61,7 @@ Weex 内置的 `<input>` 组件用来创建接收用户输入字符的输入组
- `opacity`
- `background-color`

查看 [组件通用样式](../common-style.html)
查看 [组件通用样式](/cn/wiki/common-styles.html)

## 事件

Expand Down Expand Up @@ -109,7 +109,7 @@ Weex 内置的 `<input>` 组件用来创建接收用户输入字符的输入组
- `appear`
- `disappear`

查看 [通用事件](../common-event.html)
查看 [通用事件](/cn/wiki/common-events.html)



Expand Down
4 changes: 2 additions & 2 deletions source/cn/references/components/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ version: 2.1
- `opacity`
- `background-color`

查看 [组件通用样式](../common-style.html)
查看 [组件通用样式](/cn/wiki/common-styles.html)

## 事件

Expand All @@ -85,7 +85,7 @@ version: 2.1
- `appear`
- `disappear`

查看 [通用事件](../common-event.html)
查看 [通用事件](/cn/wiki/common-events.html)

## 扩展

Expand Down
2 changes: 1 addition & 1 deletion source/cn/references/components/loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ version: 2.1

## 样式

- 支持所有通用样式。查看 [组件通用样式](../common-style.html)
- 支持所有通用样式。查看 [组件通用样式](/cn/wiki/common-styles.html)

## 事件

Expand Down
2 changes: 1 addition & 1 deletion source/cn/references/components/refresh.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ version: 2.1

## 样式

- 支持所有通用样式。查看 [组件通用样式](../common-style.html)
- 支持所有通用样式。查看 [组件通用样式](/cn/wiki/common-styles.html)

## 事件

Expand Down
4 changes: 2 additions & 2 deletions source/cn/references/components/scroller.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ version: 2.1
- `opacity`
- `background-color`

查看 [组件通用样式](../common-style.html)
查看 [组件通用样式](/cn/wiki/common-styles.html)

## 事件

Expand All @@ -84,7 +84,7 @@ version: 2.1
- `appear`
- `disappear`

查看 [通用事件](../common-event.html)
查看 [通用事件](/cn/wiki/common-events.html)

## 扩展

Expand Down
4 changes: 2 additions & 2 deletions source/cn/references/components/slider.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ version: 2.1
- `opacity`
- `background-color`

查看 [组件通用样式](../common-style.html)
查看 [组件通用样式](/cn/wiki/common-styles.html)

## 事件

Expand All @@ -66,7 +66,7 @@ version: 2.1
- `appear`
- `disappear`

查看 [通用事件](../common-event.html)
查看 [通用事件](/cn/wiki/common-events.html)

## 示例

Expand Down
4 changes: 2 additions & 2 deletions source/cn/references/components/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ version: 2.1
- `appear`
- `disappear`

查看 [通用事件](../common-event.html)
查看 [通用事件](/cn/wiki/common-events.html)

## 样式

Expand All @@ -89,7 +89,7 @@ version: 2.1
- `opacity`
- `background-color`

查看 [组件通用样式](../common-style.html)
查看 [组件通用样式](/cn/wiki/common-styles.html)


## 使用说明
Expand Down
2 changes: 1 addition & 1 deletion source/cn/references/components/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ version: 2.1
## 样式
* 支持 **[通用样式](../../wiki/common-styles.html)**
* `lines {number}`: 指定文本行数。默认值是 `0`, 代表不限制行数。
* 支持 **[文本样式](../wiki/text-style.html)**
* 支持 **[文本样式](/cn/wiki/text-styles.html)**
* 支持 `color` 样式.
* 支持 `font-size` 样式,默认值为`32`.
* 支持 `font-style` 样式.
Expand Down
6 changes: 3 additions & 3 deletions source/cn/references/components/textarea.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ version: 2.1
- 支持 `font-weight`
- 支持 `text-align`

查看 [文本样式](../text-style.html)
查看 [文本样式](/cn/wiki/text-styles.html)

- 通用样式:支持所有通用样式

Expand All @@ -48,7 +48,7 @@ version: 2.1
- `opacity`
- `background-color`

查看 [组件通用样式](../common-style.html)
查看 [组件通用样式](/cn/wiki/common-styles.html)

## 事件

Expand Down Expand Up @@ -90,7 +90,7 @@ version: 2.1
- `appear`
- `disappear`

查看 [通用事件](../common-event.html)
查看 [通用事件](/cn/wiki/common-events.html)

## 示例

Expand Down
2 changes: 1 addition & 1 deletion source/cn/references/components/video.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ version: 2.1
- `opacity`
- `background-color`

查看 [组件通用样式](../common-style.html)
查看 [组件通用样式](/cn/wiki/common-styles.html)

## 事件

Expand Down
4 changes: 2 additions & 2 deletions source/cn/references/components/waterfall.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ version: 2.1
- `opacity`
- `background-color`

查看 [组件通用样式](../common-style.html)
查看 [组件通用样式](/cn/wiki/common-styles.html)

### 事件

Expand All @@ -54,7 +54,7 @@ version: 2.1
- `appear`
- `disappear`

查看 [通用事件](../common-event.html)
查看 [通用事件](/cn/wiki/common-events.html)

### API

Expand Down
1 change: 1 addition & 0 deletions source/cn/references/modules/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,4 @@ version: 2.1
## 其它参考

* [W3school: html5 localStorage](http://www.w3school.com.cn/html5/html_5_webstorage.asp)
* [storage 模块完整的 Demo](https://github.com/apache/incubator-weex/blob/dev/examples/module/storage-demo.we)
4 changes: 2 additions & 2 deletions source/cn/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 2.1

# 开发工具

+ [Playground App](./playground.html)
+ [Playground App](/tools/playground.html)
+ [Online Playground](http://dotwe.org/vue/)
+ [weex-toolkit](./toolkit.html)
+ [Weex Language Support插件](./plugin.html)
+ [Weex Language Support插件](/cn/tools/helpers.html)
21 changes: 11 additions & 10 deletions source/cn/tools/toolkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ weex-toolkit工具支持对你的Weex文件(`.we`或`.vue`)在监听模式下
$ weex preview src/foo.vue
```

浏览器会自动得打开预览页面并且你可以看到你的weex页面的布局和效果。如果你在你的设备上安装了[Playground](https://weex.apache.org/cn/tools/playground.html),你还可以通过扫描页面上的二维码来查看页面。
浏览器会自动得打开预览页面并且你可以看到你的weex页面的布局和效果。如果你在你的设备上安装了[Playground](/cn/tools/playground.html),你还可以通过扫描页面上的二维码来查看页面。

使用下面的命令,你将可以预览整个文件夹中的`.vue`文件

Expand All @@ -70,7 +70,7 @@ $ weex compile [source] [dist] [options]

#### 参数

| Option | Description |
| Option | Description |
| -------- | :----- |
|`-w, --watch` | 开启watch模式,同步文件改动并进行编译|
|`-d,--devtool [devtool]`|设置devtool选项|
Expand Down Expand Up @@ -106,7 +106,7 @@ $ weex run web

### debug

** [Weex devtools](https://github.com/weexteam/weex-devtool) ** 是实现[Chrome调试协议](https://developer.chrome.com/devtools/docs/debugger-protocol)的Weex自定义开发工具,
** [Weex devtools](https://github.com/weexteam/weex-devtool) ** 是实现[Chrome调试协议](https://developer.chrome.com/devtools/docs/debugger-protocol)的Weex自定义开发工具,
主要用于帮助你快速检查您的应用程序,并在Chrome网页中调试您的JS bundle源代码,支持Android和iOS平台。所以你可以通过`weex-toolkit`使用的`weex-devtool`功能。

#### 用法
Expand All @@ -117,7 +117,7 @@ weex debug [we_file|bundles_dir] [options]

#### 参数

| Option | Description |
| Option | Description |
| -------- | :----- |
|`-v, --version`| 显示weex-debugger版本信息|
|`-h, --help`| 展示帮助信息 |
Expand Down Expand Up @@ -147,7 +147,7 @@ $ weex debugx

##### 链接设备

请使用[weex playground app](http://weex.apache.org/tools/playground.html)扫码或使用集成了weex-devtool的app进行扫码,集成方法见[集成devtool工具](#集成devtool工具)。有ios模拟器环境的用户也可以通过点击二维码的方式进行模拟器调试(仅限mac用户使用)。
请使用[weex playground app](/tools/playground.html)扫码或使用集成了weex-devtool的app进行扫码,集成方法见[集成devtool工具](#集成devtool工具)。有ios模拟器环境的用户也可以通过点击二维码的方式进行模拟器调试(仅限mac用户使用)。

![debugger-main](https://img.alicdn.com/tfs/TB1v.PqbmBYBeNjy0FeXXbnmFXa-1886-993.png)

Expand Down Expand Up @@ -184,20 +184,21 @@ $ weex debug your_weex.vue
##### LogLevel和ElementMode功能
> LogLevel和ElementMode功能用于调整调试工具的输出配置。
LogLevel分别有 debug/info/warn/log/error五个log等级,切换可输出不同等级的log信息
ElementMode可以切换Element标签中Domtree显示模式,下图为vdom显示界面,可从标签中看到详细的数据结构:
LogLevel分别有 debug/info/warn/log/error五个log等级,切换可输出不同等级的log信息
ElementMode可以切换Element标签中Domtree显示模式,下图为vdom显示界面,可从标签中看到详细的数据结构:
![loglevel-elementMode](https://img.alicdn.com/tfs/TB1qzrObntYBeNjy1XdXXXXyVXa-2872-1636.png)


##### Prophet功能(加载时序图)
> Prophet功能用于查看weex的加载时序图和页面性能指标。
点击右上角Prophet即可查看时序图(iOS暂不支持,性能数据可在log的performance中查看),如下:
点击右上角Prophet即可查看时序图(iOS暂不支持,性能数据可在log的performance中查看),如下:
![prophet](https://img.alicdn.com/tfs/TB1E4rObntYBeNjy1XdXXXXyVXa-2852-1626.png)


#### 集成devtool工具
* Android
* 查看文档 [Weex devtools (Android)](../../references/advanced/integrate-devtool-to-android.html), 它会引导你一步一步配置和使用它。
* 查看文档 [Weex devtools (Android)](/cn/guide/integrate-devtool-to-android.html), 它会引导你一步一步配置和使用它。
* iOS
* 查看文档 [Weex devtools (iOS)](../../references/advanced/integrate-devtool-to-ios.html), 它会引导你一步一步配置和使用它。
* 查看文档 [Weex devtools (iOS)](/cn/guide/integrate-devtool-to-ios.html), 它会引导你一步一步配置和使用它。
和使用它。
2 changes: 1 addition & 1 deletion source/cn/wiki/css-units.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ version: 2.1

## CSS `number` 单位

仅仅一个数字。用于 [`opacity`](./common-style.html)[`lines`](./text-style.html)等。
仅仅一个数字。用于 [`opacity`](./common-styles.html)[`lines`](./text-styles.html)等。

有时值必须是整数,例如:`lines`

Expand Down
Loading

0 comments on commit da4a81e

Please sign in to comment.