This commit is contained in:
2025-04-20 00:32:41 +10:00
commit 9a098b205a
26 changed files with 1839 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package template
import "bilinovel-downloader/model"
templ ContentOPF(uniqueIdentifier string, dc *model.DublinCoreMetadata, manifest *model.Manifest, spine *model.Spine, guide *model.Guide) {
@templ.Raw(`<?xml version="1.0" encoding="UTF-8"?>`)
<package version="3.0" xmlns="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/" unique-identifier={ uniqueIdentifier }>
if dc != nil {
{{ metadata, err := dc.Marshal() }}
if err == nil {
@templ.Raw(metadata)
}
}
if manifest != nil {
{{ manifest, err := manifest.Marshal() }}
if err == nil {
@templ.Raw(manifest)
}
}
if spine != nil {
{{ spine, err := spine.Marshal() }}
if err == nil {
@templ.Raw(spine)
}
}
if guide != nil {
{{ guide, err := guide.Marshal() }}
if err == nil {
@templ.Raw(guide)
}
}
</package>
}