Skip to content

Commit

Permalink
部署到 read the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xinetzone committed Dec 18, 2021
1 parent 5f759d4 commit c5bd392
Show file tree
Hide file tree
Showing 10 changed files with 1,024 additions and 19 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: deploy
on:
push:
branches:
- develop
- rtd

jobs:
build:
Expand All @@ -18,27 +18,18 @@ jobs:
- name: Install dependencies
run: |
pip install -r doc/requirements.txt
pip install sphinx-intl
- name: Clone
run: |
git clone https://github.com/sphinx-locales/sphinx-intl.git draft
- name: Build the book
run: |
cp -rf draft/locales/ doc/locale/
rm -rf draft/
cd doc
sphinx-build -b gettext ./ _build/gettext
sphinx-intl update -p _build/gettext -l zh_CN
sphinx-build -D language=en -b html ./ _build/html/
sphinx-build -D language=zh_CN -b html ./ _build/html/zh-CN
cd ..
cp -rf doc/_build/ _build/
rm -rf doc/_build/
sphinx-build -D language=zh_CN -b html ./ _build/html
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v3.6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/html
publish_dir: doc/_build/html
10 changes: 4 additions & 6 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@

# -- General configuration ---------------------------------------------------

extensions = [
]
extensions = []

source_suffix = '.rst'
master_doc = 'index'
language = None
language = 'zh_CN'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
pygments_style = 'sphinx'


# -- Options for HTML output -------------------------------------------------

html_theme = 'sphinx_rtd_theme'

# -- Options for sphinx-intl example

locale_dirs = ['locale/'] # po files will be created in this directory
gettext_compact = False # optional: avoid file concatenation in sub directories.
locale_dirs = ['locales/'] # po files will be created in this directory
gettext_compact = False # optional: avoid file concatenation in sub directories.
48 changes: 48 additions & 0 deletions doc/locales/zh_CN/LC_MESSAGES/authors.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) Sphinx team
# This file is distributed under the same license as the sphinx-intl
# package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: sphinx-intl 2.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-20 16:06+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#: ../../../AUTHORS.rst:3
msgid "AUTHORS"
msgstr "作者"

#: ../../../AUTHORS.rst:5
msgid "Takayuki Shimizukawa <https://github.com/shimizukawa>"
msgstr ""

#: ../../../AUTHORS.rst:6
msgid "Takeshi Komiya <https://github.com/tk0miya>"
msgstr ""

#: ../../../AUTHORS.rst:9
msgid "Original"
msgstr "原创"

#: ../../../AUTHORS.rst:11
msgid "This utility derived from these projects."
msgstr "这种效用来自于这些项目。"

#: ../../../AUTHORS.rst:13
msgid "https://bitbucket.org/tk0miya/sphinx-gettext-helper"
msgstr ""

#: ../../../AUTHORS.rst:14
msgid "https://bitbucket.org/shimizukawa/sphinx-transifex"
msgstr ""

90 changes: 90 additions & 0 deletions doc/locales/zh_CN/LC_MESSAGES/basic.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) Sphinx team
# This file is distributed under the same license as the sphinx-intl
# package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: sphinx-intl 2.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-20 16:06+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#: ../../basic.rst:3
msgid "Basic"
msgstr "基础"

#: ../../basic.rst:9
msgid "Basic Features"
msgstr "基本功能"

#: ../../basic.rst:11
msgid "create or update po files from pot files."
msgstr "从 pot 文件创建或更新 po 文件。"

#: ../../basic.rst:12
msgid "build mo files from po files."
msgstr "从 po 文件建立 mo 文件。"

#: ../../basic.rst:15
msgid "Optional features"
msgstr "可选功能"

#: ../../basic.rst:16
msgid ""
"These features depends to `transifex-client`_ library. Please refer "
"Installation_ section to install it."
msgstr "这些功能依赖于 `transifex-client`_ 库。请参考 安装_ 部分来安装它。"

#: ../../basic.rst:19
msgid ""
"create ``.transifexrc`` file from environment variable, without "
"interactive input."
msgstr "从环境变量中创建 ``.transifexrc`` 文件,无需交互式输入。"

#: ../../basic.rst:21
msgid "create ``.tx/config`` file without interactive input."
msgstr "创建 ``.tx/config`` 文件,无需交互式输入。"

#: ../../basic.rst:22
msgid "update ``.tx/config`` file from locale/pot files automatically."
msgstr "从 locale/pot 文件中自动更新 ``.tx/config`` 文件。"

#: ../../basic.rst:23
msgid "build mo files from po files in the locale directory."
msgstr "从 locale 目录下的 po 文件建立 mo 文件。"

#: ../../basic.rst:25
msgid "You need to use `tx` command for below features:"
msgstr "你需要使用 `tx` 命令来实现以下功能。"

#: ../../basic.rst:27
msgid "``tx push -s`` : push pot (translation catalogs) to transifex."
msgstr "``tx push -s`` :推送 pot(翻译目录)到 transifex。"

#: ../../basic.rst:28
msgid "``tx pull -l ja`` : pull po (translated catalogs) from transifex."
msgstr "``tx pull -l ja`` : 从 transifex 拉取 po(翻译的目录)。"

#: ../../basic.rst:34
msgid "Installation"
msgstr "安装"

#: ../../basic.rst:36
msgid "Recommend strongly: use virtualenv/venv for this procedure::"
msgstr "强烈推荐:使用 virtualenv/venv 来完成这个程序 ::"

#: ../../basic.rst:40
msgid ""
"If you want to use `Optional Features`_, you need install additional "
"library::"
msgstr "如果你想使用 `可选功能`_,你需要安装额外的库 ::"

0 comments on commit c5bd392

Please sign in to comment.