]> granicus.if.org Git - esp-idf/commitdiff
Adjusted Sphinx configuration to handle 'en' and 'zh_CN' language versions
authorkrzychb <krzychb@gazeta.pl>
Sat, 3 Feb 2018 21:12:13 +0000 (22:12 +0100)
committerkrzychb <krzychb@gazeta.pl>
Tue, 13 Mar 2018 21:07:31 +0000 (22:07 +0100)
docs/en/conf.py
docs/gen-dxd.py
docs/gen-kconfig-doc.py
docs/zh_CN/conf.py

index a2cafdbf0a482c72e8e11624f6c4f45a5fa6419d..7031188b930df42936e2c34e22c93c9b9eb3bad2 100644 (file)
 
 import sys, os
 import re
-from subprocess import call, Popen, PIPE
+from subprocess import Popen, PIPE
 import shlex
 
 # 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
 # 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
 
@@ -30,17 +30,17 @@ if 'BUILDDIR' in os.environ:
 
 # Call Doxygen to get XML files from the header files
 print "Calling Doxygen to generate latest XML files"
-call('doxygen')
+os.system("doxygen ../Doxyfile")
 # Doxygen has generated XML files in 'xml' directory.
 # Copy them to 'xml_in', only touching the files which have changed.
 copy_if_modified('xml/', 'xml_in/')
 
 # 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
 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)
 
 # 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
-blockdiag_fontpath = '_static/DejaVuSans.ttf'
-seqdiag_fontpath = '_static/DejaVuSans.ttf'
-actdiag_fontpath = '_static/DejaVuSans.ttf'
-nwdiag_fontpath = '_static/DejaVuSans.ttf'
-rackdiag_fontpath = '_static/DejaVuSans.ttf'
-packetdiag_fontpath = '_static/DejaVuSans.ttf'
+blockdiag_fontpath = '../_static/DejaVuSans.ttf'
+seqdiag_fontpath = '../_static/DejaVuSans.ttf'
+actdiag_fontpath = '../_static/DejaVuSans.ttf'
+nwdiag_fontpath = '../_static/DejaVuSans.ttf'
+rackdiag_fontpath = '../_static/DejaVuSans.ttf'
+packetdiag_fontpath = '../_static/DejaVuSans.ttf'
 
 # 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
 # for a list of supported languages.
-#language = None
+language = 'en'
 
 # There are two options for replacing |today|: either, you set today to some
 # 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,
 # relative to this directory. They are copied after the builtin static files,
 # 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
 # .htaccess) here, relative to this directory. These files are copied
index 4ebf06b43d43cec0838c54a83b0062837dfd3b99..0737d94f6df1724d96bdd602488f0ce001940a89 100644 (file)
@@ -16,10 +16,10 @@ if 'BUILDDIR' in os.environ:
     builddir = os.environ['BUILDDIR']
 
 # Script configuration
-header_file_path_prefix = "../components/"
+header_file_path_prefix = "../../components/"
 """string: path prefix for header files.
 """
-doxyfile_path = "Doxyfile"
+doxyfile_path = "../Doxyfile"
 """string: path to a file containing header files to processs.
 """
 xml_directory_path = "xml"
index 0c35dc60b13b24f453e98c0be840062d2a7680da..a141641199dc04f68b2d51351407efa4d27b7e85 100755 (executable)
@@ -106,7 +106,7 @@ def print_all_components():
     heading_level = INITIAL_HEADING_LEVEL
     # Currently this works only for IDF components.
     # 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):
         if component_name.startswith('.'):
             continue    # skip system thumbnail folders
index aee4803d432a50f49a00c3064d34cd33564fd949..bb24f6caa4577b5e54e5b25496e5b88b54b1e043 100644 (file)
 
 import sys, os
 import re
-from subprocess import call, Popen, PIPE
+from subprocess import Popen, PIPE
 import shlex
 
 # 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
 # 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
 
 # Call Doxygen to get XML files from the header 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
-os.system("python gen-dxd.py")
+os.system("python ../gen-dxd.py")
 # 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
 # 
@@ -55,12 +55,12 @@ extensions = ['breathe',
              ]
 
 # Set up font for blockdiag, nwdiag, rackdiag and packetdiag
-blockdiag_fontpath = '_static/DejaVuSans.ttf'
-seqdiag_fontpath = '_static/DejaVuSans.ttf'
-actdiag_fontpath = '_static/DejaVuSans.ttf'
-nwdiag_fontpath = '_static/DejaVuSans.ttf'
-rackdiag_fontpath = '_static/DejaVuSans.ttf'
-packetdiag_fontpath = '_static/DejaVuSans.ttf'
+blockdiag_fontpath = '../_static/DejaVuSans.ttf'
+seqdiag_fontpath = '../_static/DejaVuSans.ttf'
+actdiag_fontpath = '../_static/DejaVuSans.ttf'
+nwdiag_fontpath = '../_static/DejaVuSans.ttf'
+rackdiag_fontpath = '../_static/DejaVuSans.ttf'
+packetdiag_fontpath = '../_static/DejaVuSans.ttf'
 
 # Breathe extension variables
 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
 # for a list of supported languages.
-#language = None
+language = 'zh_CN'
 
 # There are two options for replacing |today|: either, you set today to some
 # 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,
 # relative to this directory. They are copied after the builtin static files,
 # 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
 # .htaccess) here, relative to this directory. These files are copied