From 912ff88bd0365eae989d19667077c7f08d0d6081 Mon Sep 17 00:00:00 2001 From: Hazel Noack Date: Tue, 10 Jun 2025 14:39:58 +0200 Subject: [PATCH] adding styles --- scribble_to_epub/scribblehub.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scribble_to_epub/scribblehub.py b/scribble_to_epub/scribblehub.py index bb6b6ca..ed4aa31 100644 --- a/scribble_to_epub/scribblehub.py +++ b/scribble_to_epub/scribblehub.py @@ -394,3 +394,17 @@ class ScribbleBook: if self.cover_url is not None and self.cover_url in self.assets: cover = self.assets[self.cover_url] book.set_cover(f"cover{cover.ext}", cover.content) + + # add style + style_path = Path(__assets__, "scribblehub.css") + if style_path.exists(): + styles = style_path.read_text("utf-8") + nav_css = epub.EpubItem( + uid="style_nav", + file_name="style/nav.css", + media_type="text/css", + content=styles, + ) + book.add_item(nav_css) + else: + log.warning("couldn't find styles in %s", str(style_path))