update documents (#19868)

This commit is contained in:
wxiaoguang 2022-06-02 12:22:42 +08:00 committed by GitHub
parent 8aaba65eee
commit 6171ea7d31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 56 additions and 95 deletions

View file

@ -64,7 +64,7 @@ Discouraged implementations:
Only mark a function as `async` if and only if there are `await` calls Only mark a function as `async` if and only if there are `await` calls
or `Promise` returns inside the function. or `Promise` returns inside the function.
It's not recommended to use `async` event listeners, which may lead to problems. It's not recommended to use `async` event listeners, which may lead to problems.
The reason is that the code after await is executed outside the event dispatch. The reason is that the code after await is executed outside the event dispatch.
Reference: https://github.com/github/eslint-plugin-github/blob/main/docs/rules/async-preventdefault.md Reference: https://github.com/github/eslint-plugin-github/blob/main/docs/rules/async-preventdefault.md
@ -73,50 +73,6 @@ it's recommended to use `const _promise = asyncFoo()` to tell readers
that this is done by purpose, we want to call the async function and ignore the Promise. that this is done by purpose, we want to call the async function and ignore the Promise.
Some lint rules and IDEs also have warnings if the returned Promise is not handled. Some lint rules and IDEs also have warnings if the returned Promise is not handled.
#### DOM Event Listener
```js
el.addEventListener('click', (e) => {
(async () => {
await asyncFoo(); // recommended
// then we shound't do e.preventDefault() after await, no effect
})();
const _promise = asyncFoo(); // recommended
e.preventDefault(); // correct
});
el.addEventListener('async', async (e) => { // not recommended but acceptable
e.preventDefault(); // acceptable
await asyncFoo(); // skip out event dispatch
e.preventDefault(); // WRONG
});
```
#### jQuery Event Listener
```js
$('#el').on('click', (e) => {
(async () => {
await asyncFoo(); // recommended
// then we shound't do e.preventDefault() after await, no effect
})();
const _promise = asyncFoo(); // recommended
e.preventDefault(); // correct
return false; // correct
});
$('#el').on('click', async (e) => { // not recommended but acceptable
e.preventDefault(); // acceptable
return false; // WRONG, jQuery expects the returned value is a boolean, not a Promise
await asyncFoo(); // skip out event dispatch
return false; // WRONG
});
```
### HTML Attributes and `dataset` ### HTML Attributes and `dataset`
We forbid `dataset` usage, its camel-casing behaviour makes it hard to grep for attributes. However there are still some special cases, so the current guideline is: We forbid `dataset` usage, its camel-casing behaviour makes it hard to grep for attributes. However there are still some special cases, so the current guideline is:

View file

@ -26,7 +26,7 @@ Gitea ist ein [Gogs](http://gogs.io)-Fork.
- 2 CPU Kerne und 1GB RAM sind für kleine Teams/Projekte ausreichend. - 2 CPU Kerne und 1GB RAM sind für kleine Teams/Projekte ausreichend.
- Gitea sollte unter einem seperaten nicht-root Account auf UNIX-Systemen ausgeführt werden. - Gitea sollte unter einem seperaten nicht-root Account auf UNIX-Systemen ausgeführt werden.
- Achtung: Gitea verwaltet die `~/.ssh/authorized_keys` Datei. Gitea unter einem normalen Benutzer auszuführen könnte dazu führen, dass dieser sich nicht mehr anmelden kann. - Achtung: Gitea verwaltet die `~/.ssh/authorized_keys` Datei. Gitea unter einem normalen Benutzer auszuführen könnte dazu führen, dass dieser sich nicht mehr anmelden kann.
- [Git](https://git-scm.com/) Version 1.7.2 oder später wird benötigt. Version 1.9.0 oder später wird empfohlen. Außerdem zu beachten: - [Git](https://git-scm.com/) Version 2.0 oder später wird benötigt.
- Wenn git >= 2.1.2. und [Git large file storage](https://git-lfs.github.com/) aktiviert ist, dann wird es auch in Gitea verwendbar sein. - Wenn git >= 2.1.2. und [Git large file storage](https://git-lfs.github.com/) aktiviert ist, dann wird es auch in Gitea verwendbar sein.
- Wenn git >= 2.18, dann wird das Rendern von Commit-Graphen automatisch aktiviert. - Wenn git >= 2.18, dann wird das Rendern von Commit-Graphen automatisch aktiviert.

View file

@ -249,6 +249,17 @@ Windows, on architectures like amd64, i386, ARM, PowerPC, and others.
- Webhooks - Webhooks
- Git Hooks - Git Hooks
- Deploy keys - Deploy keys
- Package Registries
- Composer
- Conan
- Container
- Generic
- Helm
- Maven
- NPM
- Nuget
- PyPI
- RubyGems
## System Requirements ## System Requirements
@ -256,7 +267,7 @@ Windows, on architectures like amd64, i386, ARM, PowerPC, and others.
- 2 CPU cores and 1GB RAM is typically sufficient for small teams/projects. - 2 CPU cores and 1GB RAM is typically sufficient for small teams/projects.
- Gitea should be run with a dedicated non-root system account on UNIX-type systems. - Gitea should be run with a dedicated non-root system account on UNIX-type systems.
- Note: Gitea manages the `~/.ssh/authorized_keys` file. Running Gitea as a regular user could break that user's ability to log in. - Note: Gitea manages the `~/.ssh/authorized_keys` file. Running Gitea as a regular user could break that user's ability to log in.
- [Git](https://git-scm.com/) version 1.7.2 or later is required. Version 1.9.0 or later is recommended. Also please note: - [Git](https://git-scm.com/) version 2.0.0 or later is required.
- [Git Large File Storage](https://git-lfs.github.com/) will be available if enabled when Git >= 2.1.2. - [Git Large File Storage](https://git-lfs.github.com/) will be available if enabled when Git >= 2.1.2.
- Git commit-graph rendering will be enabled automatically when Git >= 2.18. - Git commit-graph rendering will be enabled automatically when Git >= 2.18.
@ -267,22 +278,21 @@ Windows, on architectures like amd64, i386, ARM, PowerPC, and others.
## Components ## Components
* Web framework: [Chi](http://github.com/go-chi/chi) * Web server framework: [Chi](http://github.com/go-chi/chi)
* ORM: [XORM](https://xorm.io) * ORM: [XORM](https://xorm.io)
* UI components: * UI frameworks:
* [Semantic UI](http://semantic-ui.com/) * [jQuery](https://jquery.com)
* [GitHub Octicons](https://octicons.github.com/) * [Fomantic UI](https://fomantic-ui.com)
* [Font Awesome](http://fontawesome.io/) * [Vue2](https://vuejs.org)
* [DropzoneJS](http://www.dropzonejs.com/) * and various components (see package.json)
* [Highlight](https://highlightjs.org/) * Editors:
* [Clipboard](https://zenorocha.github.io/clipboard.js/) * [CodeMirror](https://codemirror.net)
* [CodeMirror](https://codemirror.net/) * [EasyMDE](https://github.com/Ionaru/easy-markdown-editor)
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors) * [Monaco Editor](https://microsoft.github.io/monaco-editor)
* Database drivers: * Database drivers:
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) * [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
* [github.com/lib/pq](https://github.com/lib/pq) * [github.com/lib/pq](https://github.com/lib/pq)
* [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) * [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)
* [github.com/pingcap/tidb](https://github.com/pingcap/tidb)
* [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) * [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb)
## Software and Service Support ## Software and Service Support

View file

@ -249,27 +249,24 @@ Le but de ce projet est de fournir de la manière la plus simple, la plus rapide
## Navigateurs supportés ## Navigateurs supportés
- Consultez [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) pour la liste des navigateurs supportés. - Chrome, Firefox, Safari, Edge
- La taille minimale supportée officielement est de **1024*768**, l'interface utilisateur peut toujours fonctionner à une taille plus petite, mais ce n'est pas garanti et les problèmes remontés ne seront pas corrigés.
## Composants ## Composants
* Framework web : [Chi](http://github.com/go-chi/chi) * Framework web : [Chi](http://github.com/go-chi/chi)
* ORM: [XORM](https://xorm.io) * ORM: [XORM](https://xorm.io)
* Interface graphique : * Interface graphique :
* [Semantic UI](http://semantic-ui.com/) * [jQuery](https://jquery.com)
* [GitHub Octicons](https://octicons.github.com/) * [Fomantic UI](https://fomantic-ui.com)
* [Font Awesome](http://fontawesome.io/) * [Vue2](https://vuejs.org)
* [DropzoneJS](http://www.dropzonejs.com/) * [CodeMirror](https://codemirror.net)
* [Highlight](https://highlightjs.org/) * [EasyMDE](https://github.com/Ionaru/easy-markdown-editor)
* [Clipboard](https://zenorocha.github.io/clipboard.js/) * [Monaco Editor](https://microsoft.github.io/monaco-editor)
* [CodeMirror](https://codemirror.net/) * ... (package.json)
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors)
* Connecteurs de base de données : * Connecteurs de base de données :
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) * [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
* [github.com/lib/pq](https://github.com/lib/pq) * [github.com/lib/pq](https://github.com/lib/pq)
* [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) * [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)
* [github.com/pingcap/tidb](https://github.com/pingcap/tidb)
* [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) * [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb)
## Logiciels et services ## Logiciels et services

View file

@ -34,6 +34,7 @@ Gitea的首要目标是创建一个极易安装运行非常快速安装和
- 支持后台管理面板 - 支持后台管理面板
- 支持 MySQL、PostgreSQL、SQLite3、MSSQL 和 TiDB(MySQL) 数据库 - 支持 MySQL、PostgreSQL、SQLite3、MSSQL 和 TiDB(MySQL) 数据库
- 支持多语言本地化21 种语言) - 支持多语言本地化21 种语言)
- 支持软件包注册中心Composer/Conan/Container/Generic/Helm/Maven/NPM/Nuget/PyPI/RubyGems
## 系统要求 ## 系统要求
@ -42,27 +43,25 @@ Gitea的首要目标是创建一个极易安装运行非常快速安装和
## 浏览器支持 ## 浏览器支持
- 请根据 [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) 查看具体支持的浏览器版本。 - Chrome, Firefox, Safari, Edge
- 官方支持的最小 UI 尺寸为 **1024*768**UI 不一定会在更小尺寸的设备上被破坏,但我们无法保证且不会修复。
## 组件 ## 组件
* Web框架 [Chi](http://github.com/go-chi/chi) * Web框架 [Chi](http://github.com/go-chi/chi)
* ORM: [XORM](https://xorm.io) * ORM: [XORM](https://xorm.io)
* UI组件 * UI 框架
* [Semantic UI](http://semantic-ui.com/) * [jQuery](https://jquery.com)
* [GitHub Octicons](https://octicons.github.com/) * [Fomantic UI](https://fomantic-ui.com)
* [Font Awesome](http://fontawesome.io/) * [Vue2](https://vuejs.org)
* [DropzoneJS](http://www.dropzonejs.com/) * 更多组件参见 package.json
* [Highlight](https://highlightjs.org/) * 编辑器:
* [Clipboard](https://zenorocha.github.io/clipboard.js/) * [CodeMirror](https://codemirror.net)
* [CodeMirror](https://codemirror.net/) * [EasyMDE](https://github.com/Ionaru/easy-markdown-editor)
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors) * [Monaco Editor](https://microsoft.github.io/monaco-editor)
* 数据库驱动: * 数据库驱动:
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) * [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
* [github.com/lib/pq](https://github.com/lib/pq) * [github.com/lib/pq](https://github.com/lib/pq)
* [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) * [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)
* [github.com/pingcap/tidb](https://github.com/pingcap/tidb)
* [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) * [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb)
## 软件及服务支持 ## 软件及服务支持

View file

@ -255,7 +255,7 @@ Gitea 是從 [Gogs](http://gogs.io) Fork 出來的,請閱讀部落格文章 [G
- 在類 UNIX 系統上, 應該以專用的非 root 系統帳號來執行 Gitea。 - 在類 UNIX 系統上, 應該以專用的非 root 系統帳號來執行 Gitea。
- 備註Gitea 管理著 `~/.ssh/authorized_keys` 檔案。以一般身份使用者執行 Gitea 可能會破壞該使用者的登入能力。 - 備註Gitea 管理著 `~/.ssh/authorized_keys` 檔案。以一般身份使用者執行 Gitea 可能會破壞該使用者的登入能力。
- [Git](https://git-scm.com/) 的最低需求為 1.7.2 或更新版本。建議使用 1.9.0 或更新版本。並請留意: - [Git](https://git-scm.com/) 的最低需求為 2.0 或更新版本。
- 當 git 版本 >= 2.1.2 時,可啟用 Git [large file storage](https://git-lfs.github.com/)。 - 當 git 版本 >= 2.1.2 時,可啟用 Git [large file storage](https://git-lfs.github.com/)。
- 當 git 版本 >= 2.18 時,將自動啟用 Git 提交線圖渲染。 - 當 git 版本 >= 2.18 時,將自動啟用 Git 提交線圖渲染。
@ -269,20 +269,19 @@ Gitea 是從 [Gogs](http://gogs.io) Fork 出來的,請閱讀部落格文章 [G
- Web 框架: [Chi](http://github.com/go-chi/chi) - Web 框架: [Chi](http://github.com/go-chi/chi)
- ORM [XORM](https://xorm.io) - ORM [XORM](https://xorm.io)
- UI 元件: - UI 元件:
- [Semantic UI](http://semantic-ui.com/) * [jQuery](https://jquery.com)
- [GitHub Octicons](https://octicons.github.com/) * [Fomantic UI](https://fomantic-ui.com)
- [Font Awesome](http://fontawesome.io/) * [Vue2](https://vuejs.org)
- [DropzoneJS](http://www.dropzonejs.com/) * [CodeMirror](https://codemirror.net)
- [Highlight](https://highlightjs.org/) * [EasyMDE](https://github.com/Ionaru/easy-markdown-editor)
- [Clipboard](https://zenorocha.github.io/clipboard.js/) * [Monaco Editor](https://microsoft.github.io/monaco-editor)
- [CodeMirror](https://codemirror.net/) * ... (package.json)
- [jQuery MiniColors](https://github.com/claviska/jquery-minicolors)
- 資料庫驅動程式: - 資料庫驅動程式:
- [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) * [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
- [github.com/lib/pq](https://github.com/lib/pq) * [github.com/lib/pq](https://github.com/lib/pq)
- [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) * [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)
- [github.com/pingcap/tidb](https://github.com/pingcap/tidb) * [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb)
- [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb)
## 軟體和服務支援 ## 軟體和服務支援