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
2017-04-05 15:27:14 +01:00

17 lines
403 B
Python

from scss import Compiler
from md_pdf.consts import STATIC_DIR
from md_pdf.build.pdf import STYLE_FILE
import os
STYLE_SRC_FILE = os.path.join(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