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 2a325977 change community directory tree
2a325977 is described below
commit 2a32597793cad0f75d455f46f12d64c69240bbe4
Author: fen <[email protected]>
AuthorDate: Wed Nov 15 12:12:05 2023 +0800
change community directory tree
---
community/contributing.md | 4 -
.../contributing/backend.md | 4 +-
.../contributing/contributing.md | 8 +
.../contributing/frontend.md | 4 +-
docs/development/extending/README.md | 210 ---------------------
docs/development/{contributing => }/notice.md | 2 +-
docs/guides/flags.md | 4 +-
docs/guides/moderation.md | 7 +
docs/guides/settings.md | 7 +
.../development/{contributing => }/notice.md | 0
sidebars.js | 78 +-------
sidebarsCommunity.js | 29 ++-
12 files changed, 58 insertions(+), 299 deletions(-)
diff --git a/community/contributing.md b/community/contributing.md
deleted file mode 100644
index 7918f01b..00000000
--- a/community/contributing.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Contributing
-
-Answer helps you to build a community between your users and your team.
-It's a place where you can share your knowledge and help your users to solve
their problems.
diff --git a/docs/development/contributing/backend.md
b/community/contributing/backend.md
similarity index 99%
rename from docs/development/contributing/backend.md
rename to community/contributing/backend.md
index 9d78eee5..fc10263d 100644
--- a/docs/development/contributing/backend.md
+++ b/community/contributing/backend.md
@@ -1,8 +1,8 @@
---
-slug: /contributing/backend
+slug: /development/backend
---
-# Backend
+# Backend Development
> Below is the guideline for Backend Development
## How to set up a development environment
diff --git a/docs/development/contributing/contributing.md
b/community/contributing/contributing.md
similarity index 99%
rename from docs/development/contributing/contributing.md
rename to community/contributing/contributing.md
index 1e73bab0..b6c0a9a7 100644
--- a/docs/development/contributing/contributing.md
+++ b/community/contributing/contributing.md
@@ -3,23 +3,29 @@ slug: /contributing
---
# Contributing
+
> Thanks for your interest in contributing to Answer!
## How to Contribute
+
> You can contribute directly to the github repo by submitting your PR.
## Creating an Issue
+
- Feel free to ask your questions if you have any.
## Creating a 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.
## Commit Message Guidelines
+
```
<type>(<scope>): <subject>
```
### type
+
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
@@ -30,9 +36,11 @@ slug: /contributing
- chore: Changes to the build process or auxiliary tools and libraries such as
documentation generation
### scope
+
The scope can be anything specifying place of the commit change.
### subject
+
The subject contains a succinct description of the change:
- use the imperative, present tense: "change" not "changed" nor "changes"
diff --git a/docs/development/contributing/frontend.md
b/community/contributing/frontend.md
similarity index 99%
rename from docs/development/contributing/frontend.md
rename to community/contributing/frontend.md
index a91f3ec2..0810d319 100644
--- a/docs/development/contributing/frontend.md
+++ b/community/contributing/frontend.md
@@ -1,8 +1,8 @@
---
-slug: /contributing/frontend
+slug: /development/frontend
---
-# Frontend
+# Frontend Development
## ⚙️ Prerequisites
diff --git a/docs/development/extending/README.md
b/docs/development/extending/README.md
deleted file mode 100644
index c006f254..00000000
--- a/docs/development/extending/README.md
+++ /dev/null
@@ -1,210 +0,0 @@
----
-slug: /plugins
----
-
-# Plugins
-:::tip
-
-When we need to do some extensions to Answer's functionality, for example,
OAuth login, we design a way to use plugins to implement these functions.
-
-:::
-
-## Introduction
-### Official Plugins
-You can find a list of officially supported plugins for Answer
[here](https://github.com/apache/incubator-answer-plugins).
-
-### Plugin Type
-> We classify plugins into different types.
-> Different types of plugins have different functions.
-> Plugins of the same type have the same effect, but are implemented
differently.
-
-- Connector: The Connector plugin helps us to implement third-party login
functionality. e.g. `GitHub OAuth Login`
-- Storage: The Storage plugin helps us to upload files to third-party storage.
(preview)
-- Cache: Support for using different caching middleware. e.g. `Redis` (preview)
-- Filter: Filter out illegal questions or answers. (coming soon)
-- Render: Parsers for different content formats. (coming soon)
-- Finder: Support for using search engines to speed up the search for question
answers. (coming soon)
-
-## Build
-> Answer binary supports packaging different required plugins into the binary.
-
-### Prerequisites
-- Original Answer binary
-- [Golang](https://go.dev/) `>=1.18`
-
-### Command
-:::tip
-We use the `build` command provided with the Answer binary to rebuild a
version of Answer with the plugin.
-:::
-
-> For example, let's see how to build an Answer binary that includes the
github third-party login plugin
-
-```shell
-# answer build --with [plugin@plugin_version=[replacement]] --output [file]
-$ ./answer build --with
github.com/apache/incubator-answer-plugins/connector-github
-
-# build a new answer with github login plugin then output to ./new_answer.
-$ ./answer build --with
github.com/apache/incubator-answer-plugins/[email protected] --output
./new_answer
-
-# with multiple plugins
-$ ./answer build \
---with github.com/apache/incubator-answer-plugins/connector-github \
---with github.com/apache/incubator-answer-plugins/connector-google
-
-# with local plugins
-$ ./answer build --with
github.com/apache/incubator-answer-plugins/[email protected]=/my-local-space
-
-# cross compilation. Build a linux-amd64 binary in macos
-$ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ./answer build --with
github.com/apache/incubator-answer-plugins/connector-github
-```
-
-:::tip
-You can use the `plugin` command to list the current binary containing plugins.
-:::
-
-```shell
-$ ./new_answer plugin
-
-# output
-# github connector[0.0.1] made by answerdev
-# google connector[0.0.1] made by answerdev
-```
-
-## Third-party plugin
-:::tip
-We recommend the use of [official
plugins](https://github.com/apache/incubator-answer-plugins), if you want to
use third-party plugins, refer to the following.
-:::
-
-- If the third-party plugin is publicly available, you can build with it like
official plugins.
-- If the third-party plugin is private, you need to download it then build
with.
-
-## Use
-> The answer with the plug-in version is used in the same way as before.
-> You can find the plugin's configuration in the admin page.
-
-
-
-## Upgrade
-You just need to recompile and use the latest version of the plugin.
-
-## Develop
-:::tip
-Viewing the [official
plugin](https://github.com/apache/incubator-answer-plugins) code will make you
to quickly understand and learn plugin development.
-:::
-
-### Backend Development
-#### Implement the base
-> The `Base` interface contains basic information about the plugin and is used
to display.
-
-```go
-// Info presents the plugin information
-type Info struct {
- Name Translator
- SlugName string
- Description Translator
- Author string
- Version string
- Link string
-}
-
-// Base is the base plugin
-type Base interface {
- // Info returns the plugin information
- Info() Info
-}
-```
-
-:::caution
-The `SlugName` of the plugin must be unique. Two plugins with the same
`SlugName` will panic when registering.
-:::
-
-#### Implement the function interface
-:::note
-Different plugin types require different interfaces of implementation.
-
-For example, following is the `Connector` plugin interface.
-:::
-
-```go
-type Connector interface {
- Base
-
- // ConnectorLogoSVG presents the logo in svg format
- ConnectorLogoSVG() string
-
- // ConnectorName presents the name of the connector
- // e.g. Facebook, Twitter, Instagram
- ConnectorName() Translator
-
- // ConnectorSlugName presents the slug name of the connector
- // Please use lowercase and hyphen as the separator
- // e.g. facebook, twitter, instagram
- ConnectorSlugName() string
-
- // ConnectorSender presents the sender of the connector
- // It handles the start endpoint of the connector
- // receiverURL is the whole URL of the receiver
- ConnectorSender(ctx *GinContext, receiverURL string) (redirectURL string)
-
- // ConnectorReceiver presents the receiver of the connector
- // It handles the callback endpoint of the connector, and returns the
- ConnectorReceiver(ctx *GinContext, receiverURL string) (userInfo
ExternalLoginUserInfo, err error)
-}
-```
-
-:::tip
-`Translator` is a struct for translation. Please refer to [the
documentation](/docs/plugins/plugin-translation) for details.
-:::
-
-
-#### Implement the configuration interface
-For details on the description of each configuration item, please refer to
[the documentation](/docs/plugins/plugin-config).
-
-```go
-type Config interface {
- Base
-
- // ConfigFields returns the list of config fields
- ConfigFields() []ConfigField
-
- // ConfigReceiver receives the config data, it calls when the config is
saved or initialized.
- // We recommend to unmarshal the data to a struct, and then use the
struct to do something.
- // The config is encoded in JSON format.
- // It depends on the definition of ConfigFields.
- ConfigReceiver(config []byte) error
-}
-```
-
-#### Register initialization function
-```go
-import "github.com/apache/incubator-answer/plugin"
-
-func init() {
- plugin.Register(&GitHubConnector{
- Config: &GitHubConnectorConfig{},
- })
-}
-```
-
-#### Debugging tips
-:::tip
-During the development and debugging phase, you can use the following tips to
avoid repetitive packaging.
-:::
-
-1. Use answer source code for development.
-2. Write your plugin directly in the plugin directory.
-3. Import your plugin in the main function
-
-After that you just need to start the answer project normally and it will
contain the plugins you developed.
-
-
-## Contributing
-For plugin types that have not been implemented yet, please wait for the
official implementation to be completed before contributing.
-For existing plugin types, you can follow the steps below to contribute the
plugin implementation to us.
-
-1. Submit an issue request to ensure that the official is not developing the
same plug-in as you.
-2. Get confirmation that you can develop your plugin, test it and submit a PR.
-3. Wait for the PR merge, the official will include your plugin.
-
-## Design & Principle
-Since Golang is a static language, there is no friendly plugin mechanism. So
instead of a dynamic approach, we use recompilation for deployment.
diff --git a/docs/development/contributing/notice.md
b/docs/development/notice.md
similarity index 99%
rename from docs/development/contributing/notice.md
rename to docs/development/notice.md
index d6d4208e..2ef81ff5 100644
--- a/docs/development/contributing/notice.md
+++ b/docs/development/notice.md
@@ -1,5 +1,5 @@
---
-slug: /contributing/notice
+slug: /notice
sidebar_label: Notice
---
diff --git a/docs/guides/flags.md b/docs/guides/flags.md
index 89391352..5ae685ef 100644
--- a/docs/guides/flags.md
+++ b/docs/guides/flags.md
@@ -3,5 +3,7 @@ slug: /flags
---
# Flags
->
+
> user can report the illegal content by flag.
+
+To be updated
diff --git a/docs/guides/moderation.md b/docs/guides/moderation.md
index e69de29b..3a17076a 100644
--- a/docs/guides/moderation.md
+++ b/docs/guides/moderation.md
@@ -0,0 +1,7 @@
+---
+slug: /moderation
+---
+
+# Moderation
+
+To be updated
diff --git a/docs/guides/settings.md b/docs/guides/settings.md
index e69de29b..452e7a0a 100644
--- a/docs/guides/settings.md
+++ b/docs/guides/settings.md
@@ -0,0 +1,7 @@
+---
+slug: /settings
+---
+
+# Settings
+
+To be updated
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/contributing/notice.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/notice.md
similarity index 100%
rename from
i18n/zh-CN/docusaurus-plugin-content-docs/current/development/contributing/notice.md
rename to
i18n/zh-CN/docusaurus-plugin-content-docs/current/development/notice.md
diff --git a/sidebars.js b/sidebars.js
index eb385176..1199b65c 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -22,9 +22,6 @@ module.exports = {
{
type: 'category',
label: 'Getting Started',
- link: {
- type: 'generated-index',
- },
collapsed: false,
items: [
'getting-started/installation',
@@ -38,24 +35,18 @@ module.exports = {
{
type: 'category',
label: 'Guides',
- link: {
- type: 'generated-index',
- },
collapsed: true,
items: [
- 'guides/flags',
- // 'guides/moderation',
'guides/permission',
'guides/reputation',
- // 'guides/settings',
+ 'guides/flags',
+ 'guides/moderation',
+ 'guides/settings',
],
},
{
type: 'category',
label: 'Development',
- link: {
- type: 'generated-index',
- },
collapsed: true,
items: [
{
@@ -72,70 +63,9 @@ module.exports = {
'development/extending/plugin-for-ui',
],
},
- {
- type: 'category',
- label: 'Contributing',
- link: {
- type: 'doc',
- id: 'development/contributing/contributing',
- },
- collapsed: true,
- items: [
- 'development/contributing/backend',
- 'development/contributing/frontend',
- 'development/contributing/notice',
- ],
- },
+ 'development/notice',
],
},
'faq',
- {
- type: 'link',
- label: 'Support',
- href: 'https://meta.answer.dev',
- },
],
-
- // tutorialSidebar: [
- // {
- // type: 'link',
- // label: 'Getting Started',
- // href: '#',
- // className: 'section-title',
- // },
- // 'README',
- // { type: 'autogenerated', dirName: 'getting-started' },
- // {
- // type: 'link',
- // label: 'Recipes',
- // href: '#',
- // className: 'section-title',
- // },
- // { type: 'autogenerated', dirName: 'recipes' },
- // {
- // type: 'link',
- // label: 'Development',
- // href: '#',
- // className: 'section-title',
- // },
- // { type: 'autogenerated', dirName: 'development' },
- // {
- // type: 'link',
- // label: 'Resources',
- // href: '#',
- // className: 'section-title',
- // },
- // 'faq',
- // {
- // type: 'link',
- // label: 'Support',
- // href: 'https://github.com/apache/incubator-answer/issues',
- // },
- // {
- // type: 'link',
- // label: 'Roadmap',
- // href: 'https://github.com/orgs/apache/projects/301',
- // },
-
- // ],
};
diff --git a/sidebarsCommunity.js b/sidebarsCommunity.js
index 52163a09..80f1ce4a 100644
--- a/sidebarsCommunity.js
+++ b/sidebarsCommunity.js
@@ -2,16 +2,35 @@ module.exports = {
community: [
'support',
'about',
- 'contributing',
+ {
+ type: 'category',
+ label: 'Contributing',
+ link: {
+ type: 'doc',
+ id: 'contributing/contributing',
+ },
+ collapsed: false,
+ items: [
+ {
+ type: 'category',
+ label: 'Development',
+ collapsed: true,
+ items: [
+ 'contributing/backend',
+ 'contributing/frontend',
+ ],
+ },
+ ],
+ },
{
type: 'link',
- href: 'https://github.com/orgs/apache/projects/301',
- label: 'Roadmap',
+ href: 'https://meta.answer.dev/questions/ask?tags=feature-request',
+ label: 'Feature Request',
},
{
type: 'link',
- href: 'https://meta.answer.dev',
- label: 'Feature request',
+ href: 'https://github.com/orgs/apache/projects/301',
+ label: 'Roadmap',
},
],
};