📝 README 使用中文

This commit is contained in:
Liang Ding 2018-10-07 09:55:34 +08:00
parent e23e26dbdf
commit 36f0921c55
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D
1 changed files with 100 additions and 136 deletions

214
README.md
View File

@ -1,171 +1,135 @@
# [Wide](https://github.com/b3log/wide) [![Build Status](https://img.shields.io/travis/b3log/wide.svg?style=flat)](https://travis-ci.org/b3log/wide) [![Go Report Card](https://goreportcard.com/badge/github.com/b3log/wide)](https://goreportcard.com/report/github.com/b3log/wide) [![Coverage Status](https://img.shields.io/coveralls/b3log/wide.svg?style=flat)](https://coveralls.io/r/b3log/wide) [![Apache License](https://img.shields.io/badge/license-apache2-orange.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0) [![API Documentation](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/b3log/wide) [![Download](https://img.shields.io/badge/download-~4.3K-red.svg?style=flat)](https://pan.baidu.com/s/1dD3XwOT) # [Wide](https://github.com/b3log/wide) [![Build Status](https://img.shields.io/travis/b3log/wide.svg?style=flat)](https://travis-ci.org/b3log/wide) [![Go Report Card](https://goreportcard.com/badge/github.com/b3log/wide)](https://goreportcard.com/report/github.com/b3log/wide) [![Coverage Status](https://img.shields.io/coveralls/b3log/wide.svg?style=flat)](https://coveralls.io/r/b3log/wide) [![Apache License](https://img.shields.io/badge/license-apache2-orange.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0) [![API Documentation](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/b3log/wide) [![Download](https://img.shields.io/badge/download-~4.3K-red.svg?style=flat)](https://pan.baidu.com/s/1dD3XwOT)
_Have a [try](https://wide.b3log.org/signup) first, then [download](https://pan.baidu.com/s/1dD3XwOT) and setup it on your local area network, enjoy yourself!_
先试试我们搭建好的[在线服务](https://wide.b3log.org/signup),你可以在这里[下载](https://pan.baidu.com/s/1dD3XwOT)并在本地环境运行,然后邀请小伙伴们来玩吧! 先试试我们搭建好的[在线服务](https://wide.b3log.org/signup),你可以在这里[下载](https://pan.baidu.com/s/1dD3XwOT)并在本地环境运行,然后邀请小伙伴们来玩吧!
> * 关于 Wide 的产品定位,请看[这里](https://hacpai.com/article/1438407961481),并欢迎参与讨论~ ## 简介
> * 加入[**黑客派**](https://hacpai.com/register),与其他程序员、设计师共同成长!
## Introduction Wide 是一个基于 **W**eb 的 Go 语言 **IDE**
A <b>W</b>eb-based <b>IDE</b> for Teams using Go programming language/Golang. ![](https://cloud.githubusercontent.com/assets/873584/4606377/d0ca3c2a-521b-11e4-912c-d955ab05850b.png)
![Hello, 世界](https://cloud.githubusercontent.com/assets/873584/4606377/d0ca3c2a-521b-11e4-912c-d955ab05850b.png) ## 动机
## Authors 目前较为流行的 Go IDE 都有一些缺陷或遗憾:
* 文本编辑器类vim/emacs/sublime/Atom 等):对于新手门槛太高,搭建复杂
* 插件类goclipse、IDEA 等):需要原 IDE 支持,不够专业
* LiteIDE 界面不够 modern、goland 收费
* **缺少网络分享、嵌入网站可运行功能**
[Daniel](https://github.com/88250) and [Vanessa](https://github.com/Vanessa219) are the main authors of Wide, [here](https://github.com/b3log/wide/graphs/contributors) are all contributors. 另外Go IDE 很少,用 Go 本身开发的 IDE 更是没有,这是一个很好的尝试。关于产品定位的讨论请看[这里](https://hacpai.com/article/1438407961481)。
Wide 的主要作者是 [Daniel](https://github.com/88250) 与 [Vanessa](https://github.com/Vanessa219),所有贡献者可以在[这里](https://github.com/b3log/wide/graphs/contributors)看到。 ## 特性
## Motivation 基于 Web 的 IDE
* **Team** IDE: * 只需要浏览器就能进行开发、运行
* _Safe and reliable_: the project source code stored on the server in real time, the developer's machine crashes without losing any source code * 跨平台,甚至在移动设备上
* _Unified environment_: server unified development environment configuration, the developer machine without any additional configuration * 易进行功能扩展
* _Out of the box_: 5 minutes to setup a server then open browser to develop, debug * 易与其他系统集成
* _Version Control_: each developer has its own source code repository, easy sync with the trunk * 极客体验
* **Web-based** IDE:
* Developer needs a browser only
* Cross-platform, even on mobile devices
* Easy to extend
* Easy to integrate with other systems
* For the geeks
* A try for commercial-open source: versions customized for enterprises, close to their development work flows respectively
* Currently more popular Go IDE has some defects or regrets:
* Text editor (vim/emacs/sublime/Atom, etc.): For the Go newbie is too complex
* Plug-in (goclipse, etc.): the need for the original IDE support, not professional
* LiteIDE: no modern user interface :p
* No team development experience
* There are a few of GO IDEs, and no one developed by Go itself, this is a nice try
## Features 核心功能:
* [X] Code Highlight, Folding: Go/HTML/JavaScript/Markdown etc. * 代码高亮、折叠Go/HTML/JavaScript/Markdown 等
* [X] Autocomplete: Go/HTML etc. * 自动完成Go/HTML 等
* [X] Format: Go/HTML/JSON etc. * 编译检查:编辑器提示编译错误
* [X] Build & Run * 格式化Go/HTML/JSON 等
* [X] Multiplayer: a real team development experience * 运行:支持同时运行多个程序,方便联调
* [X] Navigation, Jump to declaration, Find usages, File search etc. * 多用户:团队开发,方便协作
* [X] Shell: run command on the server * 代码导航:跳转到声明,查找使用,文件搜索等
* [X] Web development: HTML/JS/CSS editor with [Emmet](https://emmet.io) integrated * Web 开发前端HTML/JS/CSS开发支持
* [X] Go tool: go get/install/fmt etc. * go toolgo get/install/fmt 等
* [X] File Import & Export * 项目导入/导出
* [X] Themes: editor and UI adjust, respectively * UI/编辑器多主题
* [X] Cross-Compilation * 支持交叉编译
* [ ] Debug * 调试:基于 gdb 的调试系统TBD
* [ ] Git integration: git command on the web * Git 整合:常用 git 命令可视化操作TBD
* Shell连接到服务器执行命令TBD
## Screenshots ## 界面
* **Overview** ### 主界面
![Overview](https://cloud.githubusercontent.com/assets/873584/5450620/1d51831e-8543-11e4-930b-670871902425.png) ![Overview](https://cloud.githubusercontent.com/assets/873584/5450620/1d51831e-8543-11e4-930b-670871902425.png)
* **Goto File**
![Goto File](https://cloud.githubusercontent.com/assets/873584/5450616/1d495da6-8543-11e4-9285-f9d9c60779ac.png) ### 跳转到文件
* **Autocomplete**
![Autocomplete](https://cloud.githubusercontent.com/assets/873584/5450619/1d4d5712-8543-11e4-8fe4-35dbc8348a6e.png) ![Goto File](https://cloud.githubusercontent.com/assets/873584/5450616/1d495da6-8543-11e4-9285-f9d9c60779ac.png)
* **Theme**
![4](https://cloud.githubusercontent.com/assets/873584/5450617/1d4c0826-8543-11e4-8b86-f79a4e41550a.png) ### 自动完成
* **Show Expression Info**
![Show Expression Info](https://cloud.githubusercontent.com/assets/873584/5450618/1d4cd9f4-8543-11e4-950f-121bd3ff4a39.png) ![Autocomplete](https://cloud.githubusercontent.com/assets/873584/5450619/1d4d5712-8543-11e4-8fe4-35dbc8348a6e.png)
* **Build Error Info**
![Build Error Info](https://cloud.githubusercontent.com/assets/873584/5450632/3e51cccc-8543-11e4-8ca8-8d2427aa16b8.png) ### 主题
* **Git Clone**
![Git Clone](https://cloud.githubusercontent.com/assets/873584/6545235/2284f230-c5b7-11e4-985e-7e04367921b1.png) ![Theme](https://cloud.githubusercontent.com/assets/873584/5450617/1d4c0826-8543-11e4-8b86-f79a4e41550a.png)
* **Cross-Compilation**
![Cross-Compilation](https://cloud.githubusercontent.com/assets/873584/10130037/226d75fc-65f7-11e5-94e4-25ee579ca175.png) ### 查看表达式
* **Playground** ![Show Expression Info](https://cloud.githubusercontent.com/assets/873584/5450618/1d4cd9f4-8543-11e4-950f-121bd3ff4a39.png)
![Playground](https://cloud.githubusercontent.com/assets/873584/21209772/449ecfd2-c2b1-11e6-9aa6-a83477d9f269.gif)
## Architecture ### 构建报错提示
### Build & Run ![Build Error Info](https://cloud.githubusercontent.com/assets/873584/5450632/3e51cccc-8543-11e4-8ca8-8d2427aa16b8.png)
### Git 克隆
![Git Clone](https://cloud.githubusercontent.com/assets/873584/6545235/2284f230-c5b7-11e4-985e-7e04367921b1.png)
### 交叉编译
![Cross-Compilation](https://cloud.githubusercontent.com/assets/873584/10130037/226d75fc-65f7-11e5-94e4-25ee579ca175.png)
### Playground
![Playground](https://cloud.githubusercontent.com/assets/873584/21209772/449ecfd2-c2b1-11e6-9aa6-a83477d9f269.gif)
## 架构
### 构建与运行
![Build & Run](https://cloud.githubusercontent.com/assets/873584/4389219/3642bc62-43f3-11e4-8d1f-06d7aaf22784.png) ![Build & Run](https://cloud.githubusercontent.com/assets/873584/4389219/3642bc62-43f3-11e4-8d1f-06d7aaf22784.png)
* A browser tab corresponds to a Wide session * 一个浏览器 tab 对应一个 Wide 会话
* Execution output push via WebSocket * 通过 WebSocket 进行程序执行输出推送
Flow: 1. 客户端浏览器发送 ````Build```` 请求
1. Browser sends ````Build```` request 2. 服务器使用 ````os/exec```` 执行 ````go build```` 命令<br/>
2. Server executes ````go build```` command via ````os/exec````<br/> 2.1. 生成可执行文件
2.1. Generates a executable file 3. 客户端浏览器发送 ````Run```` 请求
3. Browser sends ````Run```` request 4. 服务器使用 ````os/exec```` 执行文件<br/>
4. Server executes the file via ````os/exec````<br/> 4.1. 生成进程<br/>
4.1. A running process<br/> 4.2. 运行结果输出到 WebSocket 通道
4.2. Execution output push via WebSocket channel 5. 客户端浏览器监听 ````ws.onmessage```` 到消息后做展现
5. Browser renders with callback function ````ws.onmessage````
### Code Assist ### 代码辅助
![Code Assist](https://cloud.githubusercontent.com/assets/873584/4399135/3b80c21c-4463-11e4-8e94-7f7e8d12a4df.png) ![](https://cloud.githubusercontent.com/assets/873584/4399135/3b80c21c-4463-11e4-8e94-7f7e8d12a4df.png)
* Autocompletion * 自动完成
* Find Usages/Jump To Declaration/etc. * 查找使用
Flow: 1. 浏览器客户端发送代码辅助请求
1. Browser sends code assist request 2. Handler 根据请求对应的 HTTP 会话获取用户工作空间
2. Handler gets user workspace of the request with HTTP session 3. 执行 `gocode`/`ide_stub(gotools)` 命令<br/>
3. Server executes ````gocode````/````ide_stub(gotools)````<br/> 3.1 设置环境变量(${GOPATH} 为用户工作空间路径)<br/>
3.1 Sets environment variables (e.g. ${GOPATH})<br/> 3.2 `gocode` 命令需要设置参数 `lib-path`
3.2 ````gocode```` with ````lib-path```` parameter
## Documents ## 文档
* [用户指南](https://hacpai.com/article/1538873544275) * [用户指南](https://hacpai.com/article/1538873544275)
* [开发指南](https://www.gitbook.com/book/88250/wide-dev-guide) * [开发指南](https://hacpai.com/article/1538876422995)
## Setup ## 社区
### Download Binary * [讨论区](https://hacpai.com/tag/wide)
* [报告问题](https://github.com/b3log/wide/issues/new/choose)
We have provided OS-specific executable binary as follows: ## 授权
* linux-amd64/386 Wide 使用 [Apache License, Version 2](https://www.apache.org/licenses/LICENSE-2.0) 作为开源协议,请务必遵循该开源协议相关约定。
* windows-amd64/386
* darwin-amd64/386
Download [HERE](https://pan.baidu.com/s/1dD3XwOT)! ## 鸣谢
### Build Wide for yourself
1. [Download](https://github.com/b3log/wide/archive/master.zip) source or by `git clone https://github.com/b3log/wide`
2. Get dependencies with
* `go get`
* `go get github.com/visualfc/gotools github.com/nsf/gocode github.com/bradfitz/goimports`
3. Compile wide with `go build`
### Docker
1. Get image: `sudo docker pull 88250/wide:latest`
2. Run: `sudo docker run -p 127.0.0.1:7070:7070 88250/wide:latest ./wide -docker=true -channel=ws://127.0.0.1:7070`
3. Open browser: http://127.0.0.1:7070
## Known Issues
* [Shell is not available on Windows](https://github.com/b3log/wide/issues/32)
* [Rename directory](https://github.com/b3log/wide/issues/251)
## Terms
* This software is open sourced under the Apache License 2.0
* You can not get rid of the "Powered by [B3log](https://b3log.org)" from any page, even which you made
* If you want to use this software for commercial purpose, please mail to support@liuyun.io for a commercial license request
* Copyright &copy; b3log.org, all rights reserved
## Credits
Wide is made possible by the following open source projects.
* [golang](https://golang.org) * [golang](https://golang.org)
* [CodeMirror](https://github.com/marijnh/CodeMirror) * [CodeMirror](https://github.com/marijnh/CodeMirror)