3
0

conf.py 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. # -*- coding: utf-8 -*-
  2. #
  3. # PaddleDetection documentation build configuration file, created by
  4. # sphinx-quickstart on Thu Jan 16 11:54:53 2020.
  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. # If extensions (or modules to document with autodoc) are in another directory,
  15. # add these directories to sys.path here. If the directory is relative to the
  16. # documentation root, use os.path.abspath to make it absolute, like shown here.
  17. #
  18. import os
  19. import sys
  20. sys.path.insert(0, os.path.abspath(".."))
  21. sys.path.insert(0, os.path.abspath("../../"))
  22. DEPLOY = os.environ.get("READTHEDOCS") == "True"
  23. # -- General configuration ------------------------------------------------
  24. # If your documentation needs a minimal Sphinx version, state it here.
  25. #
  26. # needs_sphinx = '1.0'
  27. # Add any Sphinx extension module names here, as strings. They can be
  28. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  29. # ones.
  30. #extensions = []
  31. extensions = [
  32. 'sphinx.ext.autodoc',
  33. 'sphinx.ext.napoleon',
  34. 'sphinx.ext.viewcode',
  35. 'recommonmark',
  36. 'sphinx_markdown_tables',
  37. # 'sphinx.ext.autosectionlabel',
  38. ]
  39. # autosectionlabel_prefix_document = True
  40. # Add any paths that contain templates here, relative to this directory.
  41. templates_path = ['_templates']
  42. # The suffix(es) of source filenames.
  43. # You can specify multiple suffix as a list of string:
  44. source_suffix = ['.rst', '.md']
  45. # The master toctree document.
  46. master_doc = 'index'
  47. # General information about the project.
  48. project = u'PaddleDetection'
  49. copyright = u'2020, paddlepaddle'
  50. author = u'paddlepaddle'
  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 short X.Y version.
  56. version = u'latest'
  57. # The full version, including alpha/beta/rc tags.
  58. release = u'0.1'
  59. # The language for content autogenerated by Sphinx. Refer to documentation
  60. # for a list of supported languages.
  61. #
  62. # This is also used if you do content translation via gettext catalogs.
  63. # Usually you set "language" from the command line for these cases.
  64. # language = None
  65. # List of patterns, relative to source directory, that match files and
  66. # directories to ignore when looking for source files.
  67. # This patterns also effect to html_static_path and html_extra_path
  68. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
  69. # The name of the Pygments (syntax highlighting) style to use.
  70. # pygments_style = 'sphinx'
  71. # If true, `todo` and `todoList` produce output, else they produce nothing.
  72. # todo_include_todos = False
  73. # -- Options for HTML output ----------------------------------------------
  74. # The theme to use for HTML and HTML Help pages. See the documentation for
  75. # a list of builtin themes.
  76. #
  77. html_theme = 'sphinx_rtd_theme'
  78. # html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
  79. # Theme options are theme-specific and customize the look and feel of a theme
  80. # further. For a list of options available for each theme, see the
  81. # documentation.
  82. #
  83. # html_theme_options = {}
  84. # Add any paths that contain custom static files (such as style sheets) here,
  85. # relative to this directory. They are copied after the builtin static files,
  86. # so a file named "default.css" will overwrite the builtin "default.css".
  87. html_static_path = ['_static']
  88. # -- Options for HTMLHelp output ------------------------------------------
  89. # Output file base name for HTML help builder.
  90. htmlhelp_basename = 'PaddleDetectiondoc'
  91. # -- Options for LaTeX output ---------------------------------------------
  92. latex_elements = {
  93. # The paper size ('letterpaper' or 'a4paper').
  94. #
  95. # 'papersize': 'letterpaper',
  96. # The font size ('10pt', '11pt' or '12pt').
  97. #
  98. # 'pointsize': '10pt',
  99. # Additional stuff for the LaTeX preamble.
  100. #
  101. # 'preamble': '',
  102. # Latex figure (float) alignment
  103. #
  104. # 'figure_align': 'htbp',
  105. }
  106. # Grouping the document tree into LaTeX files. List of tuples
  107. # (source start file, target name, title,
  108. # author, documentclass [howto, manual, or own class]).
  109. latex_documents = [
  110. (master_doc, 'PaddleDetection.tex', u'PaddleDetection Documentation',
  111. u'paddlepaddle', 'manual'),
  112. ]
  113. # -- Options for manual page output ---------------------------------------
  114. # One entry per manual page. List of tuples
  115. # (source start file, name, description, authors, manual section).
  116. man_pages = [(master_doc, 'paddledetection', u'PaddleDetection Documentation',
  117. [author], 1)]
  118. # -- Options for Texinfo output -------------------------------------------
  119. # Grouping the document tree into Texinfo files. List of tuples
  120. # (source start file, target name, title, author,
  121. # dir menu entry, description, category)
  122. texinfo_documents = [
  123. (master_doc, 'PaddleDetection', u'PaddleDetection Documentation', author,
  124. 'PaddleDetection', 'One line description of project.', 'Miscellaneous'),
  125. ]
  126. def url_resolver(url):
  127. if ".html" not in url:
  128. url = url.replace("../", "")
  129. return "https://github.com/PaddlePaddle/PaddleDetection/tree/develop/static" + url
  130. else:
  131. if DEPLOY:
  132. return "http://paddledetection.readthedocs.io/" + url
  133. else:
  134. return "/" + url
  135. #def setup(app):
  136. # app.add_config_value(
  137. # "recommonmark_config",
  138. # {
  139. # "url_resolver": url_resolver,
  140. # "auto_toc_tree_section": "Contents",
  141. # "enable_math": True,
  142. # "enable_inline_math": True,
  143. # "enable_eval_rst": True,
  144. # 'enable_auto_doc_ref': True,
  145. # },
  146. # True, )
  147. # app.add_transform(AutoStructify)