123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- import os
- import sys
- from datetime import datetime
- import django
- import sphinx_wagtail_theme
- from recommonmark.transform import AutoStructify
- from wagtail import VERSION, __version__
- 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 = dict(
- 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.tests.settings'
- django.setup()
- os.environ['DATABASE_ENGINE'] = 'django.db.backends.sqlite3'
- extensions = [
- 'sphinx.ext.autodoc',
- 'sphinx.ext.intersphinx',
- 'recommonmark',
- 'sphinx_wagtail_theme',
- ]
- 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'
- version = '{}.{}'.format(VERSION[0], VERSION[1])
- release = __version__
- exclude_patterns = ['_build', 'README.md']
- pygments_style = 'default'
- 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/')
- }
- html_favicon = 'favicon.ico'
- html_static_path = ['_static']
- html_extra_path = ['robots.txt']
- html_use_index = False
- htmlhelp_basename = 'Wagtaildoc'
- latex_elements = {
-
-
-
-
-
-
- }
- latex_documents = [
- (
- 'index',
- 'Wagtail.tex',
- 'Wagtail Documentation',
- 'Torchbox',
- 'manual'
- ),
- ]
- man_pages = [
- ('index', 'wagtail', u'Wagtail Documentation',
- [u'Torchbox'], 1)
- ]
- texinfo_documents = [
- (
- 'index',
- 'Wagtail',
- 'Wagtail Documentation',
- 'Torchbox',
- 'Wagtail',
- 'One line description of project.',
- 'Miscellaneous'
- ),
- ]
- def setup(app):
- app.add_css_file('css/custom.css')
- app.add_js_file('js/banner.js')
- github_doc_root = 'https://github.com/wagtail/wagtail/tree/main/docs/'
- app.add_config_value('recommonmark_config', {
- 'url_resolver': lambda url: github_doc_root + url,
- }, True)
- app.add_transform(AutoStructify)
|