Skip to content

Commit

Permalink
add support for multiple styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Sup2point0 authored Apr 2, 2024
1 parent 103d877 commit 3b683fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion quarkdown/quarkify.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,17 @@ def export(file: ContentFile) -> dict:
content = textualise.render_html(content)
content = textualise.clear_comments(content)

style = "\n".join(
f'''<link rel="stylesheet" type="text/css" href="https://raw.githack.com/Sup2point0/Quarkdown/main/quarkdown/resources/{style}.css">'''
for style in load.get("style", ["default"])
)

root = os.path.split(os.path.abspath(__file__))[0]
path = os.path.join(root, "resources/core.html")

with open(path) as source:
content = source.read().format(
style = load.get("style", ["default"])[0], # TODO support multiple styles
style = style,
darkness = load.get("polarity", "light") == "dark",
header = load.get("header", ""),
content = content,
Expand Down

0 comments on commit 3b683fb

Please sign in to comment.