Skip to content

Commit c3325d3

Browse files
committed
Add learn docs
1 parent ab335f9 commit c3325d3

File tree

8 files changed

+247
-2
lines changed

8 files changed

+247
-2
lines changed

.github/workflows/build-docs-actions.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,26 @@ jobs:
3939
run: |
4040
make html
4141
rm -rf ../../../_site/pyarmor/docs/en
42-
mv _build/html/ ../../../_site/pyarmor/docs/en
42+
mv _build/html ../../../_site/pyarmor/docs/en
4343
working-directory: ./pyarmor/docs/en
4444
- name: Build static files for zh
4545
run: |
4646
make html
4747
rm -rf ../../../_site/pyarmor/docs/zh
48-
mv _build/html/ ../../../_site/pyarmor/docs/zh
48+
mv _build/html ../../../_site/pyarmor/docs/zh
4949
working-directory: ./pyarmor/docs/zh
50+
- name: Build learing files for en
51+
run: |
52+
make html
53+
rm -rf ../../../_site/pyarmor/learn/en
54+
mv _build/html ../../../_site/pyarmor/learn/en
55+
working-directory: ./pyarmor/learn/en
56+
- name: Build learing files for zh
57+
run: |
58+
make html
59+
rm -rf ../../../_site/pyarmor/learn/zh
60+
mv _build/html ../../../_site/pyarmor/learn/zh
61+
working-directory: ./pyarmor/learn/zh
5062
- name: Upload artifact
5163
uses: actions/upload-pages-artifact@v3
5264
with:

pyarmor/learn/en/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

pyarmor/learn/en/conf.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'Learn Pyarmor'
21+
copyright = '2025, Dashingsoft Corp.'
22+
author = 'Jondy Zhao'
23+
24+
# The full version, including alpha/beta/rc tags
25+
release = '1.0'
26+
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
extensions = [
34+
'sphinx.ext.napoleon',
35+
'sphinx.ext.graphviz',
36+
'linuxdoc.rstFlatTable',
37+
]
38+
39+
# Add any paths that contain templates here, relative to this directory.
40+
templates_path = ['_templates']
41+
42+
# The language for content autogenerated by Sphinx. Refer to documentation
43+
# for a list of supported languages.
44+
#
45+
# This is also used if you do content translation via gettext catalogs.
46+
# Usually you set "language" from the command line for these cases.
47+
language = 'en_US'
48+
49+
# List of patterns, relative to source directory, that match files and
50+
# directories to ignore when looking for source files.
51+
# This pattern also affects html_static_path and html_extra_path.
52+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
53+
54+
55+
# -- Options for HTML output -------------------------------------------------
56+
57+
# The theme to use for HTML and HTML Help pages. See the documentation for
58+
# a list of builtin themes.
59+
#
60+
html_theme = 'nature'
61+
62+
# Add any paths that contain custom static files (such as style sheets) here,
63+
# relative to this directory. They are copied after the builtin static files,
64+
# so a file named "default.css" will overwrite the builtin "default.css".
65+
html_static_path = ['_static']
66+
67+
# The output format for Graphviz when building HTML files. This must
68+
# be either 'png' or 'svg'; the default is 'png'. If 'svg' is used, in
69+
# order to make the URL links work properly, an appropriate target
70+
# attribute must be set, such as "_top" and "_blank".
71+
graphviz_output_format = 'svg'

pyarmor/learn/en/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. Pyarmor documentation master file, created by
2+
sphinx-quickstart on Thu Dec 5 18:30:56 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Learn Pyarmor
7+
8+
Indices and tables
9+
==================
10+
11+
* :ref:`genindex`
12+
* :ref:`modindex`
13+
* :ref:`search`

pyarmor/learn/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!doctype html>
2+
<html lang="en" data-bs-theme="auto">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<meta name="description" content="Pyarmor Documentation">
7+
<meta name="author" content="Jondy Zhao">
8+
<title>Pyarmor</title>
9+
10+
</head>
11+
<body>
12+
<h3>Learn Pyarmor</h3>
13+
<ul>
14+
<li><a href="en/index.html">English</a></li>
15+
<li><a href="zh/index.html">简体中文</a></li>
16+
</ul>
17+
<script>
18+
window.addEventListener('DOMContentLoaded', () => {
19+
const lang = navigator.language.startsWith('zh-') ? 'zh' : 'en'
20+
const url = window.location.href.replace('/index.html', `/${lang}/index.html`)
21+
window.location.replace(url.endsWith('/index.html') ? url : `${url}/${lang}/index.html`)
22+
})
23+
</script>
24+
</body>
25+
</html>

pyarmor/learn/zh/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

pyarmor/learn/zh/conf.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = '学习 Pyarmor'
21+
copyright = '2025, 德新科技'
22+
author = '赵俊德'
23+
24+
# The full version, including alpha/beta/rc tags
25+
release = '1.0'
26+
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
extensions = [
34+
'sphinx.ext.napoleon',
35+
'sphinx.ext.graphviz',
36+
'linuxdoc.rstFlatTable',
37+
]
38+
39+
# Add any paths that contain templates here, relative to this directory.
40+
templates_path = ['_templates']
41+
42+
# The language for content autogenerated by Sphinx. Refer to documentation
43+
# for a list of supported languages.
44+
#
45+
# This is also used if you do content translation via gettext catalogs.
46+
# Usually you set "language" from the command line for these cases.
47+
language = 'zh_CN'
48+
49+
# List of patterns, relative to source directory, that match files and
50+
# directories to ignore when looking for source files.
51+
# This pattern also affects html_static_path and html_extra_path.
52+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
53+
54+
55+
# -- Options for HTML output -------------------------------------------------
56+
57+
# The theme to use for HTML and HTML Help pages. See the documentation for
58+
# a list of builtin themes.
59+
#
60+
html_theme = 'nature'
61+
62+
# Add any paths that contain custom static files (such as style sheets) here,
63+
# relative to this directory. They are copied after the builtin static files,
64+
# so a file named "default.css" will overwrite the builtin "default.css".
65+
html_static_path = ['_static']
66+
67+
# The output format for Graphviz when building HTML files. This must
68+
# be either 'png' or 'svg'; the default is 'png'. If 'svg' is used, in
69+
# order to make the URL links work properly, an appropriate target
70+
# attribute must be set, such as "_top" and "_blank".
71+
graphviz_output_format = 'svg'

pyarmor/learn/zh/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. Pyarmor documentation master file, created by
2+
sphinx-quickstart on Thu Dec 5 18:30:56 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
学习 Pyarmor
7+
8+
索引表
9+
======
10+
11+
* :ref:`genindex`
12+
* :ref:`modindex`
13+
* :ref:`search`

0 commit comments

Comments
 (0)