Commit ba852c4269bdc33dd481174c522729158f4f9e31
1 parent
f7066b3b
docs: fix typo
Showing
8 changed files
with
57 additions
and
102 deletions
README.md
| ... | ... | @@ -75,8 +75,6 @@ wget -qO- https://raw.githubusercontent.com/ly525/luban-h5/dev/deploy/ubuntu-ins |
| 75 | 75 | ### Demo |
| 76 | 76 | > [在线访问地址](https://h5.luban-h5.com) |
| 77 | 77 | |
| 78 | -> [更多作品演示图片,点击查看](https://github.com/ly525/luban-h5/issues/15) | |
| 79 | - | |
| 80 | 78 | <img src="https://s2.ax1x.com/2019/10/11/u7WzUx.gif" style="margin: 10px;" width="60%" /> |
| 81 | 79 | |
| 82 | 80 | ... | ... |
docs/en/getting-started/introduction.md
| ... | ... | @@ -53,24 +53,17 @@ |
| 53 | 53 | |
| 54 | 54 | --- |
| 55 | 55 | |
| 56 | -### Installs | |
| 57 | -> proj: project root path | |
| 58 | -please refer to: [`Document/Quick Start`](https://ly525.github.io/luban-h5/en/getting-started/quick-start.html?language=en-us) | |
| 59 | - | |
| 60 | - | |
| 61 | ---- | |
| 62 | -### More Explanation | |
| 63 | -#### Front-End Component Explanation | |
| 64 | -1. `lbp-`: `lu-ban-plugin-`, means `Luban H5 plugin`, location: `proj/front-end/h5/src/components/plugins` | |
| 56 | +### Installation | |
| 57 | +please refer to: [`Quick Start`](https://ly525.github.io/luban-h5/en/getting-started/quick-start.html?language=en-us) | |
| 65 | 58 | |
| 66 | 59 | |
| 67 | 60 | #### Build With (current) |
| 68 | - 1. Front end: Vue.js | |
| 69 | - 2. Back End: Strapi | |
| 70 | - 3. Storage: Sqlite | |
| 61 | +- Front end: Vue.js | |
| 62 | +- Back End: Strapi | |
| 63 | +- Storage: Sqlite | |
| 71 | 64 | |
| 72 | 65 | |
| 73 | -Read more here [Online English Document](https://ly525.github.io/luban-h5) | |
| 66 | +Read more here [English Document](https://ly525.github.io/luban-h5) | |
| 74 | 67 | |
| 75 | 68 | --- |
| 76 | 69 | ... | ... |
docs/en/getting-started/quick-start.md
| 1 | 1 | # Quick Start |
| 2 | - | |
| 3 | - | |
| 4 | -> if you are familiar with `Node`, `Yarn`(and already installed), please follow the commands to start quickly: | |
| 5 | - | |
| 6 | -> if you are not familiar with the tech stack, please read the following detailed tutorial | |
| 2 | +- if you are familiar with `Node`, `Yarn`(and already installed), please follow the commands to start quickly: | |
| 3 | +- if you are not familiar with the tech stack, please read the following detailed tutorial | |
| 7 | 4 | |
| 8 | 5 | ```bash |
| 6 | +# back-end | |
| 9 | 7 | cd back-end/h5-api && yarn && yarn dev |
| 10 | 8 | |
| 9 | +# front-end | |
| 11 | 10 | # open a new terminal and goto the project root path |
| 12 | - | |
| 13 | 11 | cd front-end/h5 && yarn && yarn build:engine && yarn dev |
| 14 | 12 | ``` |
| 15 | 13 | |
| ... | ... | @@ -33,11 +31,9 @@ Vue.js: Front-end framework<br />Strapi.js: Open source Node.js Headless CMS to |
| 33 | 31 | |
| 34 | 32 | |
| 35 | 33 | # Setup |
| 36 | - | |
| 37 | -1. the API is powered by strapi.js | |
| 34 | +> the API is powered by [strapi.js](https://strapi.io/) | |
| 38 | 35 | |
| 39 | 36 | ## Setup backend |
| 40 | - | |
| 41 | 37 | ### 1. quick start |
| 42 | 38 | ```bash |
| 43 | 39 | # by default, the current path is the root path for luban-h5 |
| ... | ... | @@ -47,12 +43,12 @@ cd back-end/h5-api |
| 47 | 43 | yarn install # install dependencies |
| 48 | 44 | |
| 49 | 45 | yarn dev # dev |
| 50 | -# additional notes: run `yarn localdev` if you want to debug it in vscode | |
| 46 | +# additional notes: | |
| 47 | +# if you want to debug it in vscode, please run `yarn localdev` | |
| 51 | 48 | |
| 52 | 49 | #!en: default database is sqlite3(db location: h5-api/.tmp/data.db) |
| 53 | 50 | |
| 54 | -# visit http://locahost:1337/admin | |
| 55 | - | |
| 51 | +# visit http://localhost:1337/admin | |
| 56 | 52 | Please read on to config the strapi admin |
| 57 | 53 | ``` |
| 58 | 54 | |
| ... | ... | @@ -68,14 +64,6 @@ Please read on to config the strapi admin |
| 68 | 64 | ##### Used for upload work cover |
| 69 | 65 |  |
| 70 | 66 | |
| 71 | -2. `ctx.render is not a function` <br />solution:`Setup backend/quick start/strap-hook-ejs` | |
| 72 | - | |
| 73 | -<br /> | |
| 74 | -```javascript | |
| 75 | -error TypeError: ctx.render is not a function | |
| 76 | - at previewOne (~/luban-h5/back-end/h5-api/api/work/controllers/Work.js:13:16) | |
| 77 | -``` | |
| 78 | - | |
| 79 | 67 | |
| 80 | 68 | ## setup front-end |
| 81 | 69 | |
| ... | ... | @@ -89,10 +77,10 @@ cd front-end/h5 && yarn && yarn build:engine && yarn dev |
| 89 | 77 | ``` |
| 90 | 78 | |
| 91 | 79 | ### 2. build preview engine |
| 80 | +- just run `cd front-end/h5 && yarn && yarn build:engine` | |
| 92 | 81 | |
| 93 | -#### Basic | |
| 94 | -[luban-h5/back-end/h5-api/api/work/controllers/Work.js/previewOne](https://github.com/ly525/luban-h5/blob/bd486ce16fc24bfd7030fc51857a579776e12e68/back-end/h5-api/api/work/controllers/Work.js#L12) | |
| 95 | - | |
| 82 | +#### 2.1 Basic(TLDR) | |
| 83 | +[previewOne](https://github.com/ly525/luban-h5/blob/bd486ce16fc24bfd7030fc51857a579776e12e68/back-end/h5-api/api/work/controllers/Work.js#L12), here is the key code: | |
| 96 | 84 | |
| 97 | 85 | ```js |
| 98 | 86 | previewOne: async (ctx) => { |
| ... | ... | @@ -101,13 +89,7 @@ previewOne: async (ctx) => { |
| 101 | 89 | }, |
| 102 | 90 | ``` |
| 103 | 91 | |
| 104 | -#### How to build preview engine | |
| 92 | +#### 2.2 How to build preview engine(TLDR) | |
| 105 | 93 | 1. cd `front-end/h5`, run `yarn build:engine` |
| 106 | 94 | 2. after build finished, an folder named `engine-assets` is auto generated at `back-end/h5-api/public` |
| 107 | 95 | 3. `preview.vue` is preview modal, the mobile div is an iframe which a wrapper for builded `engine-entry`, learn more about engine here: `luban-h5/front-end/h5/vue.config.js` |
| 108 | - | |
| 109 | - | |
| 110 | -### 3. explanation for front-end components | |
| 111 | - | |
| 112 | -1. `lbp-` | |
| 113 | -> `lu-ban-plugin: plugins for luban-h5`:location: `front-end/h5/src/components/plugins` | ... | ... |
docs/en/implementation/code-structure.md
| ... | ... | @@ -81,7 +81,7 @@ front-end/h5/src # source code for front end, includes: editor, w |
| 81 | 81 | │ │ ├── index.vue |
| 82 | 82 | │ │ └── list.vue |
| 83 | 83 | │ ├── About.vue |
| 84 | -│ ├── Editor.vue # a wrapper around the core editor, where the list of plug-ins is loaded | |
| 84 | +│ ├── Editor.vue # a wrapper around the core editor, where the list of plugins is loaded | |
| 85 | 85 | │ └── Home.vue |
| 86 | 86 | ├── App.vue |
| 87 | 87 | ├── engine-entry.js # preview engine for previewing and viewing mobie page on your phone |
| ... | ... | @@ -90,6 +90,13 @@ front-end/h5/src # source code for front end, includes: editor, w |
| 90 | 90 | └── router.js # |
| 91 | 91 | ``` |
| 92 | 92 | |
| 93 | + | |
| 94 | +## explanation for front-end components | |
| 95 | +1. `lbp-` | |
| 96 | + - means `lu-ban-plugin: plugins for luban-h5` | |
| 97 | + - location `front-end/h5/src/components/plugins` | |
| 98 | + | |
| 99 | + | |
| 93 | 100 | --- |
| 94 | 101 | |
| 95 | 102 | <Vssue issueId="9" /> | ... | ... |
docs/zh/README.md
docs/zh/getting-started/introduction.md
| 1 | -<!-- | |
| 2 | - * @Author: ly525 | |
| 3 | - * @Date: 2019-12-01 18:11:49 | |
| 4 | - * @LastEditors: ly525 | |
| 5 | - * @LastEditTime: 2019-12-04 20:31:22 | |
| 6 | - * @FilePath: /luban-h5/docs/zh/getting-started/introduction.md | |
| 7 | - * @Github: https://github.com/ly525/luban-h5 | |
| 8 | - * @Description: Do not edit | |
| 9 | - * @Copyright 2018 - 2019 luban-h5. All Rights Reserved | |
| 10 | - --> | |
| 11 | 1 | # 简介 |
| 12 | 2 | |
| 13 | 3 | <!-- 简体中文 | [English](./README.en.md) --> |
| 14 | 4 | |
| 15 | -目录 | |
| 16 | -[[toc]] | |
| 5 | +<!-- 目录 | |
| 6 | +[[toc]] --> | |
| 17 | 7 | |
| 18 | 8 | <!-- 目录 |
| 19 | 9 | - [鲁班H5是什么?](#%E9%B2%81%E7%8F%ADh5%E6%98%AF%E4%BB%80%E4%B9%88) |
| ... | ... | @@ -34,8 +24,6 @@ |
| 34 | 24 | ### Screenshots |
| 35 | 25 | > [主页](https://h5.luban-h5.com) |
| 36 | 26 | |
| 37 | -> [更多作品演示图片,点击查看](https://github.com/ly525/luban-h5/issues/15) | |
| 38 | - | |
| 39 | 27 |  |
| 40 | 28 | |
| 41 | 29 | --- | ... | ... |
docs/zh/getting-started/quick-start.md
| 1 | 1 | # 快速开始 |
| 2 | -> 重要:关于此部分有疑惑,请在下面直接评论,或者到社区讨论 | |
| 3 | - | |
| 4 | -> 欢迎大家到[鲁班H5-社区](https://support.qq.com/products/93432/) 交流,在这里可以提问、反馈意见和建议,与作者直接交流 | |
| 5 | - | |
| 6 | -> 如果您已经熟悉并已经安装了 `Node`、`Yarn`,可以直接参照下面的命令,快速上手 | |
| 7 | - | |
| 8 | -> 如果您不熟悉,请阅读下面的详细教程 | |
| 2 | +- 重要:关于此部分有疑惑,请在下面直接评论,或者到[社区](https://support.qq.com/products/93432/)讨论 | |
| 3 | +- 如果您已经熟悉并已经安装了 `Node`、`Yarn`,可以直接参照下面的命令,快速上手 | |
| 4 | +- 如果您不熟悉,请阅读下面的详细教程 | |
| 9 | 5 | |
| 10 | 6 | ```bash |
| 7 | +# 后端 | |
| 11 | 8 | cd back-end/h5-api && yarn && yarn dev |
| 12 | 9 | |
| 13 | -# 新开一个终端,回到项目根目录 | |
| 10 | +# 前端 | |
| 11 | +# 新开一个终端,在项目根目录执行如下命令 | |
| 14 | 12 | cd front-end/h5 && yarn && yarn build:engine && yarn dev |
| 15 | 13 | ``` |
| 16 | 14 | |
| 17 | 15 | # 常见问题 |
| 18 | -> 这部分一般是按照下面的教程运行之后,仍然可能、也许会遇到的问题 | |
| 19 | - | |
| 20 | -> 比较适合些许粗心、些许文档只看了一半、比较着急的同学 | |
| 16 | +> 这部分一般是按照下面的教程运行之后,仍然可能会遇到的问题。比较适合粗心、文档只看了一半、比较着急的同学 | |
| 21 | 17 | |
| 22 | 18 | 1. 接口 `403 Forbidden`,解决方案看这里:[#_2-注意事项](#_2-注意事项) |
| 23 | - | |
| 24 | 19 | 2. 弹框中的 `预览页面显示空白`,解决方案看这里:[2. 构建预览所需的渲染引擎](#_2-构建预览所需的渲染引擎) |
| 25 | 20 | |
| 26 | 21 | |
| ... | ... | @@ -29,7 +24,7 @@ cd front-end/h5 && yarn && yarn build:engine && yarn dev |
| 29 | 24 | |
| 30 | 25 | ## 基础概念 |
| 31 | 26 | > 首先你需要大概了解下 Node.js 的相关生态、Node.js 的安装 |
| 32 | -我们接下来会花一分钟介绍一下基础概念. 我们默认你知道 Linux 和 Git 的基本操作 | |
| 27 | +我们接下来会花几分钟介绍一下基础概念. 我们默认你知道 Linux 和 Git 的基本操作 | |
| 33 | 28 | ### Node.js、npm、nvm |
| 34 | 29 | |
| 35 | 30 | 1. `Node.js` |
| ... | ... | @@ -51,7 +46,6 @@ cd front-end/h5 && yarn && yarn build:engine && yarn dev |
| 51 | 46 | 1. 因为 yarn 的仓库源在海外,所以,请配置国内镜像源,提高速度 |
| 52 | 47 | |
| 53 | 48 | ```bash |
| 54 | - | |
| 55 | 49 | yarn config get registry |
| 56 | 50 | # -> https://registry.yarnpkg.com |
| 57 | 51 | |
| ... | ... | @@ -69,12 +63,10 @@ yarn config set registry https://registry.npm.taobao.org |
| 69 | 63 | - 存储:Sqlite |
| 70 | 64 | |
| 71 | 65 | # 项目环境搭建 |
| 72 | - | |
| 73 | -1. 鲁班H5的后端接口,由 [Strapi](https://github.com/strapi/strapi/) 强力驱动 | |
| 74 | -1. 后端部分文档会尽量和 `[github-后端部分文档说明(project/back-end/h5-api/README.md)](https://github.com/ly525/luban-h5/blob/dev/back-end/h5-api/README.md)`保持同步 | |
| 66 | +> 鲁班H5的后端接口,由 [Strapi.js](https://github.com/strapi/strapi/) 驱动 | |
| 75 | 67 | |
| 76 | 68 | ## 后端环境搭建 |
| 77 | -> 如果遇到接口 403 问题,请看:`2. 注意事项` | |
| 69 | +> 如果遇到接口 403 问题,请看:[#_2-注意事项](#_2-注意事项) | |
| 78 | 70 | ### 1. 快速上手 |
| 79 | 71 | |
| 80 | 72 | ```bash |
| ... | ... | @@ -90,8 +82,8 @@ yarn dev |
| 90 | 82 | # #!en: default database is sqlite3(h5-api/.tmp/data.db) |
| 91 | 83 | # #!zh: 默认数据库是 sqlite3,位置在 h5-api/.tmp/data.db |
| 92 | 84 | |
| 93 | -# 访问 http://locahost:1337/admin | |
| 94 | -# visit http://locahost:1337/admin | |
| 85 | +# 访问 http://localhost:1337/admin | |
| 86 | +# visit http://localhost:1337/admin | |
| 95 | 87 | |
| 96 | 88 | 请继续阅读,进行相关配置 |
| 97 | 89 | ``` |
| ... | ... | @@ -107,30 +99,26 @@ yarn dev |
| 107 | 99 | ##### 上传封面图使用 |
| 108 | 100 |  |
| 109 | 101 | |
| 110 | -2. 如果后端没有安装 strapi-hook-ejs 或者 没有在 hook.json 中进行配置,会报错(如下)。解决方案:只要装了 ejs 插件并且正确配置即可 | |
| 111 | -```javascript | |
| 112 | -error TypeError: ctx.render is not a function | |
| 113 | - at previewOne (~/luban-h5/back-end/h5-api/api/work/controllers/Work.js:13:16) | |
| 114 | -``` | |
| 115 | 102 | |
| 116 | 103 | ## 前端环境搭建 |
| 117 | -这部分会尽量和 `[project/front-end/h5/README.md](https://github.com/ly525/luban-h5/blob/dev/front-end/h5/README.md)` 保持同步 | |
| 118 | - | |
| 119 | 104 | ### 1. 快速上手 |
| 120 | 105 | |
| 121 | 106 | ```bash |
| 122 | 107 | # 默认当前位置目录为 luban-h5 项目的根目录 |
| 123 | 108 | cd front-end/h5 && yarn && yarn build:engine && yarn dev |
| 124 | 109 | |
| 125 | -# 更多命令 | |
| 126 | -请参见 project/front-end/h5/package.json | |
| 110 | +# 更多命令请参见 project/front-end/h5/package.json | |
| 127 | 111 | ``` |
| 128 | 112 | |
| 129 | 113 | ### 2. 构建预览所需的渲染引擎 |
| 130 | -> 关于此部分有疑惑,请直接评论 | |
| 114 | +- 如果在`「1. 快速上手」` 已经执行了 `yarn build:engine`,这一步可以跳过 | |
| 115 | +- 关于此部分有疑惑,请直接到[社区](https://support.qq.com/products/93432/)评论即可 | |
| 116 | + | |
| 117 | +1. 只需要在`front-end/h5`目录下,运行:`yarn build:engine` 即可 | |
| 118 | +2. 下面的内容感兴趣可以了解,感觉内容太多可以不看 | |
| 131 | 119 | |
| 132 | -#### 基本原理 | |
| 133 | -作品预览的基本原理参见 [luban-h5/back-end/h5-api/api/work/controllers/Work.js/previewOne](https://github.com/ly525/luban-h5/blob/bd486ce16fc24bfd7030fc51857a579776e12e68/back-end/h5-api/api/work/controllers/Work.js#L12) | |
| 120 | +#### 2.1 基本原理 | |
| 121 | +作品预览的基本原理参见 [previewOne](https://github.com/ly525/luban-h5/blob/bd486ce16fc24bfd7030fc51857a579776e12e68/back-end/h5-api/api/work/controllers/Work.js#L12),关键代码如下: | |
| 134 | 122 | |
| 135 | 123 | ```js |
| 136 | 124 | previewOne: async (ctx) => { |
| ... | ... | @@ -138,17 +126,14 @@ previewOne: async (ctx) => { |
| 138 | 126 | return ctx.render('engine', { work }); |
| 139 | 127 | }, |
| 140 | 128 | ``` |
| 141 | -#### 如何构建 | |
| 129 | + | |
| 130 | +#### 2.2 如何构建 | |
| 142 | 131 | 1. 在`front-end/h5`目录下,运行:`yarn build:engine` |
| 143 | -2. 构建完成之后,后端的`h5-api/public`里面会多一个文件夹 `engine-assets` | |
| 132 | +2. 构建完成之后,后端的`h5-api/public`里面会多一个文件夹 `engine-assets` | |
| 144 | 133 | 3. 打开的预览窗口`preview.vue`, 里面的预览部分对应的其实是一个 iframe,可以看看对应的源码 |
| 145 | - 也就是说,这个预览其实依赖后端的渲染引擎,比如 ejs 或者 jade 这种模板引擎,所以参照这里:`luban-h5/front-end/h5/vue.config.js` `engineOutputDir` 变量,preview engine 构建完成,会生成到后端的 `back-end/h5-api/public/engine-assets` 目录 | |
| 146 | - | |
| 147 | - | |
| 148 | -### 3. 前端组件说明 | |
| 134 | +4. 这个预览其实依赖后端的模板引擎(比如 ejs、jade等) | |
| 135 | +5. 参照这里`luban-h5/front-end/h5/vue.config.js`的`engineOutputDir` 变量(这个变量就是预览引擎构建完成,生成的文件所在的目录。默认是后端的 `back-end/h5-api/public/engine-assets` 目录) | |
| 149 | 136 | |
| 150 | -1. `lbp-` | |
| 151 | -全称为 `lu-ban-plugin:``鲁班H5的插件`,位置:`front-end/h5/src/components/plugins` | |
| 152 | 137 | |
| 153 | 138 | --- |
| 154 | 139 | > 欢迎大家到[鲁班H5-社区](https://support.qq.com/products/93432/) 交流,在这里可以提问、反馈意见和建议,与作者直接互动 | ... | ... |
docs/zh/implementation/code-structure.md
| ... | ... | @@ -89,6 +89,10 @@ front-end/h5/src # å‰ç«¯æºç 目录:包å«ç¼–辑器ã€ä½œå“ç |
| 89 | 89 | └── router.js # 页é¢è·¯ç”± |
| 90 | 90 | ``` |
| 91 | 91 | |
| 92 | +## 组件说明 | |
| 93 | +> `lbp-` 全称为 `lu-ban-plugin:` `é²çH5çš„æ’ä»¶`,ä½ç½® `front-end/h5/src/components/plugins` | |
| 94 | + | |
| 95 | + | |
| 92 | 96 | --- |
| 93 | 97 | |
| 94 | 98 | > 欢迎大家到[é²çH5-社区](https://support.qq.com/products/93432/) 交æµï¼Œåœ¨è¿™é‡Œå¯ä»¥æé—®ã€å馈æ„è§å’Œå»ºè®®ï¼Œä¸Žä½œè€…直接互动 | ... | ... |