Skip to content

Commit 7eb720a

Browse files
lexon-fsBao Zhiyuan
authored and
Bao Zhiyuan
committed
docs.moonbitlang.com
1 parent fb0e55e commit 7eb720a

File tree

372 files changed

+39615
-2078
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

372 files changed

+39615
-2078
lines changed

.github/workflows/check.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77
pull_request:
88
paths:
9-
- examples
9+
- legacy/examples
1010
schedule:
1111
- cron: '0 10 * * 2'
1212

@@ -50,7 +50,7 @@ jobs:
5050
run: |
5151
moon update
5252
failed_directories=()
53-
for dir in examples/*; do
53+
for dir in legacy/examples/*; do
5454
if [ -d "$dir" ]; then
5555
echo "Processing $dir"
5656
if ! (cd "$dir" && moon install && moon check --target ${{ matrix.backend }} && moon test --target ${{ matrix.backend }}); then
@@ -78,7 +78,7 @@ jobs:
7878
run: |
7979
moon update
8080
$failed_directories = @()
81-
Get-ChildItem -Path ".\examples" -Directory | ForEach-Object {
81+
Get-ChildItem -Path ".\legacy\examples" -Directory | ForEach-Object {
8282
Write-Output "Processing $($_.FullName)"
8383
Set-Location $_.FullName
8484
moon install && moon check --target ${{ matrix.backend }} && moon test --target ${{ matrix.backend }}

.github/workflows/release.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: release website
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
en-build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: install
15+
run: |
16+
pnpm install
17+
- name: build
18+
run: |
19+
cd moonbit-docs
20+
pnpm build -l en
21+
- name: upload
22+
run: |
23+
aws s3 sync --delete ./build/ ${{secrets.AWS_S3_BUCKET}}
24+
aws cloudfront create-invalidation --distribution-id ${{secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID}} --paths "/*"
25+
26+
zh-build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: install
31+
run: |
32+
pnpm install
33+
- name: build
34+
run: |
35+
cd moonbit-docs
36+
pnpm build -l zh
37+
- name: upload
38+
run: |
39+
aliyun oss sync ./build/ ${{secrets.ALIYUN_OSS_BUCKET}} --force --delete
40+
aliyun cdn RefreshObjectCaches --ObjectPath https://docs.moonbitlang.cn/ --ObjectType Directory

.github/workflows/website-check.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: check website
2+
3+
on:
4+
pull_request:
5+
branches: main
6+
7+
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: pnpm/action-setup@v4
13+
with:
14+
version: 9
15+
- name: install
16+
run: |
17+
pnpm install
18+
- name: check
19+
run: |
20+
cd moonbit-docs
21+
pnpm typecheck
22+
pnpm build

.gitignore

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1-
.vscode
2-
target
1+
# Dependencies
2+
/node_modules
33

4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
/.idea
22+
.npmrc
23+
/packages/rehypeshiki/node_modules
24+
/moonbit-docs/node_modules

.prettierignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
static
2+
moonbit-docs/languages
3+
packages
4+
**/pnpm-lock.yaml
5+
**/.git
6+
**/node_modules
7+
**/.gitignore
8+
**/data
9+
**/build
10+
**/.docusaurus
11+
legacy

.prettierrc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSameLine": false,
4+
"bracketSpacing": true,
5+
"embeddedLanguageFormatting": "auto",
6+
"endOfLine": "lf",
7+
"htmlWhitespaceSensitivity": "css",
8+
"insertPragma": false,
9+
"jsxSingleQuote": true,
10+
"printWidth": 80,
11+
"proseWrap": "preserve",
12+
"quoteProps": "as-needed",
13+
"requirePragma": false,
14+
"semi": false,
15+
"singleAttributePerLine": false,
16+
"singleQuote": true,
17+
"tabWidth": 2,
18+
"trailingComma": "none",
19+
"useTabs": false,
20+
"vueIndentScriptAndStyle": false
21+
}

CONTRIBUTING.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# Contributing Guidelines
22

3-
*Pull requests, bug reports, and all other forms of contribution are welcomed and highly encouraged!*
3+
_Pull requests, bug reports, and all other forms of contribution are welcomed and highly encouraged!_
44

55
## :bulb: Asking Questions
66

7-
See our forum([EN](https://discuss.moonbitlang.com/)/[ZH](https://taolun.moonbitlang.cn/)). In short, GitHub issues are not the appropriate place to debug your specific project, but should be reserved for filing bugs and feature requests.
8-
7+
See our forum([EN](https://discuss.moonbitlang.com/)/[ZH](https://taolun.moonbitlang.com/)). In short, GitHub issues are not the appropriate place to debug your specific project, but should be reserved for filing bugs and feature requests.
98

109
## :inbox_tray: Opening an Issue
1110

LICENSE.md

+5
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ All prose content added before July 4, 2024 are copyright reserved.
1515

1616
Code examples and snippets are available under
1717
[Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt)
18+
19+
## License for website code
20+
21+
Website code are available under
22+
[Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt)

READEM-zh.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# MoonBit 文档网站
2+
3+
该仓库存储MoonBit的文档网站[docs.moonbitlang.cn](https://docs.moonbitlang.cn)
4+
5+
## 如何开始
6+
7+
我们使用[Docusaurus 3](https://docusaurus.io/)开发这个网站
8+
9+
### 安装
10+
11+
```bash
12+
pnpm install
13+
```
14+
15+
由于我们使用了pnpm workspace, 网站相关的代码在 `moonbit-docs` 文件夹下,所以请确保接下来的命令在 `moonbit-docs` 文件夹下执行。如果您不了解如何更改文件夹,请执行:
16+
17+
```bash
18+
cd moonbit-docs
19+
```
20+
21+
### 本地开发
22+
23+
```
24+
pnpm start -l zh
25+
```
26+
27+
这个命令会启动一个本地的开发服务器并打开一个浏览器窗口。大部分改动不需要重启服务器即可实时反映出来。
28+
29+
### 预览
30+
31+
```
32+
pnpm build -l zh && pnpm serve
33+
```
34+
35+
这个命令会完成一次生产级构建并启动一个本地服务器来预览它。
36+
37+
## 如何撰写文档
38+
39+
### 修改已有的文档
40+
41+
文档相关的 markdown 文件保存在`moonbit-docs/i18n/zh/docusaurus-plugin-content-docs/current`文件夹下。
42+
43+
### 增加新的文档
44+
45+
1.`moonbit-docs/i18n/zh/docusaurus-plugin-content-docs/current` 文件夹下增加新的文档文件
46+
1.`moonbit-docs/docs`文件夹下增加对应的英文文档文件,如果您不了解英文,可以只留一个占位的文件。
47+
1.`moonbit-docs/sidebars.ts`文件中更新sidebar

0 commit comments

Comments
 (0)