conf.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # -*- coding: utf-8 -*-
  2. import sys, os
  3. project = u'吉赫软件项目编码规范(C++)'
  4. copyright = u''
  5. version = u''
  6. release = u''
  7. source_suffix = '.rst'
  8. master_doc = 'contents'
  9. language = 'en_US'
  10. exclude_patterns = ['_build']
  11. extensions = ['sphinx.ext.imgmath']
  12. pygments_style = 'sphinx'
  13. # on_rtd is whether we are on readthedocs.org
  14. import os
  15. on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
  16. if not on_rtd: # only import and set the theme if we're building docs locally
  17. import sphinx_rtd_theme
  18. html_theme = 'sphinx_rtd_theme'
  19. html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
  20. # otherwise, readthedocs.org uses their theme by default, so no need to specify it
  21. html_title = u'吉赫软件项目编码规范(C++)'
  22. htmlhelp_basename = 'zh-google-styleguide'
  23. html_add_permalinks = ''
  24. latex_engine = 'xelatex'
  25. file_insertion_enabled = False
  26. on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
  27. if on_rtd:
  28. latex_elements = {
  29. # The paper size ('letterpaper' or 'a4paper').
  30. #'papersize': 'letterpaper',
  31. # The font size ('10pt', '11pt' or '12pt').
  32. #'pointsize': '10pt',
  33. # Additional stuff for the LaTeX preamble.
  34. 'preamble': r'''
  35. \hypersetup{unicode=true}
  36. \usepackage{CJKutf8}
  37. \DeclareUnicodeCharacter{00A0}{\nobreakspace}
  38. \DeclareUnicodeCharacter{2203}{\ensuremath{\exists}}
  39. \DeclareUnicodeCharacter{2200}{\ensuremath{\forall}}
  40. \DeclareUnicodeCharacter{2286}{\ensuremath{\subseteq}}
  41. \DeclareUnicodeCharacter{2713}{x}
  42. \DeclareUnicodeCharacter{27FA}{\ensuremath{\Longleftrightarrow}}
  43. \DeclareUnicodeCharacter{221A}{\ensuremath{\sqrt{}}}
  44. \DeclareUnicodeCharacter{221B}{\ensuremath{\sqrt[3]{}}}
  45. \DeclareUnicodeCharacter{2295}{\ensuremath{\oplus}}
  46. \DeclareUnicodeCharacter{2297}{\ensuremath{\otimes}}
  47. \begin{CJK}{UTF8}{gbsn}
  48. \AtEndDocument{\end{CJK}} ''',
  49. }
  50. else:
  51. latex_elements = {
  52. 'papersize' : 'a4paper',
  53. 'utf8extra' : '',
  54. 'inputenc' : '',
  55. 'babel' : r'''\usepackage[english]{babel}''',
  56. 'preamble' : r''' \usepackage{ctex} ''',
  57. }
  58. latex_documents = [
  59. ('contents', 'zh-google-styleguide.tex', u'吉赫软件项目编码规范(C++)',
  60. u'', 'manual'),
  61. ]
  62. #Add sponsorship and project information to the template context.
  63. context = {
  64. 'MEDIA_URL': "/media/",
  65. 'slug': 'google-styleguide',
  66. 'name': u'吉赫软件项目编码规范(C++)',
  67. 'analytics_code': 'None',
  68. }
  69. html_context = context