diff --git a/Makefile b/Makefile index 74dd5e5..eeaed44 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,16 @@ clean: sphinx: $(MAKE) singlehtml epub latexpdf + rm build/singlehtml/_static/base-stemmer.js + rm build/singlehtml/_static/basic.css + rm build/singlehtml/_static/css/badge_only.css + rm build/singlehtml/_static/epub_cover.png + rm build/singlehtml/_static/german-stemmer.js + rm build/singlehtml/_static/jquery-3.5.1.js + rm build/singlehtml/_static/language_data.js + rm build/singlehtml/_static/searchtools.js + rm build/singlehtml/_static/underscore-1.13.1.js + rm build/singlehtml/_static/wtf_coop_header.png bundle: sphinx -mkdir bundle diff --git a/requirements.txt b/requirements.txt index f0f7c79..d4eb051 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ sphinxcontrib-plantuml myst-parser -sphinx_rtd_theme diff --git a/source/conf.py b/source/conf.py index eab215e..181cf00 100644 --- a/source/conf.py +++ b/source/conf.py @@ -57,7 +57,7 @@ exclude_patterns = [] # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = "wtf_coop" +html_theme = "custom_sphinx_rtd_theme" html_theme_path = ["../theme"] html_logo = "_static/wtf_logo_dark_bg.png" #html_theme = 'alabaster' diff --git a/theme/custom_sphinx_rtd_theme/__init__.py b/theme/custom_sphinx_rtd_theme/__init__.py new file mode 100644 index 0000000..b4d72c9 --- /dev/null +++ b/theme/custom_sphinx_rtd_theme/__init__.py @@ -0,0 +1,52 @@ +""" +Sphinx Read the Docs theme. + +From https://github.com/ryan-roemer/sphinx-bootstrap-theme. +""" + +from os import path + +from sphinx import version_info +from sphinx.locale import _ + +try: + # Avaliable from Sphinx 1.6 + from sphinx.util.logging import getLogger +except ImportError: + from logging import getLogger + + +__version__ = '0.5.1' +__version_full__ = __version__ + +logger = getLogger(__name__) + + +def get_html_theme_path(): + """Return list of HTML theme paths.""" + cur_dir = path.abspath(path.dirname(path.dirname(__file__))) + return cur_dir + + +def config_initiated(app, config): + theme_options = config.html_theme_options or {} + if theme_options.get('canonical_url'): + logger.warning( + _('The canonical_url option is deprecated, use the html_baseurl option from Sphinx instead.') + ) + + +# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package +def setup(app): + if version_info >= (1, 6, 0): + # Register the theme that can be referenced without adding a theme path + app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__))) + + if version_info >= (1, 8, 0): + # Add Sphinx message catalog for newer versions of Sphinx + # See http://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_message_catalog + rtd_locale_path = path.join(path.abspath(path.dirname(__file__)), 'locale') + app.add_message_catalog('sphinx', rtd_locale_path) + app.connect('config-inited', config_initiated) + + return {'parallel_read_safe': True, 'parallel_write_safe': True} diff --git a/theme/custom_sphinx_rtd_theme/breadcrumbs.html b/theme/custom_sphinx_rtd_theme/breadcrumbs.html new file mode 100644 index 0000000..f58eff5 --- /dev/null +++ b/theme/custom_sphinx_rtd_theme/breadcrumbs.html @@ -0,0 +1,84 @@ +{# Support for Sphinx 1.3+ page_source_suffix, but don't break old builds. #} + +{% if page_source_suffix %} +{% set suffix = page_source_suffix %} +{% else %} +{% set suffix = source_suffix %} +{% endif %} + +{% if meta is defined and meta is not none %} +{% set check_meta = True %} +{% else %} +{% set check_meta = False %} +{% endif %} + +{% if check_meta and 'github_url' in meta %} +{% set display_github = True %} +{% endif %} + +{% if check_meta and 'bitbucket_url' in meta %} +{% set display_bitbucket = True %} +{% endif %} + +{% if check_meta and 'gitlab_url' in meta %} +{% set display_gitlab = True %} +{% endif %} + +{% set display_vcs_links = display_vcs_links if display_vcs_links is defined else True %} + +
diff --git a/theme/custom_sphinx_rtd_theme/footer.html b/theme/custom_sphinx_rtd_theme/footer.html new file mode 100644 index 0000000..1284a24 --- /dev/null +++ b/theme/custom_sphinx_rtd_theme/footer.html @@ -0,0 +1,61 @@ + diff --git a/theme/custom_sphinx_rtd_theme/layout.html b/theme/custom_sphinx_rtd_theme/layout.html new file mode 100644 index 0000000..ca16d16 --- /dev/null +++ b/theme/custom_sphinx_rtd_theme/layout.html @@ -0,0 +1,250 @@ +{# TEMPLATE VAR SETTINGS #} +{%- set url_root = pathto('', 1) %} +{%- if url_root == '#' %}{% set url_root = '' %}{% endif %} +{%- if not embedded and docstitle %} + {%- set titlesuffix = " — "|safe + docstitle|e %} +{%- else %} + {%- set titlesuffix = "" %} +{%- endif %} +{%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) %} +{%- set sphinx_writer = 'writer-html5' if html5_doctype else 'writer-html4' %} + + + + + + {{ metatags }} + + {% block htmltitle %} +asdf asdf asdf asdf 22
+{%- endblock %} + + + diff --git a/theme/custom_sphinx_rtd_theme/locale/de/LC_MESSAGES/sphinx.po b/theme/custom_sphinx_rtd_theme/locale/de/LC_MESSAGES/sphinx.po new file mode 100644 index 0000000..44b82f2 --- /dev/null +++ b/theme/custom_sphinx_rtd_theme/locale/de/LC_MESSAGES/sphinx.po @@ -0,0 +1,142 @@ +# English translations for sphinx_rtd_theme. +# Copyright (C) 2019 ORGANIZATION +# This file is distributed under the same license as the sphinx_rtd_theme +# project. +# FIRST AUTHOR{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}
+ {% endif %} + {% endif %} +{{ context|e }}
+