fb2converter

command module
v1.60.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

README



fb2converter

converts fb2 files to epub, kepub, mobi, azw3

GoDoc Go Report Card


A complete rewrite of fb2mobi.

Russian WiKi

Russian forum.

Aims to be faster than python implementation and much easier to maintain. Simpler configuration, zero dependencies, better diagnostics and no installation required.

Essential differences:

  • no UI: use Libro or MyHomeLib
  • no XSL pre-processing (see document.transform configuration instead)
  • no XML configuration - use TOML, YAML or JSON format instead
  • no "default" external configuration, path to configuration file has to be supplied - always
  • no overwriting of configuration parameters from command line, options either specified in configuration file or on command line
  • slightly different hyphenation algorithm (no hyphensReplaceNBSP)
  • fixes and echancements in toc.ncx generation
  • epub processing was separated into its own command "transfer" and any attempts to process epub content were dropped
  • go differs in how it processes images, it is less forgiving than Python's PILLOW and do not have lazy decoding (see use_broken_images configuration option)
  • small changes in result formatting, for example:
    • chapter-end vignette would not be added if chapter does not have text paragraphs
    • html tags unknown to fb2 spec may be dropped depending on context
    • page size is calculated based on proper Unicode code points rather than byte size
    • ...
  • full support for kepub format
  • processing of files, directories, zip archives and directories with zip archives - no special consideration is made for .fb2.zip files.
  • flexible output path/name formatting
  • fb2c could be build for any platform supported by go language. If mobi or azw3 are required additional limitations are imposed by Amazon's kindlegen
  • fb2c has no dependencies and does not require installation or any kind

Installation:

Download from the releases page and unpack it in a convenient location.

  • Starting with v1.60.1 macOS releases for Intel and Apple silicon are build separately. I do not have kindlegen for Apple Silicon - not sure if one even exists, so manage your expectations.
  • Starting with v1.58.0 releases are packed with zip and signed with minisign. Here is public key for verification: RWTNh1aN8DrXq26YRmWO3bPBx4m8jBATGXt4Z96DF4OVSzdCBmoAU+Vq

key

Usage:

Configuration is fully documented here. In order to customize program behavior use "export" command to the directory of your choice and then supply path to your configuration file during program run.

Program has detailed logging configured by default (by default conversion.log in current working directory) - in case of problems, take a look there first.

>>> ./fb2c
NAME:
   fb2converter - fb2 conversion engine

USAGE:
   fb2c.exe [global options] command [command options] [arguments...]

VERSION:
   "program version" ("go runtime version") : "git sha string"

COMMANDS:
     convert     Converts FB2 file(s) to specified format
     transfer    Prepares EPUB file(s) for transfer (Kindle only!)
     synccovers  Extracts thumbnails from documents (Kindle only!)
     dumpconfig  Dumps active configuration (JSON)
     export      Exports built-in resources for customization
     help, h     Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --config FILE, -c FILE  load configuration from FILE (YAML, TOML or JSON). if FILE is "-" JSON will be expected from STDIN
   --debug, -d             leave behind various artifacts for debugging (do not delete intermediate results)
   --help, -h              show help
   --version, -v           print the version

Additional help for any command could be obtained by running ./fb2c help COMMAND-NAME.

Examples:

In order to convert all fb2 files in c:\books\to-read directory and get results in d:\out directory without keeping original subdirectory structure sending mobi files to Kindle via e-mail in process execute

fb2c.exe convert --nodirs --stk --to mobi c:\books\to-read d:\out

If you want resulting mobi files to be located alongside with original files, do something like

fb2c.exe convert --to mobi c:\books\to-read c:\books\to-read

MyHomeLib support:

Windows builds come with full MyHomeLib support. Just make sure that your MyHomeLib\converters directory does not contain old fb2mobi and/or fb2epub subdirectories and unpack fb2c_win32.zip or fb2c_win64.zip there. It is a drop-in replacement and should be functional out of the box in most cases.

NOTE:

  • fb2mobi.exe looks for fb2mobi.toml in its directory (similarly fb2epub.exe looks for fb2epub.toml), so any additional customization is easy.
  • Do not install MyHomeLib in either %ProgramFiles% or %ProgramFiles(x86)% directory - it is bad idea. Since for regular user accounts In Windows those places are write-protected you will have difficulties copying converters there and converters will have problems creating conversion logs which are enabled by default.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package archive builds Walk abstraction on top of "archive/zip".
Package archive builds Walk abstraction on top of "archive/zip".
cmd
Package commands has top level command drivers.
Package commands has top level command drivers.
Package config abstracts all program configuration.
Package config abstracts all program configuration.
Package etree provides XML services through an Element Tree abstraction (forked from https://github.com/beevik/etree and modified).
Package etree provides XML services through an Element Tree abstraction (forked from https://github.com/beevik/etree and modified).
Package hyphenator provides TeX-style hyphenation for multiple languages (forked from github.com/AlanQuatermain/go-hyphenator and modified).
Package hyphenator provides TeX-style hyphenation for multiple languages (forked from github.com/AlanQuatermain/go-hyphenator and modified).
Package processor does actual work.
Package processor does actual work.
Package state defines stared program state.
Package state defines stared program state.
Package static has runtime resources for various commands.
Package static has runtime resources for various commands.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL