conf.py 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Configuration file for the Sphinx documentation builder.
  2. #
  3. # This file only contains a selection of the most common options. For a full
  4. # list see the documentation:
  5. # https://www.sphinx-doc.org/en/master/usage/configuration.html
  6. # -- Path setup --------------------------------------------------------------
  7. # Ensure we get the local copy of tornado instead of what's on the standard path
  8. import os
  9. import sys
  10. sys.path.insert(0, os.path.abspath(".."))
  11. import pywebio
  12. version = release = pywebio.__version__
  13. # -- Project information -----------------------------------------------------
  14. project = 'PyWebIO'
  15. copyright = '2020, WangWeimin'
  16. author = 'WangWeimin'
  17. # -- General configuration ---------------------------------------------------
  18. # Add any Sphinx extension module names here, as strings. They can be
  19. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  20. # ones.
  21. extensions = [
  22. 'sphinx.ext.autodoc',
  23. # "sphinx.ext.intersphinx",
  24. "sphinx.ext.viewcode",
  25. 'sphinx_tabs.tabs',
  26. 'sphinx.ext.extlinks'
  27. ]
  28. primary_domain = "py"
  29. default_role = "py:obj"
  30. # intersphinx_mapping = {"python": ("https://docs.python.org/3.6/", None)}
  31. master_doc = 'index'
  32. # The language for content autogenerated by Sphinx. Refer to documentation
  33. # for a list of supported languages.
  34. #
  35. # This is also used if you do content translation via gettext catalogs.
  36. # Usually you set "language" from the command line for these cases.
  37. language = 'zh_CN'
  38. # List of patterns, relative to source directory, that match files and
  39. # directories to ignore when looking for source files.
  40. # This pattern also affects html_static_path and html_extra_path.
  41. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
  42. # -- Options for HTML output -------------------------------------------------
  43. # The theme to use for HTML and HTML Help pages. See the documentation for
  44. # a list of builtin themes.
  45. #
  46. html_theme = "sphinx_rtd_theme"
  47. # Add any paths that contain custom static files (such as style sheets) here,
  48. # relative to this directory. They are copied after the builtin static files,
  49. # so a file named "default.css" will overwrite the builtin "default.css".
  50. html_static_path = ['static']
  51. def setup(app):
  52. """Configure Sphinx"""
  53. app.add_stylesheet('pywebio.css')
  54. # -- Extension configuration -------------------------------------------------
  55. from sphinx.builders.html import StandaloneHTMLBuilder
  56. StandaloneHTMLBuilder.supported_image_types = [
  57. 'image/svg+xml',
  58. 'image/gif',
  59. 'image/png',
  60. 'image/jpeg'
  61. ]