From 464903988ac5e066431d55b124caad10d62a9c66 Mon Sep 17 00:00:00 2001 From: Henry Wang Date: Mon, 17 Sep 2018 16:14:49 +0100 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=96=87=E6=A1=A3=EF=BC=9A?= =?UTF-8?q?=E5=A6=82=E4=BD=95=E5=86=99=E6=96=87=E6=A1=A3=20(#729)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/joinus/README.md | 44 ++++++++++++++++++++++++++++++++++++++-- docs/joinus/README.md | 42 +++++++++++++++++++++++++++++++++++++- 2 files changed, 83 insertions(+), 3 deletions(-) diff --git a/docs/en/joinus/README.md b/docs/en/joinus/README.md index 8443c9f1d0..75deccbe93 100644 --- a/docs/en/joinus/README.md +++ b/docs/en/joinus/README.md @@ -12,9 +12,49 @@ We welcome all pull requests. Suggestions and feedback are also welcomed [here]( 1. Add the script to the corresponding directory [/routes/](https://github.com/DIYgod/RSSHub/tree/master/routes) -1. Update [README (/en/README.md) ](https://github.com/DIYgod/RSSHub/blob/master/en/README.md) and [Documentation (/docs/en/README.md) ](https://github.com/DIYgod/RSSHub/blob/master/docs/en/README.md), preview the docs via `npm run docs:dev` +1. Update [Documentation (/docs/en/README.md) ](https://github.com/DIYgod/RSSHub/blob/master/docs/en/README.md), preview the docs via `npm run docs:dev` -1. Execute `npm run format` to lint the code before you commit and open a pull request + - Documentation uses vue component: + - `name`: route name + - `author`: route authors, separated by a single space + - `example`: route example + - `path`: route path + - `:paramsDesc`: route parameters description, in array, supports markdown + 1. parameter description must be in the order of its appearance in route path + 1. missing description will cause errors in `npm run docs:dev` + 1. `'` `"` must be escaped as `\'` `\"` + 1. it's redundant to indicate `optional/required` as the component will prepend based on `?` + - Documentation examples: + + - Multiple parameters: + + ```vue + + ``` + + + + - Use component slot for complicated description: + + ```vue + + + This route returns a list of flight deals (in most cases, 6 flight deals) for a period defined by Hopper's algorithm, which means the travel date will be totally random (could be tomorrow or 10 months from now). + + For airport IATA code please refer to [Wikipedia List of airports by IATA code](https://en.wikipedia.org/wiki/List_of_airports_by_IATA_code:_A) + + + ``` + + + + This route returns a list of flight deals (in most cases, 6 flight deals) for a period defined by Hopper's algorithm, which means the travel date will be totally random (could be tomorrow or 10 months from now). + + For airport IATA code please refer to [Wikipedia List of airports by IATA code](https://en.wikipedia.org/wiki/List_of_airports_by_IATA_code:_A) + + + +1) Execute `npm run format` to lint the code before you commit and open a pull request ## Write the script diff --git a/docs/joinus/README.md b/docs/joinus/README.md index 1cbe6d2701..77f16cd861 100644 --- a/docs/joinus/README.md +++ b/docs/joinus/README.md @@ -12,7 +12,47 @@ sidebar: auto 1. 在 [/routes/](https://github.com/DIYgod/RSSHub/tree/master/routes) 中的路由对应路径添加获取 RSS 内容的脚本 -1. 更新 [README (/README.md) ](https://github.com/DIYgod/RSSHub/blob/master/README.md) 和 [文档 (/docs/README.md) ](https://github.com/DIYgod/RSSHub/blob/master/docs/README.md), 可以执行 `npm run docs:dev` 查看文档效果 +1. 更新 [文档 (/docs/README.md) ](https://github.com/DIYgod/RSSHub/blob/master/docs/README.md), 可以执行 `npm run docs:dev` 查看文档效果 + + - 文档采用 vue 组件形式, 格式如下: + - `name`: 路由名称 + - `author`: 路由作者, 多位作者使用单个空格分隔 + - `example`: 路由举例 + - `path`: 路由路径 + - `:paramsDesc`: 路由参数说明, 数组, 支持 markdown + 1. 参数说明必须对应其在路径中出现的顺序 + 1. 如缺少说明将会导致`npm run docs:dev`报错 + 1. 说明中的 `'` `"` 必须通过反斜杠转义 `\'` `\"` + 1. 不必在说明中标注`可选/必选`, 组件根据`?`自动判断 + - 文档样例: + + - 多参数: + + ```vue + + ``` + + + + - 复杂说明支持 slot: + + ```vue + + + | 前端 | Android | iOS | 后端 | 设计 | 产品 | 工具资源 | 阅读 | 人工智能 | + | -------- | ------- | --- | ------- | ------ | ------- | -------- | ------- | -------- | + | frontend | android | ios | backend | design | product | freebie | article | ai | + + + ``` + + + + | 前端 | Android | iOS | 后端 | 设计 | 产品 | 工具资源 | 阅读 | 人工智能 | + | -------- | ------- | --- | ------- | ------ | ------- | -------- | ------- | -------- | + | frontend | android | ios | backend | design | product | freebie | article | ai | + + 1. 执行 `npm run format` 自动处理代码格式后, 提交代码, 然后提交 pull request