Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ UPGRADE: Use pyScss instead of libsass #200

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"sphinx",
"click",
"setuptools",
"libsass",
"pyScss",
"pydata-sphinx-theme~=0.3.0",
"beautifulsoup4",
],
Expand Down
9 changes: 5 additions & 4 deletions sphinx_book_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from docutils import nodes
from sphinx.util import logging
from bs4 import BeautifulSoup as bs
from sass import compile as sass_compile
from scss.compiler import compile_file

from .launch import add_hub_urls

Expand All @@ -27,9 +27,10 @@ def add_static_path(app):
# Compile the css file if it's not been compiled already
compiled_css_file = static_path / "sphinx-book-theme.css"
if not compiled_css_file.exists():
source_dir = str(static_path.parent / "scss")
output_dir = str(static_path)
sass_compile(dirname=(source_dir, output_dir), output_style="compressed")
source_file = str(static_path.parent / "scss" / "sphinx-book-theme.scss")
css = compile_file(source_file, output_style="compressed")
with open(compiled_css_file, "w") as f:
f.write(css)


def find_url_relative_to_root(pagename, relative_page, path_docs_source):
Expand Down