123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407 |
- import os
- import sys
- from datetime import datetime
- import django
- import sphinx_wagtail_theme
- from sphinx.builders.html import StandaloneHTMLBuilder
- from wagtail import VERSION, __version__
- StandaloneHTMLBuilder.supported_image_types = ["image/gif", "image/png"]
- on_rtd = os.environ.get("READTHEDOCS", None) == "True"
- html_theme = "sphinx_wagtail_theme"
- html_theme_path = [sphinx_wagtail_theme.get_html_theme_path()]
- html_theme_options = {
- "project_name": "Wagtail Documentation",
- "github_url": "https://github.com/wagtail/wagtail/blob/main/docs/",
- }
- sys.path.insert(0, os.path.abspath(".."))
- os.environ["DJANGO_SETTINGS_MODULE"] = "wagtail.test.settings"
- django.setup()
- os.environ["DATABASE_ENGINE"] = "django.db.backends.sqlite3"
- extensions = [
- "sphinx.ext.autodoc",
- "sphinx.ext.intersphinx",
- "sphinx_copybutton",
- "myst_parser",
- "sphinx_wagtail_theme",
- ]
- autodoc_type_aliases = {
- "File": "django.core.files.File",
- }
- nitpick_ignore = [
-
- ("py:class", "wagtail.images.models.Filter"),
- ("py:class", "wagtail.url_routing.RouteResult"),
- ("py:class", "wagtail.blocks.base.Block"),
- ("py:class", "wagtail.blocks.field_block.BaseChoiceBlock"),
- ("py:class", "wagtail.blocks.field_block.ChooserBlock"),
-
- ("py:class", "wagtail.documents.views.chooser.BaseDocumentChooserBlock"),
- ("py:class", "wagtail.blocks.struct_block.BaseStructBlock"),
- ("py:class", "wagtail.blocks.stream_block.BaseStreamBlock"),
- ]
- suppress_warnings = [
- "epub.unknown_project_files",
- ]
- if not on_rtd:
- extensions.append("sphinxcontrib.spelling")
- templates_path = ["_templates"]
- source_suffix = ".rst"
- master_doc = "index"
- project = "Wagtail Documentation"
- copyright = f"{datetime.now().year}, Wagtail core team and contributors. BSD license"
- version = f"{VERSION[0]}.{VERSION[1]}"
- release = __version__
- exclude_patterns = ["_build", "README.md"]
- pygments_style = None
- spelling_lang = "en_GB"
- spelling_word_list_filename = "spelling_wordlist.txt"
- intersphinx_mapping = {
- "django": (
- "https://docs.djangoproject.com/en/stable/",
- "https://docs.djangoproject.com/en/stable/_objects/",
- ),
- "python": (
- "https://docs.python.org/3/",
- None,
- ),
- "treebeard": (
- "https://django-treebeard.readthedocs.io/en/stable/",
- None,
- ),
- "sphinx": (
- "https://www.sphinx-doc.org/en/master/",
- None,
- ),
- "myst": (
- "https://myst-parser.readthedocs.io/en/stable/",
- None,
- ),
- }
- myst_url_schemes = {
- "https": None,
- "http": None,
- "mailto": None,
- }
- html_favicon = "favicon.ico"
- html_static_path = ["_static"]
- html_extra_path = ["public"]
- html_use_index = False
- htmlhelp_basename = "Wagtaildoc"
- latex_engine = "xelatex"
- latex_elements = {
-
-
-
-
-
-
- }
- latex_documents = [
- (
- "index",
- "Wagtail.tex",
- "Wagtail Documentation",
- "Wagtail core team and contributors",
- "manual",
- ),
- ]
- man_pages = [
- (
- "index",
- "wagtail",
- "Wagtail Documentation",
- ["Wagtail core team and contributors"],
- 1,
- )
- ]
- texinfo_documents = [
- (
- "index",
- "Wagtail",
- "Wagtail Documentation",
- "Wagtail core team and contributors",
- "Wagtail",
- "An open source content management system built on Django.",
- "Miscellaneous",
- ),
- ]
- epub_title = project
- epub_author = "Wagtail core team and contributors"
- epub_publisher = "Wagtail"
- epub_copyright = copyright
- def setup(app):
- app.add_js_file("js/banner.js")
-
-
- app.add_crossref_type(
- directivename="setting",
- rolename="setting",
- indextemplate="pair: %s; setting",
- )
- app.add_crossref_type(
- directivename="templatetag",
- rolename="ttag",
- indextemplate="pair: %s; template tag",
- )
- app.add_crossref_type(
- directivename="templatefilter",
- rolename="tfilter",
- indextemplate="pair: %s; template filter",
- )
- app.add_crossref_type(
- directivename="fieldlookup",
- rolename="lookup",
- indextemplate="pair: %s; field lookup type",
- )
-
-
- from django.http import HttpRequest
- HttpRequest.__module__ = "django.http"
|