2 Commits

Author SHA1 Message Date
Dei Layborer
29935be2c3 Add arm64 build actions (#14)
Add arm64 build actions for darwin/macOS and linux.
2023-09-02 11:49:35 +02:00
lapwat
a6ba42f3e1 add table of content to ebooks 2023-04-24 19:10:31 +02:00
4 changed files with 23 additions and 3 deletions

View File

@@ -9,10 +9,14 @@ jobs:
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
exclude:
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1.30
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: amd64
goarch: ${{ matrix.goarch }}

View File

@@ -127,6 +127,22 @@ func ToEpub(c chapter, filename string) string {
func AppendToEpub(e *epub.Epub, c chapter) {
content := ""
// append table of content
if len(c.SubChapters()) > 1 {
html := "<h1>Table of Contents</h1>"
html += "<ol>"
for _, sc := range c.SubChapters() {
html += fmt.Sprintf("<li>%s</li>", sc.Name())
}
html += "</ol>"
_, err := e.AddSection(html, "Table of Contents", "", "")
if err != nil {
log.Fatal(err)
}
}
// chapter content
if c.config.Include {

File diff suppressed because one or more lines are too long

View File

@@ -14,6 +14,6 @@ var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of papeer",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("papeer v0.7.0")
fmt.Println("papeer v0.7.1")
},
}