From d96e63bc50cc6a22c120c0d24aee264bf9b7b07a Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Sat, 22 Apr 2023 10:29:36 +0200 Subject: [PATCH] improve style --- internal/epub/core.go | 11 +++-------- internal/epub/templates/blank.xhtml.tmpl | 1 + internal/epub/templates/style.css.tmpl | 11 ++++++++++- internal/epub/templates/text.xhtml.tmpl | 3 ++- internal/epub/templates/title.xhtml.tmpl | 1 + 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/internal/epub/core.go b/internal/epub/core.go index 5a04503..b0f4c5b 100644 --- a/internal/epub/core.go +++ b/internal/epub/core.go @@ -97,13 +97,8 @@ func (e *ePub) writeImage(wz *epubZip, img *Image) error { err := wz.WriteFile( fmt.Sprintf("OEBPS/%s", img.TextPath()), e.render(textTmpl, map[string]any{ - "Title": fmt.Sprintf("Image %d Part %d", img.Id, img.Part), - "ViewPort": fmt.Sprintf("width=%d, height=%d", e.ViewWidth, e.ViewHeight), - "ImageStyle": fmt.Sprintf( - "width:%dpx; height:%dpx;", - img.Width, - img.Height, - ), + "Title": fmt.Sprintf("Image %d Part %d", img.Id, img.Part), + "ViewPort": fmt.Sprintf("width=%d,height=%d", e.ViewWidth, e.ViewHeight), "ImagePath": img.ImgPath(), }), ) @@ -120,7 +115,7 @@ func (e *ePub) writeBlank(wz *epubZip, img *Image) error { fmt.Sprintf("OEBPS/Text/%d_sp.xhtml", img.Id), e.render(blankTmpl, map[string]any{ "Title": fmt.Sprintf("Blank Page %d", img.Id), - "ViewPort": fmt.Sprintf("width=%d, height=%d", e.ViewWidth, e.ViewHeight), + "ViewPort": fmt.Sprintf("width=%d,height=%d", e.ViewWidth, e.ViewHeight), }), ) } diff --git a/internal/epub/templates/blank.xhtml.tmpl b/internal/epub/templates/blank.xhtml.tmpl index e3ba233..0722dfc 100644 --- a/internal/epub/templates/blank.xhtml.tmpl +++ b/internal/epub/templates/blank.xhtml.tmpl @@ -2,6 +2,7 @@
+