From 0db95c6bdee73bd1bc595a46ceeeeef987143325 Mon Sep 17 00:00:00 2001 From: NightFish <101402767+dmzz-yyhyy@users.noreply.github.com> Date: Sat, 28 Dec 2024 23:32:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=8C=E6=88=90epub=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/gradle.xml | 1 + README.md | 4 + epub.md | 122 ++++++++++ epub/build.gradle.kts | 18 ++ epub/gradle.properties | 1 + .../kotlin/io/nightfish/potatoepub/Epub.kt | 75 +++++++ .../nightfish/potatoepub/builder/Chapter.kt | 13 ++ .../potatoepub/builder/ChapterBuilder.kt | 52 +++++ .../potatoepub/builder/EpubBuilder.kt | 208 ++++++++++++++++++ .../builder/SimpleContentBuilder.kt | 62 ++++++ .../nightfish/potatoepub/otf/EpubManifest.kt | 40 ++++ .../io/nightfish/potatoepub/otf/Metadata.kt | 70 ++++++ .../kotlin/io/nightfish/potatoepub/otf/Nav.kt | 71 ++++++ .../io/nightfish/potatoepub/otf/OpfPackage.kt | 41 ++++ .../io/nightfish/potatoepub/otf/Spine.kt | 35 +++ .../io/nightfish/potatoepub/otf/TocNcx.kt | 57 +++++ .../potatoepub/otf/metaInf/Container.kt | 25 +++ .../io/nightfish/potatoepub/xml/Attribute.kt | 7 + .../io/nightfish/potatoepub/xml/Attributes.kt | 9 + .../potatoepub/xml/WriteToZipAble.kt | 14 ++ .../io/nightfish/potatoepub/xml/XmlBuilder.kt | 82 +++++++ .../io/nightfish/potatoepub/xml/XmlFormat.kt | 26 +++ .../src/test/kotlin/GenerateSimpleBookTest.kt | 50 +++++ epub/src/test/kotlin/XmlBuilderTest.kt | 21 ++ .../70d0a8f050ac1b4dfffb5665ce052498.jpg | Bin 0 -> 26763 bytes epub/src/test/resources/cover.jpg | Bin 0 -> 18191 bytes settings.gradle.kts | 3 +- 27 files changed, 1106 insertions(+), 1 deletion(-) create mode 100644 epub.md create mode 100644 epub/build.gradle.kts create mode 100644 epub/gradle.properties create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/Epub.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/builder/Chapter.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/builder/ChapterBuilder.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/builder/EpubBuilder.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/builder/SimpleContentBuilder.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/otf/EpubManifest.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/otf/Metadata.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/otf/Nav.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/otf/OpfPackage.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/otf/Spine.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/otf/TocNcx.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/otf/metaInf/Container.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/xml/Attribute.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/xml/Attributes.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/xml/WriteToZipAble.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/xml/XmlBuilder.kt create mode 100644 epub/src/main/kotlin/io/nightfish/potatoepub/xml/XmlFormat.kt create mode 100644 epub/src/test/kotlin/GenerateSimpleBookTest.kt create mode 100644 epub/src/test/kotlin/XmlBuilderTest.kt create mode 100644 epub/src/test/resources/70d0a8f050ac1b4dfffb5665ce052498.jpg create mode 100644 epub/src/test/resources/cover.jpg diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 7b3006b..cd8efe7 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -11,6 +11,7 @@