Skip to content

Commit 22fd40d

Browse files
author
River@devbox
committed
Added: zh site
1 parent 3e48dfa commit 22fd40d

File tree

112 files changed

+556
-84395
lines changed

Some content is hidden

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

112 files changed

+556
-84395
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ qpython-docs/venv/*
4141
qpython-docs/build/*
4242
qpython-docs/static/*
4343
venv
44+
site

build.sh

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
#!/bin/bash
2+
3+
# Build script for QPython documentation
4+
# Supports both English and Chinese
5+
6+
set -e
7+
8+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9+
cd "$SCRIPT_DIR"
10+
11+
PYTHON="$SCRIPT_DIR/venv/bin/python"
12+
13+
echo "Building QPython documentation..."
14+
echo ""
15+
16+
# Clean previous build
17+
echo "Cleaning previous build..."
18+
rm -rf site
19+
20+
# Build English site
21+
echo "Building English site..."
22+
$PYTHON -m mkdocs build
23+
24+
# Build Chinese site
25+
echo "Building Chinese site..."
26+
$PYTHON -m mkdocs build -f mkdocs-zh.yml
27+
28+
# Create root index.html
29+
echo "Creating root index.html..."
30+
cat > site/index.html << 'EOF'
31+
<!DOCTYPE html>
32+
<html>
33+
<head>
34+
<meta charset="utf-8">
35+
<title>QPython Documentation</title>
36+
<meta http-equiv="refresh" content="0; url=en/">
37+
<style>
38+
body {
39+
font-family: Roboto, Arial, sans-serif;
40+
display: flex;
41+
justify-content: center;
42+
align-items: center;
43+
height: 100vh;
44+
margin: 0;
45+
background: #000;
46+
color: #fff;
47+
}
48+
.container {
49+
text-align: center;
50+
}
51+
.logo {
52+
margin-bottom: 30px;
53+
}
54+
.logo img {
55+
height: 80px;
56+
}
57+
h1 {
58+
font-weight: 300;
59+
margin-bottom: 40px;
60+
}
61+
.languages {
62+
display: flex;
63+
gap: 20px;
64+
justify-content: center;
65+
}
66+
.lang-btn {
67+
padding: 15px 40px;
68+
border: 2px solid #49B300;
69+
color: #49B300;
70+
text-decoration: none;
71+
border-radius: 5px;
72+
transition: all 0.3s;
73+
font-size: 18px;
74+
}
75+
.lang-btn:hover {
76+
background: #49B300;
77+
color: #000;
78+
}
79+
</style>
80+
</head>
81+
<body>
82+
<div class="container">
83+
<div class="logo">
84+
<img src="en/_static/img_logo.png" alt="QPython">
85+
</div>
86+
<h1>Choose your language / 选择语言</h1>
87+
<div class="languages">
88+
<a href="en/" class="lang-btn">English</a>
89+
<a href="zh/" class="lang-btn">中文</a>
90+
</div>
91+
</div>
92+
</body>
93+
</html>
94+
EOF
95+
96+
echo ""
97+
echo "Build complete!"
98+
echo ""
99+
echo "Output directories:"
100+
echo " - English: site/en/"
101+
echo " - Chinese: site/zh/"
102+
echo " - Root: site/index.html"
103+
echo ""
104+
echo "To preview locally:"
105+
echo " cd site && python -m http.server 8000"

mkdocs-zh.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
site_name: QPython
2+
site_url: https://www.qpython.org/zh/
3+
site_description: QPython - 移动设备上的 Python & AI 开发环境
4+
theme:
5+
name: material
6+
logo: _static/img_logo.png
7+
favicon: _static/img_logo.png
8+
palette:
9+
- scheme: default
10+
primary: black
11+
accent: green
12+
toggle:
13+
icon: material/brightness-7
14+
name: 切换暗色模式
15+
- scheme: slate
16+
primary: black
17+
accent: green
18+
toggle:
19+
icon: material/brightness-4
20+
name: 切换亮色模式
21+
features:
22+
- navigation.tabs
23+
- navigation.sections
24+
- navigation.expand
25+
- search.suggest
26+
- search.highlight
27+
- content.code.copy
28+
font:
29+
text: Roboto
30+
code: Roboto Mono
31+
32+
extra_css:
33+
- _static/extra.css
34+
35+
docs_dir: source/zh
36+
site_dir: site/zh
37+
clean: false # Don't clean to preserve English build
38+
39+
nav:
40+
- 首页: index.md
41+
42+
markdown_extensions:
43+
- pymdownx.highlight:
44+
anchor_linenums: true
45+
- pymdownx.inlinehilite
46+
- pymdownx.snippets
47+
- pymdownx.superfences
48+
- tables
49+
- toc:
50+
permalink: true
51+
52+
extra:
53+
social:
54+
- icon: fontawesome/brands/github
55+
link: https://github.com/qpython-android/qpython
56+
- icon: fontawesome/brands/discord
57+
link: https://discord.gg/hV2chuD
58+
- icon: fontawesome/brands/facebook
59+
link: http://www.facebook.com/qpython
60+
- icon: fontawesome/brands/twitter
61+
link: http://www.twitter.com/qpython

mkdocs.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
site_name: QPython Documentation
2-
site_url: https://www.qpython.org/
1+
site_name: QPython
2+
site_url: https://www.qpython.org/en/
33
site_description: QPython - Learn Python & AI on Mobile
44
theme:
55
name: material
6+
logo: _static/img_logo.png
7+
favicon: _static/img_logo.png
68
palette:
79
- scheme: default
8-
primary: green
10+
primary: black
911
accent: green
1012
toggle:
1113
icon: material/brightness-7
1214
name: Switch to dark mode
1315
- scheme: slate
14-
primary: green
16+
primary: black
1517
accent: green
1618
toggle:
1719
icon: material/brightness-4
@@ -23,21 +25,26 @@ theme:
2325
- search.suggest
2426
- search.highlight
2527
- content.code.copy
28+
font:
29+
text: Roboto
30+
code: Roboto Mono
31+
32+
extra_css:
33+
- _static/extra.css
2634

2735
docs_dir: source/en
28-
site_dir: site
36+
site_dir: site/en
2937

3038
nav:
31-
- Home: index.md
32-
- Getting Started:
33-
- Getting Started: getting-started.md
34-
- Hello World Tutorial: tutorial-hello-world.md
39+
- Home:
40+
- Overview: index.md
41+
- What's NEW: whats-new.md
3542
- Guides:
3643
- QPython Branches: qpython-x.md
3744
- QPYPI Guide: qpypi-guide.md
3845
- Editor Guide: editor-guide.md
3946
- External API: external-api.md
40-
- QSL4A API:
47+
- QSL4A:
4148
- Overview: qsl4a/index.md
4249
- Core:
4350
- Android Base: qsl4a/core/android-base.md
@@ -70,6 +77,9 @@ nav:
7077
- Special:
7178
- Cipher: qsl4a/special/cipher.md
7279
- PGPT AI: qsl4a/special/pgptai.md
80+
- Tutorial:
81+
- Getting Started: getting-started.md
82+
- Hello World Tutorial: tutorial-hello-world.md
7383

7484
markdown_extensions:
7585
- pymdownx.highlight:

0 commit comments

Comments
 (0)