conf.py 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. #
  4. # EasyDevelopmentKitGuide documentation build configuration file, created by
  5. # sphinx-quickstart on Wed Jun 5 12:46:41 2019.
  6. #
  7. # This file is execfile()d with the current directory set to its
  8. # containing dir.
  9. #
  10. # Note that not all possible configuration values are present in this
  11. # autogenerated file.
  12. #
  13. # All configuration values have a default; values that are commented out
  14. # serve to show the default.
  15. # If extensions (or modules to document with autodoc) are in another directory,
  16. # add these directories to sys.path here. If the directory is relative to the
  17. # documentation root, use os.path.abspath to make it absolute, like shown here.
  18. #
  19. # import os
  20. # import sys
  21. # sys.path.insert(0, os.path.abspath('.'))
  22. # -- General configuration ------------------------------------------------
  23. # If your documentation needs a minimal Sphinx version, state it here.
  24. #
  25. # needs_sphinx = '1.0'
  26. # Add any Sphinx extension module names here, as strings. They can be
  27. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  28. # ones.
  29. import sphinx_rtd_theme
  30. extensions = [
  31. 'breathe',
  32. 'exhale'
  33. ]
  34. breathe_projects = {
  35. "EasyDK": "./doxyoutput/xml"
  36. }
  37. breathe_default_project = "EasyDK"
  38. exhale_args = {
  39. "containmentFolder": "./interface",
  40. "rootFileName": "Interface_root.rst",
  41. "rootFileTitle": "Interface",
  42. "doxygenStripFromPath": "../../",
  43. "fullApiSubSectionTitle": "API Reference",
  44. "createTreeView": False,
  45. "exhaleExecutesDoxygen": True,
  46. "fullToctreeMaxDepth": 3,
  47. "unabridgedOrphanKinds": {"dir", "file", "union", "define"},
  48. "exhaleDoxygenStdin": """
  49. INPUT = ../../include
  50. INCLUDE_PATH = ../../include
  51. EXCLUDE = ../../include/easyplugin ../../include/internal
  52. EXTRACT_ALL = NO
  53. HIDE_FRIEND_COMPOUNDS = YES
  54. HIDE_UNDOC_MEMBERS = YES
  55. CLANG_ASSISTED_PARSING = YES
  56. CLANG_OPTIONS = -std=c++11
  57. SHOW_NAMESPACES = NO
  58. GENERATE_TREEVIEW = YES
  59. GRAPHICAL_HIERARCHY = YES
  60. INLINE_SIMPLE_STRUCTS = YES
  61. """
  62. }
  63. primary_domain = 'cpp'
  64. highlight_language = 'cpp'
  65. # Add any paths that contain templates here, relative to this directory.
  66. #templates_path = ['_templates']
  67. # The suffix(es) of source filenames.
  68. # You can specify multiple suffix as a list of string:
  69. #
  70. # source_suffix = ['.rst', '.md']
  71. source_suffix = '.rst'
  72. # The master toctree document.
  73. master_doc = 'Index'
  74. # General information about the project.
  75. project = u'EasyDK'
  76. copyright = u'2020, Cambricon'
  77. author = u'Cambricon'
  78. # The version info for the project you're documenting, acts as replacement for
  79. # |version| and |release|, also used in various other places throughout the
  80. # built documents.
  81. #
  82. # The short X.Y version.
  83. version = u'2.5'
  84. # The full version, including alpha/beta/rc tags.
  85. release = u'2.5.0'
  86. # The language for content autogenerated by Sphinx. Refer to documentation
  87. # for a list of supported languages.
  88. #
  89. # This is also used if you do content translation via gettext catalogs.
  90. # Usually you set "language" from the command line for these cases.
  91. language = 'en_US'
  92. # List of patterns, relative to source directory, that match files and
  93. # directories to ignore when looking for source files.
  94. # This patterns also effect to html_static_path and html_extra_path
  95. exclude_patterns = []
  96. # The name of the Pygments (syntax highlighting) style to use.
  97. pygments_style = 'sphinx'
  98. # If true, `todo` and `todoList` produce output, else they produce nothing.
  99. todo_include_todos = False
  100. # -- Options for HTML output ----------------------------------------------
  101. # The theme to use for HTML and HTML Help pages. See the documentation for
  102. # a list of builtin themes.
  103. #
  104. html_theme = 'sphinx_rtd_theme'
  105. # Theme options are theme-specific and customize the look and feel of a theme
  106. # further. For a list of options available for each theme, see the
  107. # documentation.
  108. #
  109. # html_theme_options = {}
  110. # Add any paths that contain custom static files (such as style sheets) here,
  111. # relative to this directory. They are copied after the builtin static files,
  112. # so a file named "default.css" will overwrite the builtin "default.css".
  113. #html_static_path = ['_static']
  114. # Custom sidebar templates, must be a dictionary that maps document names
  115. # to template names.
  116. #
  117. # This is required for the alabaster theme
  118. # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
  119. html_sidebars = {
  120. '**': [
  121. 'relations.html', # needs 'show_related': True theme option to display
  122. 'searchbox.html',
  123. ]
  124. }
  125. # -- Options for HTMLHelp output ------------------------------------------
  126. # Output file base name for HTML help builder.
  127. htmlhelp_basename = 'EasyDK Developer Guide'
  128. # -- Options for LaTeX output ---------------------------------------------
  129. # Grouping the document tree into LaTeX files. List of tuples
  130. # (source start file, target name, title,
  131. # author, documentclass [howto, manual, or own class]).
  132. latex_documents = [
  133. (master_doc, 'EasyDK.tex', 'EasyDK Developer Guide',
  134. 'Cambricon', 'manual'),
  135. ]
  136. # -- Options for manual page output ---------------------------------------
  137. # One entry per manual page. List of tuples
  138. # (source start file, name, description, authors, manual section).
  139. man_pages = [
  140. (master_doc, 'EasyDevelopmentKit', 'EasyDevelopmentKit Developer Guide',
  141. [author], 1)
  142. ]
  143. # -- Options for Texinfo output -------------------------------------------
  144. # Grouping the document tree into Texinfo files. List of tuples
  145. # (source start file, target name, title, author,
  146. # dir menu entry, description, category)
  147. texinfo_documents = [
  148. (master_doc, 'EasyDevelopmentKit', 'EasyDevelopmentKit Developer Guide',
  149. author, 'EasyDevelopmentKit', 'One line description of project.',
  150. 'Miscellaneous'),
  151. ]
  152. # xelatex 作为 latex 渲染引擎,因为可能有中文渲染
  153. latex_engine = 'xelatex'
  154. # 如果没有使用自定义封面,可以加上封面 logo。这里可以是 pdf 或者 png,jpeg 等
  155. latex_logo = "./images/logo.png"
  156. latex_show_urls = 'footnote'
  157. # 主要的配置,用于控制格式等
  158. latex_elements = {
  159. # The paper size ('letterpaper' or 'a4paper').
  160. #
  161. 'papersize': 'a4paper',
  162. # The font size ('10pt', '11pt' or '12pt').
  163. #
  164. # 'pointsize': '8pt',
  165. 'inputenc': '',
  166. 'utf8extra': '',
  167. # Additional stuff for the LaTeX preamble.
  168. 'preamble': '''
  169. \\addto\\captionsenglish{\\renewcommand{\\chaptername}{}}
  170. % 设置字体
  171. \\usepackage{xeCJK}
  172. \\usepackage{fontspec}
  173. \\setCJKmainfont{Noto Sans CJK SC}
  174. \\setCJKmonofont{Noto Sans CJK SC}
  175. \\setmainfont{Noto Sans CJK SC}
  176. % 段首缩进 2 格
  177. \\usepackage{indentfirst}
  178. \\setlength{\\parindent}{2em}
  179. \\usepackage{setspace}
  180. % 1.5 倍行间距
  181. \\renewcommand{\\baselinestretch}{1.5}
  182. % 表格里的行间距
  183. \\renewcommand{\\arraystretch}{1.5}
  184. % list 列表的缩进对齐
  185. \\usepackage{enumitem}
  186. \\setlist{nosep}
  187. % 表格类的宏包
  188. \\usepackage{threeparttable}
  189. \\usepackage{array}
  190. \\usepackage{booktabs}
  191. % fancy 页眉页脚
  192. \\usepackage{fancyhdr}
  193. \\pagestyle{fancy}
  194. % 在 sphinx 生成的 tex 文件里,normal 是指普通页面(每一个章节里,除了第一页外剩下的页面)
  195. % 页眉,L:left,R:right,E:even,O:odd
  196. % 奇数页面:左边是 leftmark,章号和章名称;右边是 rightmark,节号与节名称
  197. % 偶数页面:左边是 rightmark,节号与节名称;右边是 leftmark,章号和章名称
  198. % textsl 是字体,slanted shape,对于英语而言,某种斜体。但是不同于 textit 的 italic shape
  199. % 左页脚:版权信息
  200. % 右页脚:页码数
  201. % rulewidth:页眉和页脚附近的横线的粗细,当设置为 0pt 时,就没有该横线
  202. %
  203. \\fancypagestyle{normal} {
  204. \\fancyhf{}
  205. \\fancyhead{}
  206. \\fancyhead[LE,RO]{\\textsl{\\rightmark}}
  207. \\fancyhead[LO,RE]{\\textsl{\\leftmark}}
  208. \\lfoot{Copyright © 2019 Cambricon Corporation.}
  209. \\rfoot{\\thepage}
  210. \\renewcommand{\\headrulewidth}{0.4pt}
  211. \\renewcommand{\\footrulewidth}{0.4pt}
  212. }
  213. % 在 sphinx 生成的 tex 文件里,plain 是指每个章节的第一页等
  214. \\fancypagestyle{plain} {
  215. \\fancyhf{}
  216. % left head 还可以内嵌图片,图片可以是 pdf,png,jpeg 等
  217. % \\lhead{\\includegraphics[height=40pt]{cn_tm.pdf}}
  218. \\lhead{\\large\\textcolor[rgb]{0.1804,0.4588,0.7137}{Cambricon™}}
  219. \\lfoot{Copyright © 2019 Cambricon Corporation.}
  220. \\rfoot{\\thepage}
  221. \\renewcommand{\\headrulewidth}{0.4pt}
  222. \\renewcommand{\\footrulewidth}{0.4pt}
  223. }
  224. ''',
  225. #
  226. 'printindex': r'\footnotesize\raggedright\printindex',
  227. # 移除空白页面
  228. 'extraclassoptions': 'openany,oneside',
  229. # 如果需要用 latex 自已做封面,可以使用 maketitle
  230. # 下面这个封面的例子来自于互联网
  231. # 'maketitle': r'''
  232. # \pagenumbering{Roman} %%% to avoid page 1 conflict with actual page 1
  233. #
  234. # \begin{titlepage}
  235. # \centering
  236. #
  237. # \vspace*{40mm} %%% * is used to give space from top
  238. # \textbf{\Huge {Sphinx format for Latex and HTML}}
  239. #
  240. # \vspace{0mm}
  241. # \begin{figure}[!h]
  242. # \centering
  243. # \includegraphics[width=0.8\textwidth]{cn.png}
  244. # \end{figure}
  245. #
  246. # % \vspace{0mm}
  247. # % \Large \textbf{{Meher Krishna Patel}}
  248. #
  249. # % \small Created on : Octorber, 2017
  250. #
  251. # % \vspace*{0mm}
  252. # % \small Last updated : \MonthYearFormat\today
  253. #
  254. #
  255. # %% \vfill adds at the bottom
  256. # % \vfill
  257. # % \small \textit{More documents are freely available at }{\href{http://pythondsp.readthedocs.io/en/latest/pythondsp/toc.html}{PythonDSP}}
  258. # \end{titlepage}
  259. #
  260. # \clearpage
  261. # \pagenumbering{roman}
  262. # \tableofcontents
  263. # \listoffigures
  264. # \listoftables
  265. # \clearpage
  266. # \pagenumbering{arabic}
  267. #
  268. # ''',
  269. #
  270. } # latex_elements