mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 04:04:31 +02:00
Adjusted Sphinx configuration to handle 'en' and 'zh_CN' language versions
This commit is contained in:
@@ -14,13 +14,13 @@
|
|||||||
|
|
||||||
import sys, os
|
import sys, os
|
||||||
import re
|
import re
|
||||||
from subprocess import call, Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
import shlex
|
import shlex
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
sys.path.insert(0, os.path.abspath('.'))
|
sys.path.insert(0, os.path.abspath('..'))
|
||||||
|
|
||||||
from local_util import run_cmd_get_output, copy_if_modified
|
from local_util import run_cmd_get_output, copy_if_modified
|
||||||
|
|
||||||
@@ -30,17 +30,17 @@ if 'BUILDDIR' in os.environ:
|
|||||||
|
|
||||||
# Call Doxygen to get XML files from the header files
|
# Call Doxygen to get XML files from the header files
|
||||||
print "Calling Doxygen to generate latest XML files"
|
print "Calling Doxygen to generate latest XML files"
|
||||||
call('doxygen')
|
os.system("doxygen ../Doxyfile")
|
||||||
# Doxygen has generated XML files in 'xml' directory.
|
# Doxygen has generated XML files in 'xml' directory.
|
||||||
# Copy them to 'xml_in', only touching the files which have changed.
|
# Copy them to 'xml_in', only touching the files which have changed.
|
||||||
copy_if_modified('xml/', 'xml_in/')
|
copy_if_modified('xml/', 'xml_in/')
|
||||||
|
|
||||||
# Generate 'api_name.inc' files using the XML files by Doxygen
|
# Generate 'api_name.inc' files using the XML files by Doxygen
|
||||||
os.system('python gen-dxd.py')
|
os.system('python ../gen-dxd.py')
|
||||||
|
|
||||||
# Generate 'kconfig.inc' file from components' Kconfig files
|
# Generate 'kconfig.inc' file from components' Kconfig files
|
||||||
kconfig_inc_path = '{}/inc/kconfig.inc'.format(builddir)
|
kconfig_inc_path = '{}/inc/kconfig.inc'.format(builddir)
|
||||||
os.system('python gen-kconfig-doc.py > ' + kconfig_inc_path + '.in')
|
os.system('python ../gen-kconfig-doc.py > ' + kconfig_inc_path + '.in')
|
||||||
copy_if_modified(kconfig_inc_path + '.in', kconfig_inc_path)
|
copy_if_modified(kconfig_inc_path + '.in', kconfig_inc_path)
|
||||||
|
|
||||||
# http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format
|
# http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format
|
||||||
@@ -66,12 +66,12 @@ extensions = ['breathe',
|
|||||||
]
|
]
|
||||||
|
|
||||||
# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
|
# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
|
||||||
blockdiag_fontpath = '_static/DejaVuSans.ttf'
|
blockdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
seqdiag_fontpath = '_static/DejaVuSans.ttf'
|
seqdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
actdiag_fontpath = '_static/DejaVuSans.ttf'
|
actdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
nwdiag_fontpath = '_static/DejaVuSans.ttf'
|
nwdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
rackdiag_fontpath = '_static/DejaVuSans.ttf'
|
rackdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
packetdiag_fontpath = '_static/DejaVuSans.ttf'
|
packetdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
|
|
||||||
# Breathe extension variables
|
# Breathe extension variables
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ print 'Version: {0} Release: {1}'.format(version, release)
|
|||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
#language = None
|
language = 'en'
|
||||||
|
|
||||||
# There are two options for replacing |today|: either, you set today to some
|
# There are two options for replacing |today|: either, you set today to some
|
||||||
# non-false value, then it is used:
|
# non-false value, then it is used:
|
||||||
@@ -190,7 +190,7 @@ html_theme = 'default'
|
|||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
#html_static_path = ['_static']
|
||||||
|
|
||||||
# Add any extra paths that contain custom files (such as robots.txt or
|
# Add any extra paths that contain custom files (such as robots.txt or
|
||||||
# .htaccess) here, relative to this directory. These files are copied
|
# .htaccess) here, relative to this directory. These files are copied
|
||||||
|
@@ -16,10 +16,10 @@ if 'BUILDDIR' in os.environ:
|
|||||||
builddir = os.environ['BUILDDIR']
|
builddir = os.environ['BUILDDIR']
|
||||||
|
|
||||||
# Script configuration
|
# Script configuration
|
||||||
header_file_path_prefix = "../components/"
|
header_file_path_prefix = "../../components/"
|
||||||
"""string: path prefix for header files.
|
"""string: path prefix for header files.
|
||||||
"""
|
"""
|
||||||
doxyfile_path = "Doxyfile"
|
doxyfile_path = "../Doxyfile"
|
||||||
"""string: path to a file containing header files to processs.
|
"""string: path to a file containing header files to processs.
|
||||||
"""
|
"""
|
||||||
xml_directory_path = "xml"
|
xml_directory_path = "xml"
|
||||||
|
@@ -106,7 +106,7 @@ def print_all_components():
|
|||||||
heading_level = INITIAL_HEADING_LEVEL
|
heading_level = INITIAL_HEADING_LEVEL
|
||||||
# Currently this works only for IDF components.
|
# Currently this works only for IDF components.
|
||||||
# TODO: figure out if this can be re-used for documenting applications?
|
# TODO: figure out if this can be re-used for documenting applications?
|
||||||
components_path = os.path.join(os.path.curdir, '..', 'components')
|
components_path = os.path.join(os.path.curdir, '../..', 'components')
|
||||||
for component_name in os.listdir(components_path):
|
for component_name in os.listdir(components_path):
|
||||||
if component_name.startswith('.'):
|
if component_name.startswith('.'):
|
||||||
continue # skip system thumbnail folders
|
continue # skip system thumbnail folders
|
||||||
|
@@ -14,23 +14,23 @@
|
|||||||
|
|
||||||
import sys, os
|
import sys, os
|
||||||
import re
|
import re
|
||||||
from subprocess import call, Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
import shlex
|
import shlex
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
sys.path.insert(0, os.path.abspath('.'))
|
sys.path.insert(0, os.path.abspath('..'))
|
||||||
|
|
||||||
from repo_util import run_cmd_get_output
|
from repo_util import run_cmd_get_output
|
||||||
|
|
||||||
# Call Doxygen to get XML files from the header files
|
# Call Doxygen to get XML files from the header files
|
||||||
print "Calling Doxygen to generate latest XML files"
|
print "Calling Doxygen to generate latest XML files"
|
||||||
call('doxygen')
|
os.system("doxygen ../Doxyfile")
|
||||||
# Generate 'api_name.inc' files using the XML files by Doxygen
|
# Generate 'api_name.inc' files using the XML files by Doxygen
|
||||||
os.system("python gen-dxd.py")
|
os.system("python ../gen-dxd.py")
|
||||||
# Generate 'kconfig.inc' file from components' Kconfig files
|
# Generate 'kconfig.inc' file from components' Kconfig files
|
||||||
os.system("python gen-kconfig-doc.py > _build/inc/kconfig.inc")
|
os.system("python ../gen-kconfig-doc.py > _build/inc/kconfig.inc")
|
||||||
|
|
||||||
# http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format
|
# http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format
|
||||||
#
|
#
|
||||||
@@ -55,12 +55,12 @@ extensions = ['breathe',
|
|||||||
]
|
]
|
||||||
|
|
||||||
# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
|
# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
|
||||||
blockdiag_fontpath = '_static/DejaVuSans.ttf'
|
blockdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
seqdiag_fontpath = '_static/DejaVuSans.ttf'
|
seqdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
actdiag_fontpath = '_static/DejaVuSans.ttf'
|
actdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
nwdiag_fontpath = '_static/DejaVuSans.ttf'
|
nwdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
rackdiag_fontpath = '_static/DejaVuSans.ttf'
|
rackdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
packetdiag_fontpath = '_static/DejaVuSans.ttf'
|
packetdiag_fontpath = '../_static/DejaVuSans.ttf'
|
||||||
|
|
||||||
# Breathe extension variables
|
# Breathe extension variables
|
||||||
breathe_projects = { "esp32-idf": "xml/" }
|
breathe_projects = { "esp32-idf": "xml/" }
|
||||||
@@ -105,7 +105,7 @@ print 'Version: {0} Release: {1}'.format(version, release)
|
|||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
#language = None
|
language = 'zh_CN'
|
||||||
|
|
||||||
# There are two options for replacing |today|: either, you set today to some
|
# There are two options for replacing |today|: either, you set today to some
|
||||||
# non-false value, then it is used:
|
# non-false value, then it is used:
|
||||||
@@ -175,7 +175,7 @@ html_theme = 'default'
|
|||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
#html_static_path = ['_static']
|
||||||
|
|
||||||
# Add any extra paths that contain custom files (such as robots.txt or
|
# Add any extra paths that contain custom files (such as robots.txt or
|
||||||
# .htaccess) here, relative to this directory. These files are copied
|
# .htaccess) here, relative to this directory. These files are copied
|
||||||
|
Reference in New Issue
Block a user