conf.py 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. # -*- coding: utf-8 -*-
  2. #
  3. # This file is execfile()d with the current directory set to its
  4. # containing dir.
  5. #
  6. # Note that not all possible configuration values are present in this
  7. # autogenerated file.
  8. #
  9. # All configuration values have a default; values that are commented out
  10. # serve to show the default.
  11. # If extensions (or modules to document with autodoc) are in another
  12. # directory, add these directories to sys.path here. If the directory
  13. # is relative to the documentation root, use os.path.abspath to make
  14. # it absolute, like shown here.
  15. # sys.path.insert(0, os.path.abspath('.'))
  16. import os
  17. import sys
  18. import datetime
  19. # -- General configuration ------------------------------------------------
  20. needs_sphinx = '1.7'
  21. # Add any Sphinx extension module names here, as strings. They can be
  22. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  23. # ones.
  24. sys.path.insert(0, os.path.abspath('sphinx'))
  25. extensions = [
  26. 'cdoc'
  27. , 'ir'
  28. ]
  29. # support .md with python2 & python3
  30. if sys.version_info[0] > 2:
  31. from recommonmark.parser import CommonMarkParser
  32. source_parsers = {
  33. '.md': CommonMarkParser,
  34. }
  35. else:
  36. source_parsers = {
  37. '.md': 'recommonmark.parser.CommonMarkParser',
  38. }
  39. # Add any paths that contain templates here, relative to this directory.
  40. templates_path = ['templates']
  41. # The suffix(es) of source filenames.
  42. # You can specify multiple suffix as a list of string:
  43. #
  44. source_suffix = ['.rst', '.md']
  45. # The master toctree document.
  46. master_doc = 'index'
  47. # General information about the project.
  48. project = 'sparse'
  49. copyright = '2003 - ' + str(datetime.datetime.now().year)
  50. author = "sparse's development community"
  51. # The version info for the project you're documenting, acts as replacement for
  52. # |version| and |release|, also used in various other places throughout the
  53. # built documents.
  54. #
  55. # The full version, including alpha/beta/rc tags.
  56. release = next(open('../Makefile', 'r')).split('=')[1].rstrip()
  57. # The short X.Y version.
  58. version = release.split('-')[0]
  59. # it's a C project, so:
  60. primary_domain = 'c'
  61. # disable syntax highlight in non-code sections
  62. highlight_language = 'none'
  63. # The language for content autogenerated by Sphinx. Refer to documentation
  64. # for a list of supported languages.
  65. #
  66. # This is also used if you do content translation via gettext catalogs.
  67. # Usually you set "language" from the command line for these cases.
  68. language = None
  69. # List of patterns, relative to source directory, that match files and
  70. # directories to ignore when looking for source files.
  71. # This patterns also effect to html_static_path and html_extra_path
  72. exclude_patterns = ['build']
  73. # The name of the Pygments (syntax highlighting) style to use.
  74. pygments_style = 'sphinx'
  75. # If true, `todo` and `todoList` produce output, else they produce nothing.
  76. todo_include_todos = True
  77. # -- Options for cdoc extension -------------------------------------------
  78. cdoc_srcdir = '..'
  79. # -- Options for HTML output ----------------------------------------------
  80. # The theme to use for HTML and HTML Help pages. See the documentation for
  81. # a list of builtin themes.
  82. #
  83. try:
  84. html_theme = 'sphinx_rtd_theme'
  85. import sphinx_rtd_theme
  86. html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
  87. except:
  88. sys.stderr.write("Warning: theme '%s' not found\n" % html_theme)
  89. html_theme = 'classic'
  90. # html_theme_options = {}
  91. # Add any paths that contain custom static files (such as style sheets) here,
  92. # relative to this directory. They are copied after the builtin static files,
  93. # so a file named "default.css" will overwrite the builtin "default.css".
  94. html_static_path = ['sphinx/static']
  95. html_context = {
  96. 'css_files': [
  97. '_static/theme_overrides.css',
  98. ],
  99. }
  100. # Custom sidebar templates, must be a dictionary that maps document names
  101. # to template names.
  102. #
  103. # This is required for the alabaster theme
  104. # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
  105. html_sidebars = { }
  106. html_logo = 'logo.svg'
  107. # -- Options for HTMLHelp output ------------------------------------------
  108. # Output file base name for HTML help builder.
  109. htmlhelp_basename = 'sparsedoc'
  110. # -- Options for LaTeX output ---------------------------------------------
  111. latex_elements = {
  112. # The paper size ('letterpaper' or 'a4paper').
  113. #
  114. 'papersize': 'a4paper',
  115. # The font size ('10pt', '11pt' or '12pt').
  116. #
  117. # 'pointsize': '10pt',
  118. # Additional stuff for the LaTeX preamble.
  119. #
  120. # 'preamble': '',
  121. # Latex figure (float) alignment
  122. #
  123. # 'figure_align': 'htbp',
  124. }
  125. # Grouping the document tree into LaTeX files. List of tuples
  126. # (source start file, target name, title,
  127. # author, documentclass [howto, manual, or own class]).
  128. latex_documents = [
  129. ('index', 'sparse.tex', u'sparse Documentation', author, 'manual'),
  130. ]
  131. # -- Options for manual page output ---------------------------------------
  132. # One entry per manual page. List of tuples
  133. # (source start file, name, description, authors, manual section).
  134. man_pages = [
  135. ('dev-options', 'dev-options', u'options for development', [author], 1),
  136. ]
  137. # -- Options for Texinfo output -------------------------------------------
  138. # Grouping the document tree into Texinfo files. List of tuples
  139. # (source start file, target name, title, author,
  140. # dir menu entry, description, category)
  141. texinfo_documents = [
  142. ('index', 'sparse', u'sparse Documentation', author, 'sparse', 'C semantic parser & checker', 'Software development'),
  143. ]
  144. # vim: tabstop=4