Skip to content

Commit

Permalink
⬆️ UPGRADE: Use pyScss instead of libsass (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
hason authored Sep 2, 2020
1 parent ccff278 commit 11982c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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

0 comments on commit 11982c1

Please sign in to comment.