diff --git a/se/commands/create_draft.py b/se/commands/create_draft.py index 75d1a216..5ec53de3 100644 --- a/se/commands/create_draft.py +++ b/se/commands/create_draft.py @@ -767,7 +767,6 @@ def _create_draft(args: Namespace): _copy_template_file("container.xml", content_path / "META-INF") _copy_template_file("mimetype", content_path) _copy_template_file("onix.xml", content_path / "epub") - _copy_template_file("toc.xhtml", content_path / "epub") _copy_template_file("core.css", content_path / "epub" / "css") if args.white_label: @@ -775,6 +774,7 @@ def _create_draft(args: Namespace): _copy_template_file("titlepage-white-label.xhtml", content_path / "epub" / "text" / "titlepage.xhtml") _copy_template_file("cover.jpg", content_path / "epub" / "images") _copy_template_file("local-white-label.css", content_path / "epub" / "css" / "local.css") + _copy_template_file("toc-white-label.xhtml", content_path / "epub" / "toc.xhtml") else: _copy_template_file("cover.jpg", repo_path / "images") @@ -788,6 +788,7 @@ def _create_draft(args: Namespace): _copy_template_file("uncopyright.xhtml", content_path / "epub" / "text") _copy_template_file("titlepage.xhtml", content_path / "epub" / "text") _copy_template_file("content.opf", content_path / "epub") + _copy_template_file("toc.xhtml", content_path / "epub") _copy_template_file("LICENSE.md", repo_path) # Try to find Wikipedia links if possible diff --git a/se/data/templates/compatibility-white-label.css b/se/data/templates/compatibility-white-label.css new file mode 100644 index 00000000..ddbf9b93 --- /dev/null +++ b/se/data/templates/compatibility-white-label.css @@ -0,0 +1,52 @@ +/* For legacy reading systems */ +article, +aside, +figure, +figcaption, +footer, +header, +main, +nav, +section{ + display: block; +} + +/* Give PNGs a white background for night mode compatibility... */ +img[epub|type~="se:image.color-depth.black-on-transparent"]{ + background: #fff !important; /* `!important` is required to make sure readers respect the BG color */ +} + +/* ...unless the device supports prefers-color-scheme. We’ll invert the image in core.css. RMSDK requires a target media as well as a state. */ +@media all and (prefers-color-scheme){ + img[epub|type~="se:image.color-depth.black-on-transparent"]:not([epub|type~="se:image.style.realistic"]){ + background: transparent !important; + } +} + +/* Vertical align any MathML images we might have */ +img.mathml{ + vertical-align: middle; +} + +/* As of 2020-09 hanging punctuation only works on iBooks. However, when it hangs over the page margin, it's + not rendered. So here we simply remove it for iBooks, unless it's on an element that already has a margin + like
*/ +:root[__ibooks_internal_theme] blockquote + p, +:root[__ibooks_internal_theme] h2 + p, +:root[__ibooks_internal_theme] h3 + p, +:root[__ibooks_internal_theme] h4 + p, +:root[__ibooks_internal_theme] h5 + p, +:root[__ibooks_internal_theme] h6 + p, +:root[__ibooks_internal_theme] header + p, +:root[__ibooks_internal_theme] hr + p, +:root[__ibooks_internal_theme] ol + p, +:root[__ibooks_internal_theme] ul + p, +:root[__ibooks_internal_theme] table + p, +:root[__ibooks_internal_theme] hgroup + p, +:root[__ibooks_internal_theme] p:first-child{ + hanging-punctuation: none !important; +} + +:root[__ibooks_internal_theme] blockquote p:first-child{ + hanging-punctuation: first last !important; +} diff --git a/se/data/templates/compatibility.css b/se/data/templates/compatibility.css index 612e795e..879ab66e 100644 --- a/se/data/templates/compatibility.css +++ b/se/data/templates/compatibility.css @@ -19,7 +19,7 @@ section[epub|type~="imprint"] h2{ display: none; } -/* ...but enable them accessibility in all other ereaders */ +/* ...but enable them for accessibility in all other ereaders */ @supports(font-size: 0){ section[epub|type~="titlepage"] h1, section[epub|type~="titlepage"] p, @@ -39,13 +39,13 @@ img[epub|type~="se:image.color-depth.black-on-transparent"]{ background: #fff !important; /* `!important` is required to make sure readers respect the BG color */ } -/* Except our house PNGs, which were rendered from SVGs with a white stroke... */ +/* ...except our house PNGs, which were rendered from SVGs with a white stroke... */ [epub|type~="titlepage"] img[epub|type~="se:image.color-depth.black-on-transparent"], img[epub|type~="se:image.color-depth.black-on-transparent"][epub|type~="z3998:publisher-logo"]{ background: transparent !important; } -/* ..or if the device supports prefers-color-scheme. We’ll invert the image in core.css. RMSDK requires a target media as well as a state. */ +/* ...or if the device supports prefers-color-scheme. We’ll invert the image in core.css. RMSDK requires a target media as well as a state. */ @media all and (prefers-color-scheme){ img[epub|type~="se:image.color-depth.black-on-transparent"]:not([epub|type~="se:image.style.realistic"]){ background: transparent !important; diff --git a/se/data/templates/local-white-label.css b/se/data/templates/local-white-label.css index 74ef50c8..64785876 100644 --- a/se/data/templates/local-white-label.css +++ b/se/data/templates/local-white-label.css @@ -1,12 +1,7 @@ @charset "utf-8"; @namespace epub "http://www.idpf.org/2007/ops"; -h1{ - margin-bottom: 1em; -} - -#titlepage p{ - font-variant: small-caps; +section[epub|type~="titlepage"] p{ text-align: center; text-indent: 0; } diff --git a/se/data/templates/titlepage-white-label.xhtml b/se/data/templates/titlepage-white-label.xhtml index c7a2614f..5758a2f3 100644 --- a/se/data/templates/titlepage-white-label.xhtml +++ b/se/data/templates/titlepage-white-label.xhtml @@ -8,12 +8,9 @@TITLE
-By
-
- AUTHORTranslated by
-
- TRANSLATORIllustrated by
+
- ILLUSTRATORBy AUTHOR.
+Translated by TRANSLATOR.
+Illustrated by ILLUSTRATOR.