diff --git a/.gitignore b/.gitignore index 713854a..56c586c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,7 @@ dist # build build/ secretflow_spec.egg-info/ -secretflow_spec/protos/protoc-26.1/ \ No newline at end of file +secretflow_spec/protos/protoc-26.1/ + +.venv/ +*.mo diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 0000000..94abb16 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,523 @@ +# Contributing docs | 文档贡献指南 + +- [tl;dr](#tldr) +- [Prerequisites](#prerequisites) +- [Setting up](#setting-up) +- [Building docs](#building-docs) +- [Previewing docs](#previewing-docs) +- [Translations](#translations) + - [Updating translation files](#updating-translation-files) + - [Translating](#translating) + - [Previewing translated docs](#previewing-translated-docs) +- [Auto-generated docs](#auto-generated-docs) +- [Cleaning up](#cleaning-up) +- [Reporting issues](#reporting-issues) +- [前置条件](#前置条件) +- [环境准备](#环境准备) +- [构建文档](#构建文档) +- [预览文档](#预览文档) +- [更新翻译](#更新翻译) + - [同步翻译文件](#同步翻译文件) + - [进行翻译](#进行翻译) + - [预览翻译](#预览翻译) +- [自动生成的文档](#自动生成的文档) +- [文件清理](#文件清理) +- [报告问题](#报告问题) + +> [!TIP] +> +> Command line examples in this guide assume your working directory to be [docs/](./). + +## tl;dr + +```sh +python -m pip install -r requirements.txt +secretflow-doctools update-translations --lang zh_CN +secretflow-doctools build --lang en --lang zh_CN +secretflow-doctools preview +``` + +## Prerequisites + +This project uses [Sphinx] to build documentation. You will need: + +- [Python] >= 3.10 + +## Setting up + +Run: + +```sh +python -m venv .venv +source .venv/bin/activate +python -m pip install -r requirements.txt +``` + +This will: + +- Create a new [virtual environment][venv] in a `.venv` directory +- Activate the virtual environment (so that dependencies are installed to the correct + environment). +- Install the [required dependencies for building docs](./requirements.txt) + +> [!TIP] +> +> This example uses Python's built-in [`venv`][venv] module. You may also use other +> package managers such as [uv] or [mamba]. + +## Building docs + +[`secretflow-doctools`] is a command-line utility for building docs for SecretFlow +projects. + +To build docs, run: + +```sh +secretflow-doctools build --lang en --lang zh_CN +``` + +This will build both the English (`en`) and the Simplified Chinese (`zh_CN`) versions of +the documentation. + +You should be able to see the following output: + +```log +SUCCESS to preview, run: secretflow-doctools preview -c . +``` + +> [!TIP] +> +> If you are getting a "command not found" error, you might not have activated the +> correct environment by running `source .venv/bin/activate`. Please review +> [Setting up](#setting-up). + +## Previewing docs + +The utility features a documentation previewer. You will be able to visualize how your +changes will eventually appear on our [website]. + +To preview the docs that was built, run: + +```sh +secretflow-doctools preview +``` + +This will start the server. You should be able to see the following output: + +``` + * Running on http://127.0.0.1:5000 +``` + +Navigate to on your browser (the port number may be different), +you should be able to see a page similar to the following: + +
+ the sitemap page +
+ +Click on a version to see the preview. You should be able to see a page similar to the +following: + +
+ the content page +
+ +> [!TIP] +> +> You may leave the preview server running. When you run the build command again, +> refresh the page to see updated content. + +## Translations + +### Updating translation files + +After updating source docs, you should also update the corresponding translation files. + +> [!IMPORTANT] +> +> If your updates involve rewriting existing texts, you MUST update translation files, +> otherwise some translated paragraphs may fall back to showing the original text. + +Run: + +```sh +secretflow-doctools update-translations --lang zh_CN +# `--lang zh_CN` sets the target language to Chinese (i.e. you are translating into Chinese) +``` + +This will: + +- Scan source text for changes +- Update the translation files under [locale/](locale/) such that they become in-sync + again + +If there are updates, you should be able to see output similar to the following, and see +changes in source control: + +``` +Update: locale/zh_CN/LC_MESSAGES/index.po +1, -0 +... +SUCCESS finished updating translation files +``` + +### Translating + +This project uses [GNU gettext][gettext] to translate docs during build. Translation +files are under [locale/](locale/). + +Paths to the [translation files (PO files)][gettext-po] mirror their source document +counterparts. For example: + +| | | +| :----------- | :------------------------------------------------------------------------- | +| Source texts | [**intro**.md](intro.md) | +| Translations | [locale/zh_CN/LC_MESSAGES/**intro**.po](locale/zh_CN/LC_MESSAGES/intro.po) | + +PO files have the following syntax: + +```gettext +msgid "Hello, world!" +msgstr "你好,世界!" +``` + +`msgid` comes from source docs, which will be used to lookup translations during build, +and you should not modify them. + +`msgstr` is the translation. Please update these. + +> [!TIP] +> +> [Poedit] is a free and open-source graphical editor for gettext PO files and is highly +> recommended. +> +>
+> screenshot of Poedit +>
+ +> [!IMPORTANT] + +- `msgstr` may contain inline markups, such as bolded text or links. Translations should + retain such markups. You should ensure the markup syntax is consistent with the source + document: + + ```diff + msgid "This is a `link `_." + - msgstr "这是一个 [链接](https://example.org/) 。" + + msgstr "这是一个 `链接 `_ 。" + ``` + +- You may notice a `fuzzy` label after + [updating translation files](#updating-translation-files): + + ```diff + #: ../../topics/ccl/usage.rst:9 + + #, fuzzy + - msgid "What is SCQL CCL? Please read :doc:`/topics/ccl/intro`." + + msgid "What is SCQL CCL? Please read :doc:`/topics/ccl/intro` first." + msgstr "什么是 SCQL CCL?请参阅 :doc:`/topics/ccl/intro`。" + ``` + + `fuzzy` indicates that a source paragraph is updated but only slightly. You should + revise `fuzzy` translations, and then remove the `fuzzy` label. + + `fuzzy` entries will still appear in the output even if they not updated in time, + albeit the displayed content is then slightly different from source text. + +- You may notice `.mo` files under [locale/](locale/). These are binary files + autogenerated during builds and are not editable. The files to edit are `.po` files. + +### Previewing translated docs + +After updating translations, [build docs](#building-docs) again to preview them. + +## Auto-generated docs + +Some reference docs are auto-generated from code. To generate these docs, run: + +```sh +make autogenerated +# see Makefile for actual command +``` + +> [!IMPORTANT] +> +> Note that the generated files are NOT gitignored. **You should run this step whenever +> there are updates to code, and commit the changes.** + +## Cleaning up + +The above tasks generate temporary files under [\_build](./_build/). To clean up these +files, run: + +```sh +secretflow-doctools clean +``` + +## Reporting issues + +If commands or previews aren't working as expecting, please file an issue at +. + +For project-specific questions, please file an issue in this repository instead. + +> [!NOTE] +> +> To help with troubleshooting, set the `LOGURU_LEVEL=DEBUG` environment variable to see +> debug logs. +> +> `secretflow-doctools` invokes other programs. When `LOGURU_LEVEL=DEBUG` is set, +> logging will contain the full commands being run: +> +> | Command | Delegates to | +> | :---------------------------------------- | :--------------- | +> | `secretflow-doctools build` | [`sphinx-build`] | +> | `secretflow-doctools update-translations` | [`sphinx-intl`] | + +--- + +> [!TIP] +> +> 下文的示例命令建议在[本目录 (docs)](./) 下执行。 + +## 前置条件 + +本项目使用 [Sphinx] 作为文档框架。你需要: + +- [Python] >= 3.10 + +## 环境准备 + +执行: + +```sh +python -m venv .venv +source .venv/bin/activate +python -m pip install -r requirements.txt +``` + +这将会: + +- 在当前目录下的 `.venv` 目录创建一个 [Python 虚拟环境][venv] +- 激活该虚拟环境(以确保依赖被安装到正确位置) +- 安装文档构建[所需要的依赖](./requirements.txt) + +> [!TIP] +> +> 这里以 Python 自带的 [`venv`][venv] 为示例。你也可以使用 [uv], [mamba] 等其他的依赖管 +> 理工具。 + +## 构建文档 + +[`secretflow-doctools`] 是针对隐语项目文档构建的辅助工具,它协助开发者在本地构建并 +且[预览](#预览文档)文档。 + +执行: + +```sh +secretflow-doctools build --lang en --lang zh_CN +``` + +这将会构建英文版 `en` 以及中文版 `zh_CN` 文档。 + +如果一切正常,你应当能看到以下输出: + +```log +SUCCESS to preview, run: secretflow-doctools preview -c . +``` + +> [!TIP] +> +> 如果提示 `secretflow-doctools` 命令未找到,你可能没有执行 `source .venv/bin/activate` +> 以激活正确的 Python 环境;请参考[环境准备](#环境准备)中的指引。 + +如果想要只构建某个语言的文档,可以调整 `--lang` 选项。 + +## 预览文档 + +工具提供了本地预览的能力,帮助开发者验证文档在**发布到[隐语官网][website]后的显示效 +果**。 + +执行: + +```sh +secretflow-doctools preview +``` + +这将会在本地启动一个预览服务器。你应当能看到以下输出: + +``` + * Running on http://127.0.0.1:5000 +``` + +用浏览器访问 (或其它端口号),你应当能看到类似下图的页面,其中 +将会列出在本地构建好的文档版本: + +
+ the sitemap page +
+ +点击一个版本即可打开对应预览,你应当能看到类似下图的页面: + +
+ the content page +
+ +> [!TIP] +> +> 你可以保持预览服务器一直开启:在重新构建文档后,刷新页面即可看到更新的内容。 + +## 更新翻译 + +### 同步翻译文件 + +当你更新了文档原文(无论是新增、修改还是删除),你需要同时更新对应的翻译文件。 + +> [!IMPORTANT] +> +> 如果你的变更是对现有文本进行修改,请务必同步翻译文件,否则现有翻译可能会失效,发布后可 +> 能会出现中英文夹杂的情况。 + +执行: + +```sh +secretflow-doctools update-translations --lang zh_CN +# 其中 --lang zh_CN 代表目标语言是中文(翻译成中文) +``` + +这将会: + +- 扫描文档原文的文本内容 +- 更新 [locale/](locale/) 目录下的翻译文件,使得它们和原文维持同步 + +如果有更新,你应当能看到类似下文的输出,并且在版本控制中看到文件修改: + +``` +Update: locale/zh_CN/LC_MESSAGES/index.po +1, -0 +... +SUCCESS finished updating translation files +``` + +### 进行翻译 + +本项目使用 [GNU gettext][gettext] 来配置文档内容的多语言版本。翻译用文件全部位于 +[locale/](locale/) 目录下。 + +[翻译文件(PO 文件)][gettext-po]的路径与文档原文是**一对一**的关系,示例: + +| | | +| :--- | :------------------------------------------------------------------------- | +| 原文 | [**intro**.md](intro.md) | +| 翻译 | [locale/zh_CN/LC_MESSAGES/**intro**.po](locale/zh_CN/LC_MESSAGES/intro.po) | + +翻译文件的格式如下: + +```gettext +msgid "Hello, world!" +msgstr "你好,世界!" +``` + +`msgid` 来自文档原文,**将会用于在构建时通过原文索引到翻译,因此请勿修改。** + +`msgstr` 是翻译后的文本,请修改这一字段。 + +> [!TIP] +> +> [Poedit] 是一个用于编辑 PO 文件的自由开源软件。可以尝试使用它来进行翻译。 +> +>
+> screenshot of Poedit +>
+ +> [!IMPORTANT] +> +> 以下是翻译的一些注意事项: + +- `msgstr` 中可能会包含样式标记(比如字体加粗、链接等),在翻译文本中,标记应当与原文一 + 致: + + ```diff + msgid "This is a `link `_." + - msgstr "这是一个 [链接](https://example.org/) 。" + + msgstr "这是一个 `链接 `_ 。" + ``` + +- 在[同步翻译文件](#同步翻译文件)后,你可能会留意到一些翻译条目被加上了 `fuzzy` 的标记, + 比如: + + ```diff + #: ../../topics/ccl/usage.rst:9 + + #, fuzzy + - msgid "What is SCQL CCL? Please read :doc:`/topics/ccl/intro`." + + msgid "What is SCQL CCL? Please read :doc:`/topics/ccl/intro` first." + msgstr "什么是 SCQL CCL?请参阅 :doc:`/topics/ccl/intro`。" + ``` + + `fuzzy` 意味着 `gettext` 判断原文有轻微变化,需要人工校对。你应当更新翻译,然后将 + `fuzzy` 标记去掉。 + + `fuzzy` 条目的意义在于构建后不会失效,也就是说,即使没有及时更新翻译,旧翻译也能继续显 + 示(不过会稍微与原文不一致)。 + +- 你可能会在 [locale/](locale/) 目录下找到后缀为 `.mo` 的文件,这些文件时构建时产生的二 + 进制文件,它们无法被修改也无需关注,你应当修改后缀为 `.po` 的文件。 + +### 预览翻译 + +在更新了翻译文件之后,重新[执行文档构建](#构建文档)然后[预览文档](#预览文档),即可看到翻 +译后的显示效果。 + +## 自动生成的文档 + +一些参考文档由代码自动生成。要更新这些文档,执行: + +```sh +make autogenerated +# 详细命令见 Makefile +``` + +> [!IMPORTANT] +> +> 生成的文件**不会**被 gitignore。当相关代码有更新时,请执行这一步骤,并且提交产生的变更 +> 。 + +## 文件清理 + +以上流程会产生额外的临时文件,这些文件全部位于 [\_build](./_build/) 目录下。如果需要清理 +,可以执行: + +```sh +secretflow-doctools clean +``` + +## 报告问题 + +如果在以上过程中遇到报错、预览无法显示等问题,可以提交问题到 +。 + +文档内容及本项目代码的相关问题请提交到本项目的 Issues 中。 + +> [!NOTE] +> +> 为协助排查问题,你可以设置 `LOGURU_LEVEL=DEBUG` 环境变量来让文档工具输出更多日志。 +> +> `secretflow-doctools` 会调用其他工具,在 `LOGURU_LEVEL=DEBUG` 时,日志会在每个步骤打印 +> 完整的命令行指令: +> +> | | | +> | :---------------------------------------- | :--------------- | +> | `secretflow-doctools build` | [`sphinx-build`] | +> | `secretflow-doctools update-translations` | [`sphinx-intl`] | + +[`secretflow-doctools`]: https://github.com/secretflow/doctools +[`sphinx-apidoc`]: https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html +[`sphinx-build`]: https://www.sphinx-doc.org/en/master/man/sphinx-build.html +[`sphinx-intl`]: https://www.sphinx-doc.org/en/master/usage/advanced/intl.html +[gettext-po]: https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html +[gettext]: https://www.gnu.org/software/gettext/ +[mamba]: https://mamba.readthedocs.io/en/latest/ +[Poedit]: https://poedit.net/ +[Python]: https://www.python.org/ +[Sphinx]: https://www.sphinx-doc.org/en/master/tutorial/index.html +[uv]: https://docs.astral.sh/uv/ +[venv]: https://docs.python.org/3/library/venv.html +[website]: https://www.secretflow.org.cn/ diff --git a/docs/Makefile b/docs/Makefile index d4bb2cb..63d8402 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,20 +1,33 @@ -# Minimal makefile for Sphinx documentation +# Copyright 2025 Ant Group Co., Ltd. # +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +.PHONY: build +build: + secretflow-doctools build --lang en --lang zh_CN -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build +.PHONY: autogenerated +autogenerated: $(eval SHELL:=/bin/bash) + @sh "./update_data.sh" -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) +.PHONY: translations +translations: + secretflow-doctools update-translations --lang zh_CN -.PHONY: help Makefile +.PHONY: preview +preview: + secretflow-doctools preview -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) +.PHONY: clean +clean: + secretflow-doctools clean diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index ed771c8..0000000 --- a/docs/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Instructions for Documentation - -## Update Data - -Docker is required. - -``` -sh update_data.sh -``` - -## Update sphinx-intl File -``` -sh update_po.sh -``` - -## Build Html - -``` -sh build_doc.sh -l -``` - -The generated html is at **_build/html/** diff --git a/docs/_static/CONTRIBUTING/preview-content.png b/docs/_static/CONTRIBUTING/preview-content.png new file mode 100644 index 0000000..22d6ec2 Binary files /dev/null and b/docs/_static/CONTRIBUTING/preview-content.png differ diff --git a/docs/_static/CONTRIBUTING/preview-sitemap.png b/docs/_static/CONTRIBUTING/preview-sitemap.png new file mode 100644 index 0000000..2b774ed Binary files /dev/null and b/docs/_static/CONTRIBUTING/preview-sitemap.png differ diff --git a/docs/build_doc.sh b/docs/build_doc.sh deleted file mode 100644 index a2d8853..0000000 --- a/docs/build_doc.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -usage() { echo "Usage: $0 [-l ]" 1>&2; exit 1; } - - -while getopts ":l:" o; do - case "${o}" in - l) - l=${OPTARG} - ;; - *) - usage - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${l}" ]; then - usage -fi - -echo "selected language is: ${l}" - -if [[ "$l" != "en" && "$l" != "zh_CN" ]]; then - usage -fi - -make clean -env PYTHONPATH=$PYTHONPATH:$PWD/.. make SPHINXOPTS="-D language='${l}'" html diff --git a/docs/conf.py b/docs/conf.py index 21d32e3..ed114a0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,67 +1,83 @@ -# Configuration file for the Sphinx documentation builder. +# Copyright 2025 Ant Group Co., Ltd. # -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. project = "Secretflow Open Specification" -copyright = "2023 Ant Group Co., Ltd." -author = "sfspec authors" - -# -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration - -extensions = ["myst_parser"] - -templates_path = ["_templates"] -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] - - -# -- Options for sphinx-int ------------------------------------------------- -locale_dirs = ["locale/"] # path is example but recommended. -gettext_compact = False # optional. - -# -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output - -html_theme = "pydata_sphinx_theme" -html_static_path = ["_static"] - -# Enable TODO -todo_include_todos = True - -autodoc_default_options = { - "members": True, - "member-order": "bysource", - "special-members": "__init__", - "undoc-members": False, - "show-inheritance": False, -} - - -html_favicon = "_static/favicon.ico" - -html_css_files = [ - "css/custom.css", +extensions = [ + "secretflow_doctools", + # enable support for .md files + # https://myst-parser.readthedocs.io/en/latest/ + "myst_parser", ] -html_js_files = ["js/custom.js"] +# source files are in this language +language = "en" +# translation files are in this directory +locale_dirs = ["./locale/"] +# this should be false so 1 doc file corresponds to 1 translation file +gettext_compact = False +gettext_uuid = False +# allow source texts to keep using outdated translations if they are only marginally changed +# otherwise any change to source text will cause their translations to not appear +gettext_allow_fuzzy_translations = True + +# list of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [ + "CONTRIBUTING.md", # prevent CONTRIBUTING.md from being included in output, optional + ".venv", + "_build", + "Thumbs.db", + ".DS_Store", +] -html_theme_options = { - "icon_links": [ - { - "name": "GitHub", - "url": "https://github.com/secretflow/spec", - "icon": "fab fa-github-square", - "type": "fontawesome", - }, - ], - "logo": { - "text": "Secretflow Open Specification", - }, - "show_nav_level": 4, - "language_switch_button": True, -} +# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html +myst_enable_extensions = [ + # LaTeX math + # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#direct-latex-math + "amsmath", + # attributes + # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#attributes + "attrs_block", + "attrs_inline", + # code fence using ::: + # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#code-fences-using-colons + "colon_fence", + # $math$ and $$math$$ + # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#dollar-delimited-math + "dollarmath", + # :name: value + # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#field-lists + "fieldlist", + # + # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#html-images + "html_image", + # detect "bare" links + # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#linkify + "linkify", + # "double quotes" => “double quotes” + # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#typography + "smartquotes", + # ~~strikethrough~~ + # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#strikethrough + "strikethrough", +] +# enable all MyST syntax features +# https://myst-parser.readthedocs.io/en/latest/configuration.html#global-configuration +myst_gfm_only = False +# generate #anchors for heading # through ###### +# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#auto-generated-header-anchors +myst_heading_anchors = 6 + +suppress_warnings = ["autosectionlabel", "myst.header"] diff --git a/docs/intro.md b/docs/intro.md index b549c91..7787d13 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -10,7 +10,7 @@ --- -## [Data]((spec.md#data)) +## [Data](spec.md#data) We introduce [DistData](spec.md#distdata) to represent inputs and outputs in privacy-preserving applications. diff --git a/docs/locale/zh_CN/LC_MESSAGES/README.mo b/docs/locale/zh_CN/LC_MESSAGES/README.mo deleted file mode 100644 index e2ea556..0000000 Binary files a/docs/locale/zh_CN/LC_MESSAGES/README.mo and /dev/null differ diff --git a/docs/locale/zh_CN/LC_MESSAGES/index.mo b/docs/locale/zh_CN/LC_MESSAGES/index.mo deleted file mode 100644 index ce2141e..0000000 Binary files a/docs/locale/zh_CN/LC_MESSAGES/index.mo and /dev/null differ diff --git a/docs/locale/zh_CN/LC_MESSAGES/intro.mo b/docs/locale/zh_CN/LC_MESSAGES/intro.mo deleted file mode 100644 index 7e94d64..0000000 Binary files a/docs/locale/zh_CN/LC_MESSAGES/intro.mo and /dev/null differ diff --git a/docs/locale/zh_CN/LC_MESSAGES/spec.mo b/docs/locale/zh_CN/LC_MESSAGES/spec.mo deleted file mode 100644 index 62d67d3..0000000 Binary files a/docs/locale/zh_CN/LC_MESSAGES/spec.mo and /dev/null differ diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 954237b..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/requirements.txt b/docs/requirements.txt index 11295d6..c4b12be 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,5 @@ -nbsphinx==0.8.9 -sphinx==5.3.0 -myst-parser==0.18.1 -sphinx-intl==2.1.0 -pydata-sphinx-theme - +linkify-it-py~=2.0 +myst-parser~=4.0 +secretflow-doctools~=0.8.5 +sphinx-intl~=2.3 +sphinx~=8.0 diff --git a/docs/update_po.sh b/docs/update_po.sh deleted file mode 100644 index 904f424..0000000 --- a/docs/update_po.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -mkdir -p _build/gettext && -make gettext && -sphinx-intl update -p _build/gettext -l zh_CN && -echo "po files has been updated. Please update po files in locales folder."