Skip to content

Commit

Permalink
Merge pull request #99 from ru-fu/reduce-size
Browse files Browse the repository at this point in the history
Reduce size
  • Loading branch information
ru-fu authored Sep 26, 2023
2 parents 7a84484 + 2a8118a commit ce5b74e
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 63 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/*env*/
.sphinx/venv
.sphinx/venv/
.sphinx/warnings.txt
.sphinx/.wordlist.dic
.sphinx/.doctrees/
_build
.DS_Store
__pycache__
Expand Down
88 changes: 88 additions & 0 deletions .sphinx/_static/furo_colors.css
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
5 changes: 5 additions & 0 deletions .sphinx/_templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
const github_url = "{{ github_url }}";
</script>
{% 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 %}
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -105,7 +107,8 @@ spelling: html


linkcheck: install
. $(VENV) ; $(SPHINXBUILD) -c . -b linkcheck "$(SOURCEDIR)" "$(BUILDDIR)"
. $(VENV) ; $(SPHINXBUILD) -b linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" \
$(SPHINXOPTS)

.PHONY: linkcheck

Expand Down
56 changes: 1 addition & 55 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -173,6 +118,7 @@
'custom.css',
'header.css',
'github_issue_links.css',
'furo_colors.css'
]
html_css_files.extend(custom_html_css_files)

Expand Down

0 comments on commit ce5b74e

Please sign in to comment.