Skip to content

`txt2mobi` is a simple tool for converting txt file to Mobi format for kindle.

Notifications You must be signed in to change notification settings

zhnxin/txt2mobi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TXT2MOBI

README_ZH_cn.md

txt2mobi is a simple tool for converting txt file to Mobi format for kindle. It's Based on golang package mobi.

Note: All testing were done on Kindle App for windows and Kindle Paperwhite (10th Gen) PS: Any html element in text file would make effect.

Build

go get -u github.com/zhnxin/txt2mobi

Usage

  1. Prepare the cover,thumbnail and txt file

  2. Create a config file witch you can refer to example.toml

  3. Run the command:

[linux]$./txt2mobi -f example.toml [- o output_file_name.mobi] [-p]
#for Windows
[windows]$ txt2mobi.exe -f example.toml [- o output_file_name.mobi] [-p]

termimal parameter

require:

  • -config: config file

or

require:

  • -f: input file
  • -title: book title
  • -author: book author
  • -cover: book cover and thumbnail
  • -chapter: chater title regexp pattern

options:

  • -subchapter: subchapter title regexp pattern
  • compress: is to compress the result
  • encoding:: use gb18030 as default

other options:

  • -o: output file name
  • -p: is to use '<p></p>' to pack every paragrahes.
  • -escape: to disable html escape

config file

title="Example"
author="zhengxin"
file="example.txt"
cover="cover_example.jpg"
chapter="^Chapter\\.\\d+.*$"
subchapter='^Chapter\\.\\d+\-\\d+ .*$'
compress=false
//default cover size
//cover_width=860
//cover_hight=1200

Note:

  • title: If the output_filename is not given, the title would be used as default.
  • chapter: A regexp pattern to determin the chapter line title.
  • compress: If it's true, the output would be compressed witch make the file smaller but take mush time to finish.
  • encoding: Options. Use utf-8 as default. Also support gb18030 and gbk.

Need GUI?

This tool is ready simple but modifis all need for me. Email me if you really desire it.

About BLANK

The prefixed blank would be ignore because of html decoding.

About

`txt2mobi` is a simple tool for converting txt file to Mobi format for kindle.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages