This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
md-pdf/md_pdf/build/css.py

17 lines
421 B
Python

from scss import Compiler
from md_pdf.consts import INTERNAL_STATIC_DIR
from md_pdf.build.pdf import STYLE_FILE
import os
STYLE_SRC_FILE = os.path.join(INTERNAL_STATIC_DIR, 'style.scss')
def render_css():
compiler = Compiler()
with open(STYLE_SRC_FILE) as f:
style = f.read()
with open(STYLE_FILE, 'w') as f:
data = compiler.compile_string(style)
f.write(data)
return data