mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-23 23:32:38 +02:00
add part text
This commit is contained in:
parent
ba7291eb65
commit
6444eb65a3
@ -307,6 +307,7 @@ func (e *EPub) Write() error {
|
||||
{"OEBPS/toc.ncx", e.Render(TEMPLATE_TOC, map[string]any{"Info": e, "Images": part.Images})},
|
||||
{"OEBPS/nav.xhtml", e.Render(TEMPLATE_NAV, map[string]any{"Info": e, "Images": part.Images})},
|
||||
{"OEBPS/Text/style.css", TEMPLATE_STYLE},
|
||||
{"OEBPS/Text/part.xhtml", e.Render(TEMPLATE_PART, map[string]any{"Info": e, "Part": part})},
|
||||
{"OEBPS/Text/cover.xhtml", e.Render(TEMPLATE_TEXT, map[string]any{
|
||||
"Id": "cover",
|
||||
"Width": part.Cover.Width,
|
||||
|
@ -20,5 +20,8 @@ var TEMPLATE_NAV string
|
||||
//go:embed "templates/style.css.tmpl"
|
||||
var TEMPLATE_STYLE string
|
||||
|
||||
//go:embed "templates/part.xhtml.tmpl"
|
||||
var TEMPLATE_PART string
|
||||
|
||||
//go:embed "templates/text.xhtml.tmpl"
|
||||
var TEMPLATE_TEXT string
|
||||
|
@ -24,6 +24,7 @@
|
||||
<item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
|
||||
<item id="page_cover" href="Text/cover.xhtml" media-type="application/xhtml+xml"/>
|
||||
<item id="img_cover" href="Images/cover.jpg" media-type="image/jpeg" properties="cover-image"/>
|
||||
<item id="page_part" href="Text/part.xhtml" media-type="application/xhtml+xml"/>
|
||||
{{ range .Images }}
|
||||
<item id="page_{{ .Id }}" href="Text/{{ .Id }}.xhtml" media-type="application/xhtml+xml"/>
|
||||
<item id="img_{{ .Id }}" href="Images/{{ .Id }}.jpg" media-type="image/jpeg"/>
|
||||
@ -31,11 +32,12 @@
|
||||
</manifest>
|
||||
<spine page-progression-direction="ltr" toc="ncx">
|
||||
<itemref idref="page_cover" linear="yes" properties="page-spread-left"/>
|
||||
<itemref idref="page_part" linear="yes" properties="page-spread-right"/>
|
||||
{{ range $idx, $ := .Images }}
|
||||
{{ if mod $idx 2 }}
|
||||
<itemref idref="page_{{ $.Id }}" linear="yes" properties="page-spread-right"/>
|
||||
{{ else }}
|
||||
<itemref idref="page_{{ $.Id }}" linear="yes" properties="page-spread-left"/>
|
||||
{{ else }}
|
||||
<itemref idref="page_{{ $.Id }}" linear="yes" properties="page-spread-right"/>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</spine>
|
||||
|
14
internal/epub/templates/part.xhtml.tmpl
Normal file
14
internal/epub/templates/part.xhtml.tmpl
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
|
||||
<head>
|
||||
<title>Part {{ .Part.Idx }}</title>
|
||||
<link href="style.css" type="text/css" rel="stylesheet"/>
|
||||
<meta name="viewport" content="width={{ .Info.ViewWidth }}, height={{ .Info.ViewHeight }}"/>
|
||||
</head>
|
||||
<body style="">
|
||||
<h1 style="text-align:center;top:50%;">
|
||||
Part {{ .Part.Idx }}
|
||||
</h1>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user