123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- 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", "HttpRequest"),
- ("py:class", "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"),
- ]
- 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}, Torchbox 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/",
- )
- }
- 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", "Torchbox", "manual"),
- ]
- man_pages = [("index", "wagtail", "Wagtail Documentation", ["Torchbox"], 1)]
- texinfo_documents = [
- (
- "index",
- "Wagtail",
- "Wagtail Documentation",
- "Torchbox",
- "Wagtail",
- "One line description of project.",
- "Miscellaneous",
- ),
- ]
- def setup(app):
- app.add_js_file("js/banner.js")
|