This is an automated email from the ASF dual-hosted git repository.
fenbox pushed a commit to branch build-community
in repository https://gitbox.apache.org/repos/asf/incubator-answer-website.git
The following commit(s) were added to refs/heads/build-community by this push:
new 97e9accf docs: Adjust the case of the section title letters
97e9accf is described below
commit 97e9accfd52dbc5a6fded0534a79ab553514f4e7
Author: fen <[email protected]>
AuthorDate: Mon Nov 20 15:27:58 2023 +0800
docs: Adjust the case of the section title letters
---
community/contributing/contributing.md | 6 +--
community/contributing/development.md | 26 +++++-----
community/contributing/issues.md | 2 +-
community/contributing/plugins.md | 89 +++++++++++++++++----------------
community/contributing/pull-request.md | 4 +-
docs/getting-started/command-line.md | 9 ++++
docs/getting-started/database.md | 47 +++++++++++------
docs/getting-started/env.md | 2 +-
docs/introduction.md | 6 +--
sidebarsCommunity.js | 2 -
src/components/HomePageHeader/index.tsx | 2 +-
11 files changed, 113 insertions(+), 82 deletions(-)
diff --git a/community/contributing/contributing.md
b/community/contributing/contributing.md
index fdd85a57..26848973 100644
--- a/community/contributing/contributing.md
+++ b/community/contributing/contributing.md
@@ -6,11 +6,11 @@ slug: /contributing
> Thanks for your interest in contributing to Answer!
-## Code of Conduct
+## Code of conduct
Answer has adopted a Code of Conduct that we expect project participants to
adhere to. Please read the [full
text](https://www.apache.org/foundation/policies/conduct.html) so that you can
understand what actions will and will not be tolerated.
-## Get Involved
+## Get involved
There are many ways to contribute to Answer, and many of them do not involve
writing any code. Here's a few ideas to get started:
@@ -26,7 +26,7 @@ Contributions are very welcome. If you think you need help
planning your contrib
We have the `#contributing` and `#development` tags on [Answer
Meta](https://meta.answer.dev) to discuss all things about Answer development.
You can also be of great help by helping other users in the `#support` tag.
-### Triaging Issues and Pull Requests
+### Triaging issues and pull requests
One great way you can contribute to the project without writing any code is to
help triage issues and pull requests as they come in.
diff --git a/community/contributing/development.md
b/community/contributing/development.md
index 0d77e8b7..ff0be18a 100644
--- a/community/contributing/development.md
+++ b/community/contributing/development.md
@@ -6,24 +6,26 @@ slug: /development
## Backend
-#### Installation
+### Installation
-#### Code Conventions
+### Code conventions
-### Frontend
+## Frontend
-#### Installation
+### Installation
1. Ensure you have [node](https://nodejs.org/en) and
[pnpm](https://pnpm.io/installation) installed.
2. After cloning the repository, run the following command. This will install
all dependencies as well as build all local packages.
-```
-cd ./ui
-pnpm install
-```
-3. To start a development server, run `pnpm start`. now, your browser should
already open automatically, and autoload `http://localhost:3000`. you can also
manually visit it.
-4. To switch API, you can modify the `ui/.env.development` file and then
re-run pnpm start. If you're just using it yourself, we recommend creating a
`.env.development.local` file that defines the address of the api you're going
to use.
-
-#### Code Conventions
+
+ ```shell
+ cd ./ui
+ pnpm install
+ ```
+
+1. To start a development server, run `pnpm start`. now, your browser should
already open automatically, and autoload `http://localhost:3000`. you can also
manually visit it.
+2. To switch API, you can modify the `ui/.env.development` file and then
re-run pnpm start. If you're just using it yourself, we recommend creating a
`.env.development.local` file that defines the address of the api you're going
to use.
+
+### Code conventions
- **Most important: Look around.** Match the style you see used in the rest of
the project. This includes formatting, naming files, naming things in code,
naming things in documentation, etc.
- We do have Prettier (a formatter) and ESLint (a syntax linter) to catch most
stylistic problems. If you are working locally, you can run `pnpm lint` and
`pnpm prettier` to fix most code formatting.
diff --git a/community/contributing/issues.md b/community/contributing/issues.md
index b8679119..ae6dc1a1 100644
--- a/community/contributing/issues.md
+++ b/community/contributing/issues.md
@@ -16,7 +16,7 @@ When opening a new issue, always make sure to fill out the
issue template. **Thi
**Please don't use the GitHub issue tracker for questions.** If you have
questions about using Docusaurus, use any of our [support
channels](/community), and we will do our best to answer your questions.
-## Security Bugs
+## Security bugs
## Feature requests
diff --git a/community/contributing/plugins.md
b/community/contributing/plugins.md
index e763a894..ace669e5 100644
--- a/community/contributing/plugins.md
+++ b/community/contributing/plugins.md
@@ -1,10 +1,11 @@
---
-sidebar_label: Plugin
+sidebar_label: Plugins
+slug: /plugins
---
-# Contribute for plugins
+# Contribute for Plugins
-## plugin types
+## Plugin types
目前我们总共有三种类型的插件
@@ -12,52 +13,53 @@ sidebar_label: Plugin
- Builtin plugin
- Standard ui plugin
-
## Builtin plugin
It is not so different from React component, 这种插件更加适合下面两种场景
+
1. 有复杂的业务逻辑无法做到代码抽离 (例如 Oauth)。
-2. 有些后端的插件在业务上需要 UI 上的支持 (如 Search)。
+2. 有些后端的插件在业务上需要 UI 上的支持(如 Search)。
3. 这种插件对开发者要求极低,不需要额外的配置工作。
### 如何开发
- **熟悉目录结构**. Go to the `ui/src/plugins/builtin` directory and create a
directory, such as Demo. 然后参考现有的插架创建所必须的文件开始开发。
-```
-// ui/src/plugins/builtin
-.
-├── ...
-├── Demo
- ├── i18n (language file)
- ├── en_US.yaml (default language required)
- ├── index.ts (required)
- ├── zh_CN.ts (any language you want to provide)
- ├── index.tsx (component required)
- ├── info.yaml (plugin information required)
- ├── services.ts (api)
-```
+ ```txt
+ // ui/src/plugins/builtin
+ .
+ ├── ...
+ ├── Demo
+ ├── i18n (language file)
+ ├── en_US.yaml (default language required)
+ ├── index.ts (required)
+ ├── zh_CN.ts (any language you want to provide)
+ ├── index.tsx (component required)
+ ├── info.yaml (plugin information required)
+ ├── services.ts (api)
+ ```
+
- Export the plugins you have just defined in the plugins list file
`plugins/builtin/index.ts`
-```
-import Demo from './Demo'
-export default {
- ...(exists plugins),
- Demo,
-};
+ ```ts
+ import Demo from './Demo'
-```
+ export default {
+ ...(exists plugins),
+ Demo,
+ };
+ ```
- Now you can use the PluginRender component to render the just-defined plugin
where you want it!
-```
- <PluginRender
- type="connector"
- slug_name="third_party_connector"
- />
-```
+ ```ts
+ <PluginRender
+ type="connector"
+ slug_name="third_party_connector"
+ />
+ ```
-## standard ui plugin
+## Standard ui plugin
这种插件适合下面这些场景
@@ -66,22 +68,23 @@ export default {
现有示例:[editor-chart](https://github.com/apache/incubator-answer-plugins/blob/main/editor-chart)、[editor-formula](https://github.com/apache/incubator-answer-plugins/tree/main/editor-formula).
-为了简化开发和编译流程我们对这种可以独立的前端仓库采用 [workspace](https://pnpm.io/next/workspaces) 来管理.
+为了简化开发和编译流程我们对这种可以独立的前端仓库采用 [workspace](https://pnpm.io/next/workspaces) 来管理。
### 如何快速开发
- 首先参考上面已有的两个仓库,熟悉基本配置和组件导出方式。**Important: package.json 中的 name
字段就是我们添加依赖的包名,这里只能使用**
-- Go to the `ui/src/plugins` directory and create a directory,such as
editor_chart, 然后添加你想要开发的组件, 然后修改 `ui/src/plugins/index.ts` 文件,导出你的组件;
+- Go to the `ui/src/plugins` directory and create a directory,such as
editor_chart, 然后添加你想要开发的组件,然后修改 `ui/src/plugins/index.ts` 文件,导出你的组件;
+
+ ```ts
+ export { default as editor_chart } from 'editor_chart';
+ ```
-```
-export { default as editor_chart } from 'editor_chart';
-```
- 运行 `pnpm pre-install`, and 重新运行 `pnpm start`, 最后在你需要加载这个插件的页面调用一下 PluginKit
中 changePluginActiveStatus 方法来激活插件。
-```ts
-import PluginKit from '@/utils/pluginKit';
+ ```ts
+ import PluginKit from '@/utils/pluginKit';
-// 调用这个方法
-// 第一个参数是你的 plugin_name 第二个参数是否激活
-PluginKit.changePluginActiveStatus('editor_chart', true);
-```
+ // 调用这个方法
+ // 第一个参数是你的 plugin_name 第二个参数是否激活
+ PluginKit.changePluginActiveStatus('editor_chart', true);
+ ```
diff --git a/community/contributing/pull-request.md
b/community/contributing/pull-request.md
index 59853c63..2b9410b6 100644
--- a/community/contributing/pull-request.md
+++ b/community/contributing/pull-request.md
@@ -6,7 +6,7 @@ slug: /pull-request
We appreciate you taking the time to contribute! Before submitting a pull
request, we ask that you please create an issue that explains the bug or
feature request and let us know that you plan on creating a pull request for
it. If an issue already exists, please comment on that issue letting us know
you would like to submit a pull request for it. This helps us to keep track of
the pull request and make sure there isn't duplicated effort.
-## Semantic Commit Messages
+## Semantic commit messages
Following the format below when committing message can make you a better
programmer.
@@ -63,7 +63,7 @@ By contributing to Answer, you agree that your contributions
will be licensed un
*/
```
-## Contributor License Agreement (CLA)
+## Contributor license agreement (CLA)
Apache CLA short for Apache Contributor License Agreement, the purpose of this
agreement is to clearly define the terms under which intellectual property has
been contributed to the ASF and thereby allow us to defend the project should
there be a legal dispute regarding the software at some future time. A signed
ICLA is required to be on file before an individual is given commit rights to
any ASF project.
diff --git a/docs/getting-started/command-line.md
b/docs/getting-started/command-line.md
index dc4c56c4..c5145819 100644
--- a/docs/getting-started/command-line.md
+++ b/docs/getting-started/command-line.md
@@ -11,6 +11,7 @@ Answer binary support some command-line options
:::
## Usage
+
`answer command [command or global options] [arguments...]`
```shell
@@ -38,13 +39,17 @@ Use "answer [command] --help" for more information about a
command.
```
## Global options
+
All global options can be placed at the command level.
+
- `--help`, `-h`: Show help text and exit. Optional.
- `--version`, `-v`: Show version and exit. Optional.
- `--data-path` path, `-C` path: data saved path. Optional. (default: /data/)
## Commands
+
### init
+
> init command will initialize the application required environment, contains:
> default config-file, data directory, initialize database etc.
- Examples
@@ -54,18 +59,21 @@ All global options can be placed at the command level.
- if answer initialized failed, run command can not be executed.
### check
+
> check command will check the application whether it can run or not. check
> the config file if exist. check the database if connection can be
> established etc.
- Examples
- `answer check -C ./data/`
### run
+
> run command will run the application.
- Examples
- `answer run -C ./data/`
### upgrade
+
> upgrade command will upgrade the application.
- Options
@@ -75,6 +83,7 @@ All global options can be placed at the command level.
- `answer upgrade -f v1.1.0 -C ./data/`
### dump
+
> dump command will dump the database data to sql file.
- Options
diff --git a/docs/getting-started/database.md b/docs/getting-started/database.md
index 25c34e8a..ddccbb9d 100644
--- a/docs/getting-started/database.md
+++ b/docs/getting-started/database.md
@@ -3,13 +3,15 @@ slug: /database
---
# Database
+
:::note
Different databases have different data types. The following table presumes
use of mysql/mariadb as an example.
:::
-## activity
+## activity
+
> `activity` table records various actions of users, such as votes, etc.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -28,7 +30,8 @@ Different databases have different data types. The following
table presumes use
| has_rank | tinyint(4) | NO | | 0 | this activity
has rank or not |
| revision_id | bigint(20) | NO | | 0 | revision id
|
-## answer
+## answer
+
> `answer` table records the answer info.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT |
COMMENT |
@@ -47,7 +50,8 @@ Different databases have different data types. The following
table presumes use
| vote_count | int(11) | NO | | 0 | vote
count |
| revision_id | bigint(20) | NO | | 0 |
revision id |
-## collection
+## collection
+
> `collection` table records user collection about any object.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT
| COMMENT |
@@ -59,7 +63,7 @@ Different databases have different data types. The following
table presumes use
| object_id | bigint(20) | NO | | 0
| object id |
| user_collection_group_id | bigint(20) | NO | | 0
| user collection group id |
-## collection_group
+## collection_group
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
|---------------|-------------|----------|-----|-------------------|---------------------------------------|
@@ -70,7 +74,8 @@ Different databases have different data types. The following
table presumes use
| name | varchar(50) | NO | | | the
collection group name |
| default_group | int(11) | NO | | 1 | mark this
group is default, default 1 |
-## comment
+## comment
+
> `comment` table records the comment about question or answer.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -88,7 +93,8 @@ Different databases have different data types. The following
table presumes use
| original_text | mediumtext | NO | | | original comment
content |
| parsed_text | mediumtext | NO | | | parsed comment
content |
-## config
+## config
+
> `config` records the site configuration.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -97,7 +103,8 @@ Different databases have different data types. The following
table presumes use
| key | varchar(128) | YES | UNI | | the config key
|
| value | text | YES | | | the config value, custom
data structures and types |
-## meta
+## meta
+
> `meta` records some extra information about the object.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -109,7 +116,8 @@ Different databases have different data types. The
following table presumes use
| key | varchar(100) | NO | | | key
|
| value | mediumtext | NO | | | value
|
-## notification
+## notification
+
> `notification` table records the notification that user received.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -125,6 +133,7 @@ Different databases have different data types. The
following table presumes use
| status | int(11) | NO | | 1 | notification
status(normal: 1;delete 2) |
## power
+
> `power` table records all permissions
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -137,6 +146,7 @@ Different databases have different data types. The
following table presumes use
| description | varchar(200) | NO | | |
description |
## question
+
> `question` table records the question info.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT |
COMMENT |
@@ -161,7 +171,8 @@ Different databases have different data types. The
following table presumes use
| post_update_time | timestamp | YES | | CURRENT_TIMESTAMP |
answer the last update time |
| revision_id | bigint(20) | NO | | 0 |
revision id |
-## report
+## report
+
> `report` table records the content of user reports
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -179,7 +190,8 @@ Different databases have different data types. The
following table presumes use
| flagged_content | text | YES | | | flagged content
|
| status | int(11) | NO | | 1 | status(normal: 1;
pending:2; delete: 10) |
-## revision
+## revision
+
> `revision` table records the object revision and the content of the version.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -197,6 +209,7 @@ Different databases have different data types. The
following table presumes use
| review_user_id | bigint(20) | NO | | 0 | review user id
|
## role
+
> `role` table records all roles
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -208,6 +221,7 @@ Different databases have different data types. The
following table presumes use
| description | varchar(200) | NO | | |
description |
## role_power_rel
+
> `role_power_rel` records the relationship between roles and powers
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -218,8 +232,8 @@ Different databases have different data types. The
following table presumes use
| role_id | int(11) | NO | | 0 | role id
|
| power_type | varchar(200) | NO | | | power
|
-
## site_info
+
> `site_info` table records the site information about interface or something
> related
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -232,6 +246,7 @@ Different databases have different data types. The
following table presumes use
| status | int(11) | NO | | 1 | site info
status(available: 1;deleted: 10) |
## tag
+
> `tag` table records the tag information.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -251,6 +266,7 @@ Different databases have different data types. The
following table presumes use
| revision_id | bigint(20) | NO | | 0 | revision id
|
## tag_rel
+
> `tag_rel` table records the relationship between objects and tags
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT |
COMMENT |
@@ -262,7 +278,8 @@ Different databases have different data types. The
following table presumes use
| tag_id | bigint(20) | NO | MUL | |
tag_id |
| status | int(11) | NO | | 1 |
tag_list_status(available: 1;deleted: 10) |
-## uniqid
+## uniqid
+
> `uniqid` table recorded the object_id that can uniquely identify an object.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT |
@@ -270,7 +287,8 @@ Different databases have different data types. The
following table presumes use
| id | bigint(20) | NO | PRI | | uniqid_id |
| uniqid_type | int(11) | NO | | 0 | uniqid_type |
-## user
+## user
+
> The user table recorded basic information about the user.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT
|
@@ -303,6 +321,7 @@ Different databases have different data types. The
following table presumes use
| is_admin | int(11) | NO | | 0 | admin
flag(deprecated) |
## user_role_rel
+
> The `user_role_rel` table records the relationship between users and roles.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT |
@@ -314,10 +333,10 @@ Different databases have different data types. The
following table presumes use
| role_id | int(11) | NO | | 0 | role id |
## version
+
> The version of the current answer is recorded in version table for upgrade.
| COLUMN | DATA TYPE | NULLABLE | KEY | DEFAULT | COMMENT |
|----------------|-----------|----------|-----|---------|----------------|
| id | int(11) | NO | PRI | | id |
| version_number | int(11) | NO | | 0 | version_number |
-
diff --git a/docs/getting-started/env.md b/docs/getting-started/env.md
index 80b2b31f..d87ee6ae 100644
--- a/docs/getting-started/env.md
+++ b/docs/getting-started/env.md
@@ -9,7 +9,7 @@ slug: /env
- `INSTALL_PORT`: specifies the port to boot when installation, default is
`80`.
- `AUTO_INSTALL`: if set to `true`, the installation will be completed
automatically by environment variable.
-### For Auto Install
+### For auto install
- `DB_TYPE`: database type, support [`sqlite3` `mysql` `postgres`]
- `DB_USERNAME`: database username
diff --git a/docs/introduction.md b/docs/introduction.md
index 80846e0d..1acd8550 100644
--- a/docs/introduction.md
+++ b/docs/introduction.md
@@ -9,13 +9,13 @@ It's a place where you can share your knowledge and help your
users to solve the
Main features:
-- **Questions and Answers** - Ask questions and get answers from your users
and your team.
-- **Content Organization** - Organize your content into categories and tags.
+- **Questions and answers** - Ask questions and get answers from your users
and your team.
+- **Content organization** - Organize your content into categories and tags.
- **Integrations** - Integrate with your existing tools and services.
- **Gamification** - Reward your users for their contributions.
- **Modern UI** - A modern and responsive UI.
- **Extensible** - Extend Answer with plugins.
-- **Open Source** - Free and open source.
+- **Open source** - Free and open source.
## Architecture
diff --git a/sidebarsCommunity.js b/sidebarsCommunity.js
index 0d375002..6c9bc303 100644
--- a/sidebarsCommunity.js
+++ b/sidebarsCommunity.js
@@ -23,8 +23,6 @@ module.exports = {
items: [
'contributing/backend',
'contributing/frontend',
- 'contributing/development',
- 'contributing/plugins',
],
},
'contributing/pull-request',
diff --git a/src/components/HomePageHeader/index.tsx
b/src/components/HomePageHeader/index.tsx
index 5cac5fe4..8bd39ddb 100644
--- a/src/components/HomePageHeader/index.tsx
+++ b/src/components/HomePageHeader/index.tsx
@@ -143,7 +143,7 @@ const HomeHead: FC = () => {
</Button>
</div>
- <div className="text-center">
+ <div className="text-secondary text-center fs-14">
<Translate
id="home.apache.answer"
>