Skip to content

Commit c054b1f

Browse files
committed
Adjusted Sphinx configuration to handle 'en' and 'zh_CN' language versions
1 parent b3c9694 commit c054b1f

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

docs/en/conf.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
import sys, os
1616
import re
17-
from subprocess import call, Popen, PIPE
17+
from subprocess import Popen, PIPE
1818
import shlex
1919

2020
# If extensions (or modules to document with autodoc) are in another directory,
2121
# add these directories to sys.path here. If the directory is relative to the
2222
# documentation root, use os.path.abspath to make it absolute, like shown here.
23-
sys.path.insert(0, os.path.abspath('.'))
23+
sys.path.insert(0, os.path.abspath('..'))
2424

2525
from local_util import run_cmd_get_output, copy_if_modified
2626

@@ -30,17 +30,17 @@
3030

3131
# Call Doxygen to get XML files from the header files
3232
print "Calling Doxygen to generate latest XML files"
33-
call('doxygen')
33+
os.system("doxygen ../Doxyfile")
3434
# Doxygen has generated XML files in 'xml' directory.
3535
# Copy them to 'xml_in', only touching the files which have changed.
3636
copy_if_modified('xml/', 'xml_in/')
3737

3838
# Generate 'api_name.inc' files using the XML files by Doxygen
39-
os.system('python gen-dxd.py')
39+
os.system('python ../gen-dxd.py')
4040

4141
# Generate 'kconfig.inc' file from components' Kconfig files
4242
kconfig_inc_path = '{}/inc/kconfig.inc'.format(builddir)
43-
os.system('python gen-kconfig-doc.py > ' + kconfig_inc_path + '.in')
43+
os.system('python ../gen-kconfig-doc.py > ' + kconfig_inc_path + '.in')
4444
copy_if_modified(kconfig_inc_path + '.in', kconfig_inc_path)
4545

4646
# http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format
@@ -66,12 +66,12 @@
6666
]
6767

6868
# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
69-
blockdiag_fontpath = '_static/DejaVuSans.ttf'
70-
seqdiag_fontpath = '_static/DejaVuSans.ttf'
71-
actdiag_fontpath = '_static/DejaVuSans.ttf'
72-
nwdiag_fontpath = '_static/DejaVuSans.ttf'
73-
rackdiag_fontpath = '_static/DejaVuSans.ttf'
74-
packetdiag_fontpath = '_static/DejaVuSans.ttf'
69+
blockdiag_fontpath = '../_static/DejaVuSans.ttf'
70+
seqdiag_fontpath = '../_static/DejaVuSans.ttf'
71+
actdiag_fontpath = '../_static/DejaVuSans.ttf'
72+
nwdiag_fontpath = '../_static/DejaVuSans.ttf'
73+
rackdiag_fontpath = '../_static/DejaVuSans.ttf'
74+
packetdiag_fontpath = '../_static/DejaVuSans.ttf'
7575

7676
# Breathe extension variables
7777

@@ -120,7 +120,7 @@
120120

121121
# The language for content autogenerated by Sphinx. Refer to documentation
122122
# for a list of supported languages.
123-
#language = None
123+
language = 'en'
124124

125125
# There are two options for replacing |today|: either, you set today to some
126126
# non-false value, then it is used:
@@ -190,7 +190,7 @@
190190
# Add any paths that contain custom static files (such as style sheets) here,
191191
# relative to this directory. They are copied after the builtin static files,
192192
# so a file named "default.css" will overwrite the builtin "default.css".
193-
html_static_path = ['_static']
193+
#html_static_path = ['_static']
194194

195195
# Add any extra paths that contain custom files (such as robots.txt or
196196
# .htaccess) here, relative to this directory. These files are copied

docs/zh_CN/conf.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414

1515
import sys, os
1616
import re
17-
from subprocess import call, Popen, PIPE
17+
from subprocess import Popen, PIPE
1818
import shlex
1919

2020
# If extensions (or modules to document with autodoc) are in another directory,
2121
# add these directories to sys.path here. If the directory is relative to the
2222
# documentation root, use os.path.abspath to make it absolute, like shown here.
23-
sys.path.insert(0, os.path.abspath('.'))
23+
sys.path.insert(0, os.path.abspath('..'))
2424

2525
from repo_util import run_cmd_get_output
2626

2727
# Call Doxygen to get XML files from the header files
2828
print "Calling Doxygen to generate latest XML files"
29-
call('doxygen')
29+
os.system("doxygen ../Doxyfile")
3030
# Generate 'api_name.inc' files using the XML files by Doxygen
31-
os.system("python gen-dxd.py")
31+
os.system("python ../gen-dxd.py")
3232
# Generate 'kconfig.inc' file from components' Kconfig files
33-
os.system("python gen-kconfig-doc.py > _build/inc/kconfig.inc")
33+
os.system("python ../gen-kconfig-doc.py > _build/inc/kconfig.inc")
3434

3535
# http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format
3636
#
@@ -55,12 +55,12 @@
5555
]
5656

5757
# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
58-
blockdiag_fontpath = '_static/DejaVuSans.ttf'
59-
seqdiag_fontpath = '_static/DejaVuSans.ttf'
60-
actdiag_fontpath = '_static/DejaVuSans.ttf'
61-
nwdiag_fontpath = '_static/DejaVuSans.ttf'
62-
rackdiag_fontpath = '_static/DejaVuSans.ttf'
63-
packetdiag_fontpath = '_static/DejaVuSans.ttf'
58+
blockdiag_fontpath = '../_static/DejaVuSans.ttf'
59+
seqdiag_fontpath = '../_static/DejaVuSans.ttf'
60+
actdiag_fontpath = '../_static/DejaVuSans.ttf'
61+
nwdiag_fontpath = '../_static/DejaVuSans.ttf'
62+
rackdiag_fontpath = '../_static/DejaVuSans.ttf'
63+
packetdiag_fontpath = '../_static/DejaVuSans.ttf'
6464

6565
# Breathe extension variables
6666
breathe_projects = { "esp32-idf": "xml/" }
@@ -105,7 +105,7 @@
105105

106106
# The language for content autogenerated by Sphinx. Refer to documentation
107107
# for a list of supported languages.
108-
#language = None
108+
language = 'zh_CN'
109109

110110
# There are two options for replacing |today|: either, you set today to some
111111
# non-false value, then it is used:
@@ -175,7 +175,7 @@
175175
# Add any paths that contain custom static files (such as style sheets) here,
176176
# relative to this directory. They are copied after the builtin static files,
177177
# so a file named "default.css" will overwrite the builtin "default.css".
178-
html_static_path = ['_static']
178+
#html_static_path = ['_static']
179179

180180
# Add any extra paths that contain custom files (such as robots.txt or
181181
# .htaccess) here, relative to this directory. These files are copied

0 commit comments

Comments
 (0)