[Docs] Fix cannot show changelog.md in chinese documents. (#606)

* [Fix] Fix error path of changelog.md in docs/zh_cn/index.rsts

* Fix stupid commit

* run bash script during build docs

* run bash script during build docs

* run bash script during build docs

* translate notes to 说明

* update auth
This commit is contained in:
Mashiro 2022-10-14 16:56:34 +08:00 committed by GitHub
parent bc37c838d4
commit 910778a94e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

View File

@ -11,6 +11,7 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import subprocess
import sys
import pytorch_sphinx_theme
@ -102,3 +103,11 @@ html_css_files = ['css/readthedocs.css']
# Ignore >>> when copying code
copybutton_prompt_text = r'>>> |\.\.\. '
copybutton_prompt_is_regexp = True
def builder_inited_handler(app):
subprocess.run(['./cp_origin_docs.sh'])
def setup(app):
app.connect('builder-inited', builder_inited_handler)

9
docs/zh_cn/cp_origin_docs.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Copy *.md files from docs/ if it doesn't have a Chinese translation
for filename in $(find ../en/ -name '*.md' -printf "%P\n");
do
mkdir -p $(dirname $filename)
cp -n ../en/$filename ./$filename
done

View File

@ -91,7 +91,7 @@
.. toctree::
:maxdepth: 2
:caption: Notes
:caption: 说明
notes/changelog.md