conf.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import os
  2. import sys
  3. import sccd
  4. sys.path.insert(0, os.path.abspath(".."))
  5. html_favicon = "static/images/docs_logo.svg"
  6. supported_languages = {
  7. "en": "SCCD (%s) documentation in English",
  8. }
  9. extensions = [
  10. "notfound.extension",
  11. "recommonmark",
  12. "sphinx.ext.autodoc",
  13. "sphinx.ext.viewcode",
  14. "sphinx_rtd_theme",
  15. "sphinx_search.extension",
  16. "sphinx_tabs.tabs",
  17. "sphinxext.opengraph",
  18. # "sphinx.ext.autosectionlabel",
  19. ]
  20. # autosectionlabel_prefix_document = True
  21. sphinx_tabs_nowarn = True
  22. templates_path = ["templates"]
  23. source_suffix = {
  24. ".rst": "restructuredtext",
  25. ".txt": "markdown",
  26. ".md": "markdown",
  27. }
  28. source_encoding = "utf-8-sig"
  29. master_doc = "index"
  30. project = "sccd"
  31. copyright = "2021, Arkadiusz Michał Ryś"
  32. author = "Arkadiusz Michał Ryś"
  33. version = sccd.__version__
  34. release = sccd.__version__
  35. ogp_site_name = "SCCD documentation"
  36. env_tags = os.getenv("SPHINX_TAGS")
  37. if env_tags is not None:
  38. for tag in env_tags.split(","):
  39. print("Adding Sphinx tag: %s" % tag.strip())
  40. tags.add(tag.strip()) # noqa: F821
  41. language = os.getenv("READTHEDOCS_LANGUAGE", "en")
  42. if language not in supported_languages.keys():
  43. print("Unknown language: " + language)
  44. print("Supported languages: " + ", ".join(supported_languages.keys()))
  45. print("The configured language is wrong. Falling back to 'en'.")
  46. language = "en"
  47. exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "examples", "notations"]
  48. pygments_style = "sphinx"
  49. todo_include_todos = False
  50. html_theme = "sphinx_rtd_theme"
  51. html_theme_options = {
  52. "logo_only": True,
  53. "collapse_navigation": False,
  54. }
  55. html_logo = "static/images/docs_logo.svg"
  56. html_static_path = ["static"]
  57. htmlhelp_basename = "sccddoc"
  58. html_extra_path = ["robots.txt"]
  59. html_css_files = ["css/custom.css"]
  60. html_js_files = ["js/custom.js"]
  61. on_rtd = os.environ.get("READTHEDOCS", None) == "True"
  62. html_title = supported_languages[language] % version
  63. html_context = {"conf_py_path": "/"}
  64. latex_engine = "pdflatex"
  65. latex_elements = {
  66. "papersize": "letterpaper",
  67. "pointsize": "10pt",
  68. "figure_align": "htbp",
  69. }
  70. latex_documents = [
  71. (
  72. master_doc,
  73. "sccd.tex",
  74. "SCCD Documentation",
  75. "Arkadiusz Michał Ryś",
  76. "manual"
  77. ),
  78. ]
  79. man_pages = [(
  80. master_doc,
  81. "sccd",
  82. "SCCD Documentation",
  83. [author],
  84. 1
  85. )]
  86. texinfo_documents = [(
  87. master_doc,
  88. "sccd",
  89. "SCCD Documentation",
  90. author,
  91. "sccd",
  92. "Distributed spreadsheet application.",
  93. "Miscellaneous"
  94. )]
  95. notfound_context = {
  96. "title": "Page not found",
  97. "body": """
  98. <h1>Page not found</h1>
  99. <p>
  100. Sorry, we couldn't find that page. It may have been renamed or removed
  101. in the version of the documentation you're currently browsing.
  102. </p>
  103. <p>
  104. If you're currently browsing the
  105. <em>latest</em> version of the documentation, try browsing the
  106. <a href="/en/stable/"><em>stable</em> version of the documentation</a>.
  107. </p>
  108. <p>
  109. Alternatively, use the
  110. <a href="#" onclick="$('#rtd-search-form [name=\\'q\\']').focus()">Search docs</a>
  111. box on the left or <a href="/">go to the homepage</a>.
  112. </p>
  113. """,
  114. }