Unverified Commit 91bfefcc authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

Update doc Makefile (#4754)

parent 4feab0e3
# Minimal makefile for Sphinx documentation
#
.PHONY: all
all: en zh
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = build
.PHONY: en
en:
## English ##
sphinx-build -T source build/html
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: zh
zh:
## Chinese ##
sphinx-build -T -D language=zh source build/html_zh
# Build message catelogs for translation
.PHONY: i18n
i18n:
@$(SPHINXBUILD) -M getpartialtext "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
sphinx-intl update -p "$(BUILDDIR)/getpartialtext" -d "$(SOURCEDIR)/locales" -l zh
sphinx-build -b getpartialtext source build/i18n
sphinx-intl update -p build/i18n -d source/locales -l zh
.PHONY: help Makefile
# 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:
rm -rf build
rm -rf source/reference/_modules
......@@ -19,10 +19,6 @@ stages:
parameters:
platform: ubuntu-latest
- script: |
sudo apt-get install -y pandoc
displayName: Install pandoc
- script: |
cd docs
rstcheck -r source \
......@@ -33,30 +29,27 @@ stages:
- script: |
cd docs
make -e SPHINXOPTS="-W --keep-going -T -q" html
sphinx-build -W --keep-going -T -q source build/html
displayName: Sphinx sanity check
- script: |
set -e
cd docs
rm -rf build
sudo apt-get install -y gettext
python tools/translation_patch.py
make -e SPHINXOPTS="-W --keep-going -T -q -D language='zh'" html
sphinx-build -W --keep-going -T -q -D language=zh source build/html_zh
displayName: Sphinx sanity check (Chinese)
- script: |
set -e
cd docs
rm -rf build
make i18n
git diff --exit-code source/locales
displayName: Translation up-to-date
- script: |
cd docs
rm -rf build
make -e SPHINXOPTS="-W -T -b linkcheck -q --keep-going" html
sphinx-build -b linkcheck -W --keep-going -T -q source build/linkcheck
displayName: External links integrity check
- job: python
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment