|
9 | 9 | # If extensions (or modules to document with autodoc) are in another directory,
|
10 | 10 | # add these directories to sys.path here. If the directory is relative to the
|
11 | 11 | # documentation root, use os.path.abspath to make it absolute, like shown here.
|
12 |
| -# |
13 | 12 | import os
|
14 | 13 | import sys
|
15 | 14 |
|
|
48 | 47 |
|
49 | 48 | # The theme to use for HTML and HTML Help pages. See the documentation for
|
50 | 49 | # a list of builtin themes.
|
51 |
| -# |
52 | 50 | html_theme = "sphinx_rtd_theme"
|
53 | 51 |
|
| 52 | +# Adds "edit source" links |
| 53 | +# Source: https://docs.readthedocs.io/en/stable/guides/edit-source-links-sphinx.html |
| 54 | +html_context = { |
| 55 | + "display_github": True, # Integrate GitHub |
| 56 | + "github_user": "TheRenegadeCoder", # Username |
| 57 | + "github_repo": "SnakeMD", # Repo name |
| 58 | + "github_version": "main", # Version |
| 59 | + "conf_py_path": "/docs/", # Path in the checkout to the docs root |
| 60 | +} |
| 61 | + |
54 | 62 | # Add any paths that contain custom static files (such as style sheets) here,
|
55 | 63 | # relative to this directory. They are copied after the builtin static files,
|
56 | 64 | # so a file named "default.css" will overwrite the builtin "default.css".
|
|
64 | 72 | intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
|
65 | 73 |
|
66 | 74 | html_theme_options = {"display_version": True}
|
| 75 | + |
| 76 | +# -- ReadTheDocs Configuration |
| 77 | + |
| 78 | +# Set canonical URL from the Read the Docs Domain |
| 79 | +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") |
| 80 | + |
| 81 | +# Tell Jinja2 templates the build is running on Read the Docs |
| 82 | +if os.environ.get("READTHEDOCS", "") == "True": |
| 83 | + html_context["READTHEDOCS"] = True |
0 commit comments