Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kepubify v3 #34

Closed
pgaskin opened this issue Feb 7, 2019 · 7 comments
Closed

Kepubify v3 #34

pgaskin opened this issue Feb 7, 2019 · 7 comments
Assignees

Comments

@pgaskin
Copy link
Owner

pgaskin commented Feb 7, 2019

I'm planning to work on kepubify v3 sometime soon. The goals will be:

  • More predictable and intuitive output locations and options (this will be the main feature).
  • Improved CLI and logging.
  • More unit tests and code cleanup.
  • Automatically detect and sync with a kobo.
  • Improved XHTML parsing and generation.
  • Possible performance improvements.
  • Possible pre-importing to the kobo.
  • More comprehensive help text.
  • Possibly a GUI or installer with explorer integration for Windows.
  • The Calibre extension may be ready.
  • Possibly caching for performance improvements.
  • A better README.
  • More later.

If anybody has any suggestions/comments, I'd be happy to consider them.

@pgaskin pgaskin self-assigned this Feb 7, 2019
@pgaskin
Copy link
Owner Author

pgaskin commented Feb 7, 2019

Here is the tentative help text so far.

kepubify - Convert EPUBs to Kobo EPUBs.

Usage: kepubify [options] <input>...

Options:
    -o, --output <path>       The output file/directory for converted files (default: the orignal filename with .kepub.epub).
                              For directories, the default is the directory name with the suffix _converted. If it exists, it
                              will be replaced (unless --update is specified), and if not, it will be created. In the case
                              that multiple input folders are provided, they will be put in a subdirectory, unless
                              --no-preserve-dirs is specified. You can also specify KOBO as the path to automatically detect
                              a kobo and convert to a directory in it named kepubify.
    -n, --no-preserve-dirs    Do not preserve the directory structure of the source.
    -i, --inplace             Convert files in-place. Cannot be used with --output or --no-preserve-dirs.
    -u, --update              Only converts unconverted files (automatically enabled if output is KOBO).
        --kobo-import         EXPERIMENTAL: Pre-import books when KOBO is the output (compatible with firmware 4.12.*****).
                              This adds the book and chapter information to Content, generates the cover thumbnails, and 
                              adds the chapters to volume_shortcovers.
    -h, --hyphenate           Force enables hyphenation.
    -H, --no-hyphenate        Force disables hyphenation.
    -f, --fullscreen-fixes    Adds css to fix fullscreen issues on older firmware.
    -c, --css <css>           Adds custom css styles to the converted file.
        --inline-stylesheets  Inlines all stylesheets to fix issues on some firmware versions.
        --calibre             Uses .kepub as the extension. This option may also do additional things in the future.
    -v, --verbose             Shows more detailed output.
    -d, --debug               Shows even more detailed output (implies verbose) (use this when submitting bug reports).
    -h, --help                Show this help text.
        --version             Show the current version (kepubify v3.0.0-alpha).

Arguments:
    <input>: The path to the input files/folders. Kepubify will refuse to convert files which are already .kepub.epubs. Errors
	in each file will be ignored until the end, where a list of errors, if any, will be shown. If a path does not exist, kepubify
	will exit with an error and will not convert any of the files. If a file is specified more than once, only the last occurence
	will be counted. TODO: more info.

Links:
    Website      - https://pgaskin.net/kepubify
    Source Code  - https://github.com/geek1011/kepubify
    Bugs/Support - https://github.com/geek1011/kepubify/issues
    MobileRead   - http://mr.gd/forums/showthread.php?t=295287

And some conversion examples:

== Examples of conversion inputs/outputs ==
These examples demonstrate the behaviour of
different options. The outputs list the
files which are written to by kepubify.

input:
./test1/book0.epub
./test1/book1.epub
./test1/dir1/book2.epub
./test1/dir1/book3.epub
./test1/dir2/book4.epub
./book5.epub
./test2/dir3/book6.epub
./test2/dir4/book7.epub
./test3/book0.kepub.epub
./test3/book1.kepub
./test3/dir1/book2.kepub.epub

kepubify test1:
./test1_converted/book0.kepub.epub
./test1_converted/book1.kepub.epub
./test1_converted/dir1/book2.kepub.epub
./test1_converted/dir1/book3.kepub.epub
./test1_converted/dir2/book4.kepub.epub

kepubify test1/dir1:
./dir1_converted/book2.kepub.epub
./dir1_converted/book3.kepub.epub

kepubify --output test3 test1:
./test3/dir1/book2.kepub.epub
./test3/dir1/book3.kepub.epub
./test3/dir2/book4.kepub.epub

kepubify --output test3 --no-preserve-dirs test1:
./test3/book2.kepub.epub
./test3/book3.kepub.epub
./test3/book4.kepub.epub

kepubify --no-preserve-dirs test1:
./book2.kepub.epub
./book3.kepub.epub
./book4.kepub.epub

kepubify test1 test2 book5.epub:
./test1_converted/book0.kepub.epub
./test1_converted/book1.kepub.epub
./test1_converted/dir1/book2.kepub.epub
./test1_converted/dir1/book3.kepub.epub
./test1_converted/dir2/book4.kepub.epub
./test2_converted/dir3/book6.kepub.epub
./test2_converted/dir4/book7.kepub.epub
./book5.kepub.epub

kepubify --inplace test1:
./test1/book0.kepub.epub
./test1/book1.kepub.epub
./test1/dir1/book2.kepub.epub
./test1/dir1/book3.kepub.epub
./test1/dir2/book4.kepub.epub

kepubify --inplace --calibre test1:
./test1/book0.kepub
./test1/book1.kepub
./test1/dir1/book2.kepub
./test1/dir1/book3.kepub
./test1/dir2/book4.kepub

kepubify --output test4 test1 test2 book5.epub:
./test4/test1/book0.kepub.epub
./test4/test1/book1.kepub.epub
./test4/test1/dir1/book2.kepub.epub
./test4/test1/dir1/book3.kepub.epub
./test4/test1/dir2/book4.kepub.epub
./test4/test2/dir3/book6.kepub.epub
./test4/test2/dir4/book7.kepub.epub
./test4/book5.kepub.epub

kepubify --output whatever.kepub.epub book5.epub:
./whatever.kepub.epub

kepubify test1/book0.epub book5.epub:
./book0.kepub.epub
./book5.kepub.epub

@jgneff
Copy link

jgneff commented Feb 10, 2019

Have you considered packaging Kepubify v3 as a snap for Linux? There are instructions for Go at the bottom of the Snapcraft page.

@pgaskin
Copy link
Owner Author

pgaskin commented Feb 10, 2019

OK, I'll consider making a snap for this version. I've heard of snaps before, but I don't use Ubuntu very much (I'm mainly a Debian/Arch person, and prefer their native packaging systems).

@pgaskin pgaskin pinned this issue Feb 10, 2019
@jgneff
Copy link

jgneff commented Feb 11, 2019

I'm mainly a Debian/Arch person, and prefer their native packaging systems.

Even better, then, have you thought about getting Kepubify into Debian? That would make it available as part of any Debian-based distribution, including Ubuntu, and allow us to install it from a trusted third-party source without hesitation. That's the best goal for important software like Kepubify, but it takes a bit more patience than just packaging a snap. For details, see the links under the section Through Debian in the first answer to this question.

@pgaskin
Copy link
Owner Author

pgaskin commented Feb 11, 2019

Yep. I already have a package generated with NFPM and hosted on my repo (https://deb.geek1011.net). I'm also familiar with proper deb packaging (e.g. using dh_make and debuild) (more than snap). I'm planning to work on getting it into debian along with some other packages I currently build locally as soon as I have enough spare time to go through the process.

@pgaskin
Copy link
Owner Author

pgaskin commented Jan 14, 2020

I'm nearly finished v3. All I have left to do is updating the docs, possibly adding Explorer integration for Windows (edit: put off until later, it needs more thought put into the design), improving the build scripts, writing a few more tests, writing the release notes, and manually testing a few things.

pgaskin added a commit that referenced this issue Jan 14, 2020
pgaskin added a commit that referenced this issue Jan 14, 2020
- Deterministic file processing order
- Better path transformation options (see tests)
- Simplified main command
- Split options into sections
- Allow multiple css additions
- Updated docs
- A few other changes
pgaskin added a commit that referenced this issue Jan 15, 2020
@pgaskin
Copy link
Owner Author

pgaskin commented Jan 15, 2020

Note to self (about future explorer extension):

	MsgBox = func(hwnd uintptr, caption, title string, flags uint) int {
		ret, _, _ := syscall.NewLazyDLL("user32.dll").NewProc("MessageBoxW").Call(
			uintptr(hwnd),
			uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(caption))),
			uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(title))),
			uintptr(flags))
		return int(ret)
	}

@pgaskin pgaskin closed this as completed Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants