Skip to content

Commit b3c9694

Browse files
committed
Moved files into separate folders per 'en' and 'zh_CN' language version and linked 'zh_CN' files back to 'en' files if translation is not yet available
0 parents  commit b3c9694

File tree

2 files changed

+655
-0
lines changed

2 files changed

+655
-0
lines changed

docs/en/conf.py

Lines changed: 335 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,335 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Read the Docs Template documentation build configuration file, created by
4+
# sphinx-quickstart on Tue Aug 26 14:19:49 2014.
5+
#
6+
# This file is execfile()d with the current directory set to its
7+
# containing dir.
8+
#
9+
# Note that not all possible configuration values are present in this
10+
# autogenerated file.
11+
#
12+
# All configuration values have a default; values that are commented out
13+
# serve to show the default.
14+
15+
import sys, os
16+
import re
17+
from subprocess import call, Popen, PIPE
18+
import shlex
19+
20+
# If extensions (or modules to document with autodoc) are in another directory,
21+
# add these directories to sys.path here. If the directory is relative to the
22+
# documentation root, use os.path.abspath to make it absolute, like shown here.
23+
sys.path.insert(0, os.path.abspath('.'))
24+
25+
from local_util import run_cmd_get_output, copy_if_modified
26+
27+
builddir = '_build'
28+
if 'BUILDDIR' in os.environ:
29+
builddir = os.environ['BUILDDIR']
30+
31+
# Call Doxygen to get XML files from the header files
32+
print "Calling Doxygen to generate latest XML files"
33+
call('doxygen')
34+
# Doxygen has generated XML files in 'xml' directory.
35+
# Copy them to 'xml_in', only touching the files which have changed.
36+
copy_if_modified('xml/', 'xml_in/')
37+
38+
# Generate 'api_name.inc' files using the XML files by Doxygen
39+
os.system('python gen-dxd.py')
40+
41+
# Generate 'kconfig.inc' file from components' Kconfig files
42+
kconfig_inc_path = '{}/inc/kconfig.inc'.format(builddir)
43+
os.system('python gen-kconfig-doc.py > ' + kconfig_inc_path + '.in')
44+
copy_if_modified(kconfig_inc_path + '.in', kconfig_inc_path)
45+
46+
# http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format
47+
#
48+
suppress_warnings = ['image.nonlocal_uri']
49+
50+
# -- General configuration ------------------------------------------------
51+
52+
# If your documentation needs a minimal Sphinx version, state it here.
53+
#needs_sphinx = '1.0'
54+
55+
# Add any Sphinx extension module names here, as strings. They can be
56+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
57+
# ones.
58+
extensions = ['breathe',
59+
'link-roles',
60+
'sphinxcontrib.blockdiag',
61+
'sphinxcontrib.seqdiag',
62+
'sphinxcontrib.actdiag',
63+
'sphinxcontrib.nwdiag',
64+
'sphinxcontrib.rackdiag',
65+
'sphinxcontrib.packetdiag'
66+
]
67+
68+
# 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'
75+
76+
# Breathe extension variables
77+
78+
# Doxygen regenerates files in 'xml/' directory every time,
79+
# but we copy files to 'xml_in/' only when they change, to speed up
80+
# incremental builds.
81+
breathe_projects = { "esp32-idf": "xml_in/" }
82+
breathe_default_project = "esp32-idf"
83+
84+
# Add any paths that contain templates here, relative to this directory.
85+
templates_path = ['_templates']
86+
87+
# The suffix of source filenames.
88+
source_suffix = ['.rst', '.md']
89+
90+
source_parsers = {
91+
'.md': 'recommonmark.parser.CommonMarkParser',
92+
}
93+
94+
# The encoding of source files.
95+
#source_encoding = 'utf-8-sig'
96+
97+
# The master toctree document.
98+
master_doc = 'index'
99+
100+
# General information about the project.
101+
project = u'ESP-IDF Programming Guide'
102+
copyright = u'2016 - 2017, Espressif'
103+
104+
# The version info for the project you're documenting, acts as replacement for
105+
# |version| and |release|, also used in various other places throughout the
106+
# built documents.
107+
#
108+
109+
# Readthedocs largely ignores 'version' and 'release', and displays one of
110+
# 'latest', tag name, or branch name, depending on the build type.
111+
# Still, this is useful for non-RTD builds.
112+
# This is supposed to be "the short X.Y version", but it's the only version
113+
# visible when you open index.html.
114+
# Display full version to make things less confusing.
115+
version = run_cmd_get_output('git describe')
116+
# The full version, including alpha/beta/rc tags.
117+
# If needed, nearest tag is returned by 'git describe --abbrev=0'.
118+
release = version
119+
print 'Version: {0} Release: {1}'.format(version, release)
120+
121+
# The language for content autogenerated by Sphinx. Refer to documentation
122+
# for a list of supported languages.
123+
#language = None
124+
125+
# There are two options for replacing |today|: either, you set today to some
126+
# non-false value, then it is used:
127+
#today = ''
128+
# Else, today_fmt is used as the format for a strftime call.
129+
#today_fmt = '%B %d, %Y'
130+
131+
# List of patterns, relative to source directory, that match files and
132+
# directories to ignore when looking for source files.
133+
exclude_patterns = ['_build','README.md']
134+
135+
# The reST default role (used for this markup: `text`) to use for all
136+
# documents.
137+
#default_role = None
138+
139+
# If true, '()' will be appended to :func: etc. cross-reference text.
140+
#add_function_parentheses = True
141+
142+
# If true, the current module name will be prepended to all description
143+
# unit titles (such as .. function::).
144+
#add_module_names = True
145+
146+
# If true, sectionauthor and moduleauthor directives will be shown in the
147+
# output. They are ignored by default.
148+
#show_authors = False
149+
150+
# The name of the Pygments (syntax highlighting) style to use.
151+
pygments_style = 'sphinx'
152+
153+
# A list of ignored prefixes for module index sorting.
154+
#modindex_common_prefix = []
155+
156+
# If true, keep warnings as "system message" paragraphs in the built documents.
157+
#keep_warnings = False
158+
159+
160+
# -- Options for HTML output ----------------------------------------------
161+
162+
# The theme to use for HTML and HTML Help pages. See the documentation for
163+
# a list of builtin themes.
164+
html_theme = 'default'
165+
166+
# Theme options are theme-specific and customize the look and feel of a theme
167+
# further. For a list of options available for each theme, see the
168+
# documentation.
169+
#html_theme_options = {}
170+
171+
# Add any paths that contain custom themes here, relative to this directory.
172+
#html_theme_path = []
173+
174+
# The name for this set of Sphinx documents. If None, it defaults to
175+
# "<project> v<release> documentation".
176+
#html_title = None
177+
178+
# A shorter title for the navigation bar. Default is the same as html_title.
179+
#html_short_title = None
180+
181+
# The name of an image file (relative to this directory) to place at the top
182+
# of the sidebar.
183+
#html_logo = None
184+
185+
# The name of an image file (within the static path) to use as favicon of the
186+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
187+
# pixels large.
188+
#html_favicon = None
189+
190+
# Add any paths that contain custom static files (such as style sheets) here,
191+
# relative to this directory. They are copied after the builtin static files,
192+
# so a file named "default.css" will overwrite the builtin "default.css".
193+
html_static_path = ['_static']
194+
195+
# Add any extra paths that contain custom files (such as robots.txt or
196+
# .htaccess) here, relative to this directory. These files are copied
197+
# directly to the root of the documentation.
198+
#html_extra_path = []
199+
200+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
201+
# using the given strftime format.
202+
#html_last_updated_fmt = '%b %d, %Y'
203+
204+
# If true, SmartyPants will be used to convert quotes and dashes to
205+
# typographically correct entities.
206+
#html_use_smartypants = True
207+
208+
# Custom sidebar templates, maps document names to template names.
209+
#html_sidebars = {}
210+
211+
# Additional templates that should be rendered to pages, maps page names to
212+
# template names.
213+
#html_additional_pages = {}
214+
215+
# If false, no module index is generated.
216+
#html_domain_indices = True
217+
218+
# If false, no index is generated.
219+
#html_use_index = True
220+
221+
# If true, the index is split into individual pages for each letter.
222+
#html_split_index = False
223+
224+
# If true, links to the reST sources are added to the pages.
225+
#html_show_sourcelink = True
226+
227+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
228+
#html_show_sphinx = True
229+
230+
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
231+
#html_show_copyright = True
232+
233+
# If true, an OpenSearch description file will be output, and all pages will
234+
# contain a <link> tag referring to it. The value of this option must be the
235+
# base URL from which the finished HTML is served.
236+
#html_use_opensearch = ''
237+
238+
# This is the file name suffix for HTML files (e.g. ".xhtml").
239+
#html_file_suffix = None
240+
241+
# Output file base name for HTML help builder.
242+
htmlhelp_basename = 'ReadtheDocsTemplatedoc'
243+
244+
245+
# -- Options for LaTeX output ---------------------------------------------
246+
247+
latex_elements = {
248+
# The paper size ('letterpaper' or 'a4paper').
249+
#'papersize': 'letterpaper',
250+
251+
# The font size ('10pt', '11pt' or '12pt').
252+
#'pointsize': '10pt',
253+
254+
# Additional stuff for the LaTeX preamble.
255+
#'preamble': '',
256+
}
257+
258+
# Grouping the document tree into LaTeX files. List of tuples
259+
# (source start file, target name, title,
260+
# author, documentclass [howto, manual, or own class]).
261+
latex_documents = [
262+
('index', 'ReadtheDocsTemplate.tex', u'Read the Docs Template Documentation',
263+
u'Read the Docs', 'manual'),
264+
]
265+
266+
# The name of an image file (relative to this directory) to place at the top of
267+
# the title page.
268+
#latex_logo = None
269+
270+
# For "manual" documents, if this is true, then toplevel headings are parts,
271+
# not chapters.
272+
#latex_use_parts = False
273+
274+
# If true, show page references after internal links.
275+
#latex_show_pagerefs = False
276+
277+
# If true, show URL addresses after external links.
278+
#latex_show_urls = False
279+
280+
# Documents to append as an appendix to all manuals.
281+
#latex_appendices = []
282+
283+
# If false, no module index is generated.
284+
#latex_domain_indices = True
285+
286+
287+
# -- Options for manual page output ---------------------------------------
288+
289+
# One entry per manual page. List of tuples
290+
# (source start file, name, description, authors, manual section).
291+
man_pages = [
292+
('index', 'readthedocstemplate', u'Read the Docs Template Documentation',
293+
[u'Read the Docs'], 1)
294+
]
295+
296+
# If true, show URL addresses after external links.
297+
#man_show_urls = False
298+
299+
300+
# -- Options for Texinfo output -------------------------------------------
301+
302+
# Grouping the document tree into Texinfo files. List of tuples
303+
# (source start file, target name, title, author,
304+
# dir menu entry, description, category)
305+
texinfo_documents = [
306+
('index', 'ReadtheDocsTemplate', u'Read the Docs Template Documentation',
307+
u'Read the Docs', 'ReadtheDocsTemplate', 'One line description of project.',
308+
'Miscellaneous'),
309+
]
310+
311+
# Documents to append as an appendix to all manuals.
312+
#texinfo_appendices = []
313+
314+
# If false, no module index is generated.
315+
#texinfo_domain_indices = True
316+
317+
# How to display URL addresses: 'footnote', 'no', or 'inline'.
318+
#texinfo_show_urls = 'footnote'
319+
320+
# If true, do not generate a @detailmenu in the "Top" node's menu.
321+
#texinfo_no_detailmenu = False
322+
323+
# -- Use sphinx_rtd_theme for local builds --------------------------------
324+
# ref. https://github.com/snide/sphinx_rtd_theme#using-this-theme-locally-then-building-on-read-the-docs
325+
#
326+
# on_rtd is whether we are on readthedocs.org
327+
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
328+
329+
if not on_rtd: # only import and set the theme if we're building docs locally
330+
import sphinx_rtd_theme
331+
html_theme = 'sphinx_rtd_theme'
332+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
333+
334+
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
335+

0 commit comments

Comments
 (0)