Skip to content

Commit

Permalink
Merge branch 'refactor-kepub-processing' (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaskin committed Jan 15, 2020
2 parents af91c60 + 1282954 commit 451ec01
Show file tree
Hide file tree
Showing 27 changed files with 1,640 additions and 1,260 deletions.
14 changes: 14 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '{build}'

environment:
GO111MODULE: on

build_script:
- cmd: C:\go113\bin\go.exe run -mod=readonly . --help || cd .

test_script:
- cmd: C:\go113\bin\go.exe test -mod=readonly -run "^TestMod_" golang.org/x/net/html -v
- cmd: C:\go113\bin\go.exe test -mod=readonly -v ./kepub
- cmd: C:\go113\bin\go.exe test -mod=readonly -v .

deploy: off
66 changes: 54 additions & 12 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,71 @@
kind: pipeline
name: kepubify
name: kepub
type: docker

steps:
- name: deps
- name: test-html
image: golang:1.13-buster
commands:
- GO111MODULE=on go test -mod=readonly -run "^TestMod_" golang.org/x/net/html -v
- name: test-kepub
image: golang:1.13-buster
commands:
- GO111MODULE=on go mod download
- GO111MODULE=on go test -mod=readonly -v ./kepub

# ---
#
# kind: pipeline
# name: kepub-windows
# type: docker
#
# platform:
# os: windows
# arch: amd64
#
# steps:
# - name: test-html
# image: golang:1.13-windowsservercore
# commands:
# - GO111MODULE=on go test -mod=readonly -run "^TestMod_" golang.org/x/net/html -v
# - name: test-kepub
# image: golang:1.13-windowsservercore
# commands:
# - GO111MODULE=on go test -mod=readonly -v ./kepub

---

kind: pipeline
name: kepubify
type: docker

platform:
os: linux
arch: amd64

steps:
- name: test
image: golang:1.13-buster
commands:
- GO111MODULE=on go test -mod=readonly -v . ./kepub
- GO111MODULE=on go test -mod=readonly -v .
- name: run
image: golang:1.13-buster
commands:
- GO111MODULE=on go run -mod=readonly . --help || true

depends_on:
- kepub

---

kind: pipeline
name: covergen
type: docker

platform:
os: linux
arch: amd64

steps:
- name: deps
image: golang:1.13-buster
commands:
- GO111MODULE=on go mod download
- name: test
image: golang:1.13-buster
commands:
Expand All @@ -38,12 +79,13 @@ steps:

kind: pipeline
name: seriesmeta
type: docker

platform:
os: linux
arch: amd64

steps:
- name: deps
image: golang:1.12-buster
commands:
- GO111MODULE=on go mod download
- name: test
image: golang:1.12-buster
commands:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Options:
--fullscreen-reading-fixes enable fullscreen reading bugfixes based on https://www.mobileread.com/forums/showpost.php?p=3113460&postcount=16
-h, --help show this help text
--hyphenate force enable hyphenation
--inline-styles inline all stylesheets (for working around certain bugs)
--no-hyphenate force disable hyphenation
-o, --output string the directory to place the converted files (default ".")
-r, --replace stringArray find and replace on all html files (repeat any number of times) (format: find|replace)
--smarten-punctuation smarten punctuation (smart quotes, dashes, etc) (excluding pre and code tags)
-u, --update don't reconvert files which have already been converted
-v, --verbose show extra information in output
--version show the version
Expand Down
5 changes: 3 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<ul>
<li>Full support of all kepub features</li>
<li>Batch conversion</li>
<li>Fast (about 12x faster than Calibre)</li>
<li>Fast (about 15x faster than Calibre)</li>
<li>Works from the command line</li>
<li>Optionally pre-generate covers (can also stretch it to a specific aspect ratio)</li>
<li>Optionally update Kobo series metadata (even before the book is imported)</li>
Expand Down Expand Up @@ -96,9 +96,10 @@
--fullscreen-reading-fixes enable fullscreen reading bugfixes based on https://www.mobileread.com/forums/showpost.php?p=3113460&postcount=16
-h, --help show this help text
--hyphenate force enable hyphenation
--inline-styles inline all stylesheets (for working around certain bugs)
--no-hyphenate force disable hyphenation
-o, --output string the directory to place the converted files (default ".")
-r, --replace stringArray find and replace on all html files (repeat any number of times) (format: find|replace)
--smarten-punctuation smarten punctuation (smart quotes, dashes, etc) (excluding pre and code tags)
-u, --update don't reconvert files which have already been converted
-v, --verbose show extra information in output
--version show the version
Expand Down
20 changes: 12 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ module github.com/geek1011/kepubify/v3
go 1.13

require (
github.com/PuerkitoBio/goquery v1.5.0
github.com/andybalholm/cascadia v1.1.0 // indirect
// command/tools
github.com/bamiaux/rez v0.0.0-20170731184118-29f4463c688b
github.com/beevik/etree v1.1.0
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/geek1011/koboutils/v2 v2.0.0
github.com/mattn/go-isatty v0.0.11
github.com/mattn/go-sqlite3 v1.9.0
github.com/mattn/go-sqlite3 v2.0.2+incompatible
github.com/mattn/go-zglob v0.0.1
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.2.2
)

require (
// kepub
github.com/andybalholm/cascadia v1.1.0
github.com/beevik/etree v1.1.0
github.com/kr/smartypants v0.1.0
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553
golang.org/x/sys v0.0.0-20200107162124-548cf772de50 // indirect
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
)

replace golang.org/x/net => github.com/geek1011/net v0.0.0-20200112223105-747a32f770f8 // x/net/html options for kepubify
28 changes: 9 additions & 19 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
github.com/PuerkitoBio/goquery v1.5.0 h1:uGvmFXOA73IKluu/F84Xd1tt/z07GYm8X49XKHP7EJk=
github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg=
github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o=
github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/andybalholm/cascadia v1.1.0 h1:BuuO6sSfQNFRu1LppgbD25Hr2vLYW25JvxHs5zzsLTo=
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/bamiaux/rez v0.0.0-20170731184118-29f4463c688b h1:5Ci5wpOL75rYF6RQGRoqhEAU6xLJ6n/D4SckXX1yB74=
github.com/bamiaux/rez v0.0.0-20170731184118-29f4463c688b/go.mod h1:obBQGGIFbbv9KWg92Qu9UHeD94JXmHD1jovY/z6I3O8=
github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs=
github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/geek1011/koboutils/v2 v2.0.0 h1:3tOuWnDhzXYNJhT+qJ4+w3CWp9wmGYN6hGGXpQ2IMqY=
github.com/geek1011/koboutils/v2 v2.0.0/go.mod h1:c/EwVM90qr2bHUrNBVi4jBUWdz+lH1ns2xlfQoiv1vk=
github.com/geek1011/net v0.0.0-20200112223105-747a32f770f8 h1:igYGtip7Y5+SQENEJa1WyKxxaZJ1brwYfTWiizaprs8=
github.com/geek1011/net v0.0.0-20200112223105-747a32f770f8/go.mod h1:GtsWdVoIzucsgYAWGiNlnsRjGNsNS1d8o6TTe5TRgB0=
github.com/kr/smartypants v0.1.0 h1:Sn8hn5XrY+uXrxSWUdcr621Gfpk11mOGGVs4XX06kEw=
github.com/kr/smartypants v0.1.0/go.mod h1:EcTX9ge+SWNaGwbQvHwNICsMGavh98FLUqyOWFr+j9c=
github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-sqlite3 v1.9.0 h1:pDRiWfl+++eC2FEFRy6jXmQlvp4Yh3z1MJKg4UeYM/4=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-sqlite3 v2.0.2+incompatible h1:qzw9c2GNT8UFrgWNDhCTqRqYUSmu/Dav/9Z58LGpk7U=
github.com/mattn/go-sqlite3 v2.0.2+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-zglob v0.0.1 h1:xsEx/XUoVlI6yXjqBK062zYhRTZltCNmYPx6v+8DNaY=
github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200107162124-548cf772de50 h1:YvQ10rzcqWXLlJZ3XCUoO25savxmscf4+SC+ZqiCHhA=
golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Loading

0 comments on commit 451ec01

Please sign in to comment.