From c048f98e90d684cf5f0b41b0b799a525b8f2adef Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sat, 20 Jul 2024 10:34:38 -0500 Subject: [PATCH] Fix style in boilerplate file and remove now-unnecessary Kindle compatibility CSS --- se/data/templates/se-kindle.css | 8 -------- se/data/templates/se.css | 1 + se/se_epub_build.py | 4 ---- 3 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 se/data/templates/se-kindle.css diff --git a/se/data/templates/se-kindle.css b/se/data/templates/se-kindle.css deleted file mode 100644 index 7f3cabf7..00000000 --- a/se/data/templates/se-kindle.css +++ /dev/null @@ -1,8 +0,0 @@ -/* Kindle compatibility CSS */ - -section[epub|type~="titlepage"] h1, -section[epub|type~="titlepage"] p, -section[epub|type~="colophon"] h2, -section[epub|type~="imprint"] h2{ - position: absolute; -} diff --git a/se/data/templates/se.css b/se/data/templates/se.css index 8fea497f..bdc10167 100644 --- a/se/data/templates/se.css +++ b/se/data/templates/se.css @@ -11,6 +11,7 @@ section[epub|type~="titlepage"] p, section[epub|type~="colophon"] h2, section[epub|type~="imprint"] h2{ left: -999em; + position: absolute; } section[epub|type~="titlepage"] img{ diff --git a/se/se_epub_build.py b/se/se_epub_build.py index 0da8d4e1..c980b37d 100644 --- a/se/se_epub_build.py +++ b/se/se_epub_build.py @@ -1303,10 +1303,6 @@ def build(self, run_epubcheck: bool, check_only: bool, build_kobo: bool, build_k return if build_kindle: - with open(work_compatible_epub_dir / "epub" / "css" / "se.css", "a", encoding="utf-8") as css_file: - with importlib.resources.files("se.data.templates").joinpath("se-kindle.css").open("r", encoding="utf-8") as compatibility_css_file: - css_file.write("\n\n" + compatibility_css_file.read()) - # Kindle doesn't go more than 2 levels deep for ToC, so flatten it here. with open(work_compatible_epub_dir / "epub" / toc_filename, "r+", encoding="utf-8") as file: dom = se.easy_xml.EasyXmlTree(file.read())