From 8beb5c114b13b1eecaddbb154501e24ca187a2b7 Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Thu, 4 Jan 2024 19:30:19 +0100 Subject: [PATCH] move epubtemplate outside epub --- pkg/epub/epub.go | 2 +- pkg/epub/templates/epub_templates.go | 23 ------------------- pkg/epubtemplates/epubtemplates.go | 23 +++++++++++++++++++ .../epubtemplates_applebooks.xml.tmpl} | 0 .../epubtemplates_blank.xhtml.tmpl} | 0 .../epubtemplates_container.xml.tmpl} | 0 .../epubtemplates_content.go} | 0 .../epubtemplates_style.css.tmpl} | 0 .../epubtemplates_text.xhtml.tmpl} | 0 .../epubtemplates_toc.go} | 0 10 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 pkg/epub/templates/epub_templates.go create mode 100644 pkg/epubtemplates/epubtemplates.go rename pkg/{epub/templates/epub_templates_applebooks.xml.tmpl => epubtemplates/epubtemplates_applebooks.xml.tmpl} (100%) rename pkg/{epub/templates/epub_templates_blank.xhtml.tmpl => epubtemplates/epubtemplates_blank.xhtml.tmpl} (100%) rename pkg/{epub/templates/epub_templates_container.xml.tmpl => epubtemplates/epubtemplates_container.xml.tmpl} (100%) rename pkg/{epub/templates/epub_templates_content.go => epubtemplates/epubtemplates_content.go} (100%) rename pkg/{epub/templates/epub_templates_style.css.tmpl => epubtemplates/epubtemplates_style.css.tmpl} (100%) rename pkg/{epub/templates/epub_templates_text.xhtml.tmpl => epubtemplates/epubtemplates_text.xhtml.tmpl} (100%) rename pkg/{epub/templates/epub_templates_toc.go => epubtemplates/epubtemplates_toc.go} (100%) diff --git a/pkg/epub/epub.go b/pkg/epub/epub.go index b4a4f98..114e31e 100644 --- a/pkg/epub/epub.go +++ b/pkg/epub/epub.go @@ -15,11 +15,11 @@ import ( "text/template" "time" - epubtemplates "github.com/celogeek/go-comic-converter/v2/pkg/epub/templates" "github.com/celogeek/go-comic-converter/v2/pkg/epubimage" "github.com/celogeek/go-comic-converter/v2/pkg/epubimageprocessor" "github.com/celogeek/go-comic-converter/v2/pkg/epuboptions" "github.com/celogeek/go-comic-converter/v2/pkg/epubprogress" + "github.com/celogeek/go-comic-converter/v2/pkg/epubtemplates" "github.com/celogeek/go-comic-converter/v2/pkg/epubtree" "github.com/celogeek/go-comic-converter/v2/pkg/epubzip" "github.com/gofrs/uuid" diff --git a/pkg/epub/templates/epub_templates.go b/pkg/epub/templates/epub_templates.go deleted file mode 100644 index 12cbd52..0000000 --- a/pkg/epub/templates/epub_templates.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Templates use to create xml files of the EPUB. -*/ -package epubtemplates - -import _ "embed" - -var ( - //go:embed "epub_templates_container.xml.tmpl" - Container string - - //go:embed "epub_templates_applebooks.xml.tmpl" - AppleBooks string - - //go:embed "epub_templates_style.css.tmpl" - Style string - - //go:embed "epub_templates_text.xhtml.tmpl" - Text string - - //go:embed "epub_templates_blank.xhtml.tmpl" - Blank string -) diff --git a/pkg/epubtemplates/epubtemplates.go b/pkg/epubtemplates/epubtemplates.go new file mode 100644 index 0000000..18ce268 --- /dev/null +++ b/pkg/epubtemplates/epubtemplates.go @@ -0,0 +1,23 @@ +/* +Templates use to create xml files of the EPUB. +*/ +package epubtemplates + +import _ "embed" + +var ( + //go:embed "epubtemplates_container.xml.tmpl" + Container string + + //go:embed "epubtemplates_applebooks.xml.tmpl" + AppleBooks string + + //go:embed "epubtemplates_style.css.tmpl" + Style string + + //go:embed "epubtemplates_text.xhtml.tmpl" + Text string + + //go:embed "epubtemplates_blank.xhtml.tmpl" + Blank string +) diff --git a/pkg/epub/templates/epub_templates_applebooks.xml.tmpl b/pkg/epubtemplates/epubtemplates_applebooks.xml.tmpl similarity index 100% rename from pkg/epub/templates/epub_templates_applebooks.xml.tmpl rename to pkg/epubtemplates/epubtemplates_applebooks.xml.tmpl diff --git a/pkg/epub/templates/epub_templates_blank.xhtml.tmpl b/pkg/epubtemplates/epubtemplates_blank.xhtml.tmpl similarity index 100% rename from pkg/epub/templates/epub_templates_blank.xhtml.tmpl rename to pkg/epubtemplates/epubtemplates_blank.xhtml.tmpl diff --git a/pkg/epub/templates/epub_templates_container.xml.tmpl b/pkg/epubtemplates/epubtemplates_container.xml.tmpl similarity index 100% rename from pkg/epub/templates/epub_templates_container.xml.tmpl rename to pkg/epubtemplates/epubtemplates_container.xml.tmpl diff --git a/pkg/epub/templates/epub_templates_content.go b/pkg/epubtemplates/epubtemplates_content.go similarity index 100% rename from pkg/epub/templates/epub_templates_content.go rename to pkg/epubtemplates/epubtemplates_content.go diff --git a/pkg/epub/templates/epub_templates_style.css.tmpl b/pkg/epubtemplates/epubtemplates_style.css.tmpl similarity index 100% rename from pkg/epub/templates/epub_templates_style.css.tmpl rename to pkg/epubtemplates/epubtemplates_style.css.tmpl diff --git a/pkg/epub/templates/epub_templates_text.xhtml.tmpl b/pkg/epubtemplates/epubtemplates_text.xhtml.tmpl similarity index 100% rename from pkg/epub/templates/epub_templates_text.xhtml.tmpl rename to pkg/epubtemplates/epubtemplates_text.xhtml.tmpl diff --git a/pkg/epub/templates/epub_templates_toc.go b/pkg/epubtemplates/epubtemplates_toc.go similarity index 100% rename from pkg/epub/templates/epub_templates_toc.go rename to pkg/epubtemplates/epubtemplates_toc.go