diff --git a/.gitignore b/.gitignore index c8f8ee69..d261ebfc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ /*env*/ -.sphinx/venv +.sphinx/venv/ .sphinx/warnings.txt .sphinx/.wordlist.dic +.sphinx/.doctrees/ _build .DS_Store __pycache__ diff --git a/.sphinx/_static/furo_colors.css b/.sphinx/_static/furo_colors.css new file mode 100644 index 00000000..ffc36cbc --- /dev/null +++ b/.sphinx/_static/furo_colors.css @@ -0,0 +1,88 @@ +body { + --color-code-background: #f8f8f8; + --color-code-foreground: black; + --font-stack: Ubuntu, -apple-system, Segoe UI, Roboto, Oxygen, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + --font-stack--monospace: Ubuntu Mono, Consolas, Monaco, Courier, monospace; + --color-foreground-primary: #111; + --color-foreground-secondary: var(--color-foreground-primary); + --color-foreground-muted: #333; + --color-background-secondary: #FFF; + --color-background-hover: #f2f2f2; + --color-brand-primary: #111; + --color-brand-content: #06C; + --color-api-background: #cdcdcd; + --color-inline-code-background: rgba(0,0,0,.03); + --color-sidebar-link-text: #111; + --color-sidebar-item-background--current: #ebebeb; + --color-sidebar-item-background--hover: #f2f2f2; + --toc-font-size: var(--font-size--small); + --color-admonition-title-background--note: var(--color-background-primary); + --color-admonition-title-background--tip: var(--color-background-primary); + --color-admonition-title-background--important: var(--color-background-primary); + --color-admonition-title-background--caution: var(--color-background-primary); + --color-admonition-title--note: #24598F; + --color-admonition-title--tip: #24598F; + --color-admonition-title--important: #C7162B; + --color-admonition-title--caution: #F99B11; + --color-highlighted-background: #EbEbEb; + --color-link-underline: var(--color-background-primary); + --color-link-underline--hover: var(--color-background-primary); + --color-version-popup: #772953; +} + +@media not print { + body[data-theme="dark"] { + --color-code-background: #202020; + --color-code-foreground: #d0d0d0; + --color-foreground-secondary: var(--color-foreground-primary); + --color-foreground-muted: #CDCDCD; + --color-background-secondary: var(--color-background-primary); + --color-background-hover: #666; + --color-brand-primary: #fff; + --color-brand-content: #06C; + --color-sidebar-link-text: #f7f7f7; + --color-sidebar-item-background--current: #666; + --color-sidebar-item-background--hover: #333; + --color-admonition-background: transparent; + --color-admonition-title-background--note: var(--color-background-primary); + --color-admonition-title-background--tip: var(--color-background-primary); + --color-admonition-title-background--important: var(--color-background-primary); + --color-admonition-title-background--caution: var(--color-background-primary); + --color-admonition-title--note: #24598F; + --color-admonition-title--tip: #24598F; + --color-admonition-title--important: #C7162B; + --color-admonition-title--caution: #F99B11; + --color-highlighted-background: #666; + --color-link-underline: var(--color-background-primary); + --color-link-underline--hover: var(--color-background-primary); + --color-version-popup: #F29879; + } + @media (prefers-color-scheme: dark) { + body:not([data-theme="light"]) { + --color-code-background: #202020; + --color-code-foreground: #d0d0d0; + --color-foreground-secondary: var(--color-foreground-primary); + --color-foreground-muted: #CDCDCD; + --color-background-secondary: var(--color-background-primary); + --color-background-hover: #666; + --color-brand-primary: #fff; + --color-brand-content: #06C; + --color-sidebar-link-text: #f7f7f7; + --color-sidebar-item-background--current: #666; + --color-sidebar-item-background--hover: #333; + --color-admonition-background: transparent; + --color-admonition-title-background--note: var(--color-background-primary); + --color-admonition-title-background--tip: var(--color-background-primary); + --color-admonition-title-background--important: var(--color-background-primary); + --color-admonition-title-background--caution: var(--color-background-primary); + --color-admonition-title--note: #24598F; + --color-admonition-title--tip: #24598F; + --color-admonition-title--important: #C7162B; + --color-admonition-title--caution: #F99B11; + --color-highlighted-background: #666; + --color-link-underline: var(--color-background-primary); + --color-link-underline--hover: var(--color-background-primary); + --color-version-popup: #F29879; + } + } +} diff --git a/.sphinx/_templates/base.html b/.sphinx/_templates/base.html index 62ffe6b8..33081547 100644 --- a/.sphinx/_templates/base.html +++ b/.sphinx/_templates/base.html @@ -5,3 +5,8 @@ const github_url = "{{ github_url }}"; {% endblock theme_scripts %} + +{# ru-fu: don't include the color variables from the conf.py file, but use a + separate CSS file to save space #} +{% block theme_styles %} +{% endblock theme_styles %} diff --git a/Makefile b/Makefile index 4e50d854..b5454dfc 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line, and also # from the environment for the first two. -SPHINXOPTS ?= +SPHINXOPTS ?= -c . -d .sphinx/.doctrees SPHINXBUILD ?= sphinx-build SPHINXDIR = .sphinx SOURCEDIR = . @@ -59,21 +59,22 @@ install: $(VENVDIR) woke-install run: install - . $(VENV); sphinx-autobuild -c . -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" + . $(VENV); sphinx-autobuild -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" \ + $(SPHINXOPTS) .PHONY: run # Doesn't depend on $(BUILDDIR) to rebuild properly at every run. html: install - . $(VENV); $(SPHINXBUILD) -c . -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" \ - -w .sphinx/warnings.txt + . $(VENV); $(SPHINXBUILD) -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" \ + -w .sphinx/warnings.txt $(SPHINXOPTS) .PHONY: html epub: install - . $(VENV); $(SPHINXBUILD) -c . -b epub "$(SOURCEDIR)" "$(BUILDDIR)" \ - -w .sphinx/warnings.txt + . $(VENV); $(SPHINXBUILD) -b epub "$(SOURCEDIR)" "$(BUILDDIR)" \ + -w .sphinx/warnings.txt $(SPHINXOPTS) .PHONY: epub @@ -88,6 +89,7 @@ clean: clean-doc @test ! -e "$(VENVDIR)" -o \ -d "$(VENVDIR)" -a "$(abspath $(VENVDIR))" != "$(VENVDIR)" rm -rf $(VENVDIR) + rm -rf .sphinx/.doctrees .PHONY: clean @@ -105,7 +107,8 @@ spelling: html linkcheck: install - . $(VENV) ; $(SPHINXBUILD) -c . -b linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" + . $(VENV) ; $(SPHINXBUILD) -b linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" \ + $(SPHINXOPTS) .PHONY: linkcheck diff --git a/conf.py b/conf.py index d7ec4405..a2f1d6ad 100644 --- a/conf.py +++ b/conf.py @@ -107,61 +107,6 @@ html_theme = 'furo' html_last_updated_fmt = '' html_permalinks_icon = '¶' -html_theme_options = { - 'light_css_variables': { - 'font-stack': 'Ubuntu, -apple-system, Segoe UI, Roboto, Oxygen, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif', - 'font-stack--monospace': 'Ubuntu Mono, Consolas, Monaco, Courier, monospace', - 'color-foreground-primary': '#111', - 'color-foreground-secondary': 'var(--color-foreground-primary)', - 'color-foreground-muted': '#333', - 'color-background-secondary': '#FFF', - 'color-background-hover': '#f2f2f2', - 'color-brand-primary': '#111', - 'color-brand-content': '#06C', - 'color-api-background': '#cdcdcd', - 'color-inline-code-background': 'rgba(0,0,0,.03)', - 'color-sidebar-link-text': '#111', - 'color-sidebar-item-background--current': '#ebebeb', - 'color-sidebar-item-background--hover': '#f2f2f2', - 'toc-font-size': 'var(--font-size--small)', - 'color-admonition-title-background--note': 'var(--color-background-primary)', - 'color-admonition-title-background--tip': 'var(--color-background-primary)', - 'color-admonition-title-background--important': 'var(--color-background-primary)', - 'color-admonition-title-background--caution': 'var(--color-background-primary)', - 'color-admonition-title--note': '#24598F', - 'color-admonition-title--tip': '#24598F', - 'color-admonition-title--important': '#C7162B', - 'color-admonition-title--caution': '#F99B11', - 'color-highlighted-background': '#EbEbEb', - 'color-link-underline': 'var(--color-background-primary)', - 'color-link-underline--hover': 'var(--color-background-primary)', - 'color-version-popup': '#772953' - }, - 'dark_css_variables': { - 'color-foreground-secondary': 'var(--color-foreground-primary)', - 'color-foreground-muted': '#CDCDCD', - 'color-background-secondary': 'var(--color-background-primary)', - 'color-background-hover': '#666', - 'color-brand-primary': '#fff', - 'color-brand-content': '#06C', - 'color-sidebar-link-text': '#f7f7f7', - 'color-sidebar-item-background--current': '#666', - 'color-sidebar-item-background--hover': '#333', - 'color-admonition-background': 'transparent', - 'color-admonition-title-background--note': 'var(--color-background-primary)', - 'color-admonition-title-background--tip': 'var(--color-background-primary)', - 'color-admonition-title-background--important': 'var(--color-background-primary)', - 'color-admonition-title-background--caution': 'var(--color-background-primary)', - 'color-admonition-title--note': '#24598F', - 'color-admonition-title--tip': '#24598F', - 'color-admonition-title--important': '#C7162B', - 'color-admonition-title--caution': '#F99B11', - 'color-highlighted-background': '#666', - 'color-link-underline': 'var(--color-background-primary)', - 'color-link-underline--hover': 'var(--color-background-primary)', - 'color-version-popup': '#F29879' - }, -} ############################################################ ### Additional files @@ -173,6 +118,7 @@ 'custom.css', 'header.css', 'github_issue_links.css', + 'furo_colors.css' ] html_css_files.extend(custom_html_css_files)