Skip to content

Commit

Permalink
We have a name: furo!
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg committed Sep 1, 2020
1 parent 4fe9bd3 commit f4b1101
Show file tree
Hide file tree
Showing 43 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[settings]
line_length = 88
known_first_party = mawek
known_first_party = furo
default_section = THIRDPARTY
multi_line_output = 3
include_trailing_comma = True
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ repos:
rev: 2.1.1
hooks:
- id: prettier
files: src/mawek/assets/.*
files: src/furo/assets/.*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# mawek
# furo

I still have to figure out what this would be.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
# -- Options for HTML output -------------------------------------------------
#

html_theme = "mawek"
html_theme = "furo"

html_static_path = ["_static"]
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ license
```{toctree}
:caption: Kitchen Sink
GitHub Repository <https://github.com/pradyunsg/mawek>
GitHub Repository <https://github.com/pradyunsg/furo>
demo/index
```
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var plugins = [
autoprefixer(),
cssnano(),
];
var src_path = "./src/mawek/assets/";
var dest_path = "./src/mawek/theme/static";
var src_path = "./src/furo/assets/";
var dest_path = "./src/furo/theme/static";


function css() {
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ requires = ["flit_core >=2,<4"]
build-backend = "flit_core.buildapi"

[tool.flit.metadata]
module = "mawek"
module = "furo"
author = "Pradyun Gedam"
author-email = "[email protected]"
home-page = "https://github.com/pradyunsg/mawek"
home-page = "https://github.com/pradyunsg/furo"
description-file = "README.md"
requires-python = ">=3.5"
requires = [
Expand All @@ -22,7 +22,7 @@ test = [
doc = ["sphinx", "myst-parser"]

[tool.flit.entrypoints]
"sphinx.html_themes" = {mawek = "mawek"}
"sphinx.html_themes" = {furo = "furo"}

[tool.flit.sdist]
exclude = ["src/mawek/assets"]
exclude = ["src/furo/assets"]
12 changes: 6 additions & 6 deletions src/mawek/__init__.py → src/furo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@


def _html_page_context(app, pagename, templatename, context, doctree):
if app.config.html_theme != "mawek":
if app.config.html_theme != "furo":
return

# Custom Navigation Tree (adds checkboxes and labels)
toctree = context.get("toctree", lambda **kwargs: "")
toctree_html = toctree(
collapse=False, titles_only=True, maxdepth=-1, includehidden=True
)
context["mawek_navigation_tree"] = get_navigation_tree(toctree_html)
context["furo_navigation_tree"] = get_navigation_tree(toctree_html)

# Custom "should hide ToC" logic
context["mawek_hide_toc"] = should_hide_toc(context.get("toc", ""))
context["furo_hide_toc"] = should_hide_toc(context.get("toc", ""))
# Allow for hiding toc via ToC in page-wide metadata.
if "hide-toc" in (context.get("meta", None) or {}):
context["mawek_hide_toc"] = True
context["furo_hide_toc"] = True

# Inject information about styles
colors = get_pygments_style_colors(
app.builder.highlighter.formatter_args["style"],
fallbacks={"foreground": "#000000", "background": "#FFFFFF"},
)
context["mawek_pygments"] = colors
context["furo_pygments"] = colors

# Patch the content
if "body" in context:
Expand All @@ -41,6 +41,6 @@ def _html_page_context(app, pagename, templatename, context, doctree):
def setup(app):
"""Entry point for sphinx theming."""
theme_path = (Path(__file__).parent / "theme").resolve()
app.add_html_theme("mawek", str(theme_path))
app.add_html_theme("furo", str(theme_path))

app.connect("html-page-context", _html_page_context)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/mawek/navigation.py → src/furo/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _get_navigation_expand_image(soup):

@functools.lru_cache
def get_navigation_tree(toctree_html):
"""Modify the given navigation tree, with mawek-specific elements.
"""Modify the given navigation tree, with furo-specific elements.
Adds a checkbox + corresponding label to <li>s that contain a <ul> tag, to enable
the I-spent-too-much-time-making-this-CSS-only collapsing sidebar tree.
Expand Down
2 changes: 1 addition & 1 deletion src/mawek/theme/base.html → src/furo/theme/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{%- endif -%}

{#- Generator banner -#}
<meta name="generator" content="sphinx-{{ sphinx_version }}, mawek"/>
<meta name="generator" content="sphinx-{{ sphinx_version }}, furo"/>

{%- endblock site_meta -%}

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<main class="main">
<div class="content">
<article role="main">
<label class="toc-overlay-icon{% if mawek_hide_toc %} no-toc{% endif %}" for="__toc">
<label class="toc-overlay-icon{% if furo_hide_toc %} no-toc{% endif %}" for="__toc">
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
{% block content %}{{ body }}{% endblock %}
Expand Down Expand Up @@ -63,14 +63,14 @@
<span class="copyright">Copyright &copy; {{ copyright }}</span> |
Built with <a href="https://sphinx-doc.org/">Sphinx</a> using
<a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
<a href="https://github.com/pradyunsg/mawek">unnamed theme</a>.
<a href="https://github.com/pradyunsg/furo">furo theme</a>.
</div>
{% endblock footer %}
</footer>
</div>
<aside class="toc-drawer{% if mawek_hide_toc %} no-toc{% endif %}">
<aside class="toc-drawer{% if furo_hide_toc %} no-toc{% endif %}">
{% block right_sidebar %}
{% if not mawek_hide_toc %}
{% if not furo_hide_toc %}
<div class="toc-scroll">
<div class="toc-title-container">
<span class="toc-title">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#}
<style>
:root {
--color-code-background: {{ mawek_pygments.background }};
--color-code-foreground: {{ mawek_pygments.foreground }};
--color-code-background: {{ furo_pygments.background }};
--color-code-foreground: {{ furo_pygments.foreground }};
{% if theme_css_variables %}
{% for name, value in theme_css_variables.items() %}
--{{ name }}: {{ value }};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="sidebar-tree">
{{ mawek_navigation_tree }}
{{ furo_navigation_tree }}
</div>
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f4b1101

Please sign in to comment.