From d38ac7aed3975f54e3f9c4adb65e18dc30f92c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TZ=20=7C=20=E5=A4=A9=E7=8C=AA?= Date: Thu, 19 Jan 2017 14:03:47 +0800 Subject: [PATCH] docs: add progressive link && adjust en docs directory (#275) --- docs/source/{en-us => en}/basics/app-start.md | 0 docs/source/en/intro/quickstart.md | 12 ++++++------ docs/source/zh-cn/advanced/framework.md | 2 ++ docs/source/zh-cn/intro/quickstart.md | 17 +++++++++-------- docs/source/zh-cn/tutorials/progressive.md | 2 +- docs/themes/egg/layout/index.swig | 2 +- 6 files changed, 19 insertions(+), 16 deletions(-) rename docs/source/{en-us => en}/basics/app-start.md (100%) diff --git a/docs/source/en-us/basics/app-start.md b/docs/source/en/basics/app-start.md similarity index 100% rename from docs/source/en-us/basics/app-start.md rename to docs/source/en/basics/app-start.md diff --git a/docs/source/en/intro/quickstart.md b/docs/source/en/intro/quickstart.md index 8c31dcf3c8..1679683e42 100644 --- a/docs/source/en/intro/quickstart.md +++ b/docs/source/en/intro/quickstart.md @@ -244,7 +244,7 @@ And also add config. ```js // config/config.default.js -config.news = { +exports.news = { pageSize: 5, serverUrl: 'https://hacker-news.firebaseio.com/v0', }; @@ -403,12 +403,12 @@ That is all of it, for more detail, see [Unit Testing](../core/unittest.md). ## Conclusions -We can only touch the tip of the iceberg of Egg -with the above short sections. -We recommend that developers continue reading other documents: +We can only touch the tip of the iceberg of Egg with the above short sections. +Where to go from here? Browse our documentation to better understand the framework. - Egg provides a powerful mechanism for extending features. See [Plug-ins](../advanced/plugin.md). -- As large teams need to follow certain constraints and conventions, in egg, we recommend further creating an upper-level framework that fits your team. See [Frameworks](../advanced/framework.md). -- In Egg, writing unit tests is highly recommended, and it actually turns out to be very straightforward. See [Unit Testing](../core/test.md). +- Egg framework allows small or large teams to work together as fast as possible under the well-documented conventions and coding best practices. In addition, the teams can build up logics on top of the framework to better suited their special needs. See more on [Frameworks].(../advanced/framework.md). +- Egg framework provides code reusabilities and modularities. See details at [Progressive](../tutorials/progressive.md). +- Egg framework enables developers to write painless unit testing with many plugins and community-powered toolings. The team should give it a try by using Egg unit testing without worrying about setting up the testing tooling but writing the testing logics. See [Unit Testing](../core/test.md). [nvm]: http://gitlab.alibaba-inc.com/node/nvm [nvs]: https://github.com/jasongin/nvs diff --git a/docs/source/zh-cn/advanced/framework.md b/docs/source/zh-cn/advanced/framework.md index cf3ff21b63..9e721f0e1d 100644 --- a/docs/source/zh-cn/advanced/framework.md +++ b/docs/source/zh-cn/advanced/framework.md @@ -18,6 +18,8 @@ title: 框架开发 这样,整个团队就可以遵循统一的方案,并且在项目中可以根据业务场景自行使用插件做差异化,当后者验证为最佳实践后,就能下沉到框架中,其他项目仅需简单的升级下框架的版本即可享受到。 +具体可以参见[渐进式开发](../tutorials/progressive.md)。 + ## 框架与多进程 框架的扩展是和多进程模型有关的,我们已经知道[多进程模型](./cluster.md),也知道 Agent Worker 和 App Worker 的区别,所以我们需要扩展的类也有两个 Agent 和 Application,而这两个类的 API 不一定相同。 diff --git a/docs/source/zh-cn/intro/quickstart.md b/docs/source/zh-cn/intro/quickstart.md index 3ad5ecbcd7..26800d3af6 100644 --- a/docs/source/zh-cn/intro/quickstart.md +++ b/docs/source/zh-cn/intro/quickstart.md @@ -123,7 +123,7 @@ exports.view = { }; ``` -为列表页编写模板文件,一般放置在 app/view 目录下 +为列表页编写模板文件,一般放置在 `app/view` 目录下 ``` html @@ -221,7 +221,7 @@ exports.list = function* newsList() { ```js // config/config.default.js -config.news = { +exports.news = { pageSize: 5, serverUrl: 'https://hacker-news.firebaseio.com/v0', }; @@ -231,7 +231,7 @@ config.news = { 遇到一个小问题,我们的资讯时间的数据是 UnixTime 格式的,我们希望显示为便于阅读的格式。 -框架提供了一种快速扩展的方式,只需在 `app/extend` 目录下提供扩展脚本即可,具体参见 [扩展](../basics/extend.md)。 +框架提供了一种快速扩展的方式,只需在 `app/extend` 目录下提供扩展脚本即可,具体参见[扩展](../basics/extend.md)。 在这里,我们可以使用 view 插件支持的 helper 来实现: @@ -291,7 +291,7 @@ exports.robot = { - 支持按环境变量加载不同的配置文件,如 `config.local.js`, `config.prod.js` 等等。 - 应用/插件/框架都可以配置自己的配置文件,框架将按顺序合并加载。 -- 具体合并逻辑可参见 [配置文件](../basics/config.md)。 +- 具体合并逻辑可参见[配置文件](../basics/config.md)。 ```js // config/config.default.js @@ -368,15 +368,16 @@ $ npm i egg-mock supertest --save-dev $ npm test ``` -就这么简单,更多请参见 [单元测试](../core/unittest.md)。 +就这么简单,更多请参见[单元测试](../core/unittest.md)。 ## 后记 短短几章内容,只能讲 egg 的冰山一角,我们建议开发者继续阅读其他章节: -- 提供了强大的扩展机制,参见 [插件开发](../advanced/plugin.md)。 -- 一个大规模的团队需要遵循一定的约束和约定,在 egg 里我们建议封装适合自己团队的上层框架,参见 [框架开发](../advanced/framework.md)。 -- 写单元测试其实很简单的事,egg 也提供了非常多的配套辅助,我们强烈建议大家测试驱动开发,具体参见 [单元测试](../core/unittest.md)。 +- 提供了强大的扩展机制,参见[插件开发](../advanced/plugin.md)。 +- 一个大规模的团队需要遵循一定的约束和约定,在 egg 里我们建议封装适合自己团队的上层框架,参见[框架开发](../advanced/framework.md)。 +- 这是一个渐进式的框架,代码的共建,复用和下沉,竟然可以这么的无痛,建议阅读[渐进式开发](../tutorials/progressive.md)。 +- 写单元测试其实很简单的事,egg 也提供了非常多的配套辅助,我们强烈建议大家测试驱动开发,具体参见[单元测试](../core/unittest.md)。 [nvm]: http://gitlab.alibaba-inc.com/node/nvm [nvs]: https://github.com/jasongin/nvs diff --git a/docs/source/zh-cn/tutorials/progressive.md b/docs/source/zh-cn/tutorials/progressive.md index 15d5967aaa..524b453e0b 100644 --- a/docs/source/zh-cn/tutorials/progressive.md +++ b/docs/source/zh-cn/tutorials/progressive.md @@ -5,7 +5,7 @@ title: 渐进式开发 本文将以实例的方式,一步步给大家演示下,如何渐进式地进行代码演进。 -全部的示例代码可以参见 [eggjs/examples/progressive](https://github.com/eggjs/examples/progressive)。 +全部的示例代码可以参见 [eggjs/examples/progressive](https://github.com/eggjs/examples/tree/master/progressive)。 ## 最初始的状态 diff --git a/docs/themes/egg/layout/index.swig b/docs/themes/egg/layout/index.swig index e7f3374a35..5c9d3d87ef 100644 --- a/docs/themes/egg/layout/index.swig +++ b/docs/themes/egg/layout/index.swig @@ -8,7 +8,7 @@
- Latest: 0.7.0 + Latest: 0.8.0 Node.js >= 6.0.0