-
Notifications
You must be signed in to change notification settings - Fork 19
/
configuration.toml
366 lines (322 loc) · 19.7 KB
/
configuration.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
#-----------------------------------------------------------------------------------------------------------------------------
#---- fb2converter engine configuration.
#---- This should be UTF-8 only!
#----
#---- NOTE: you could specify multiple sources of configuration by providing multiple --config arguments. They are processed
#---- in order of occurrence. Only one source could be read from "stdin"
#----
#-----------------------------------------------------------------------------------------------------------------------------
[logger]
#---- controls terminal (stdout, stderr) output
[logger.console]
#---- logging level
#---- "none" - suppress all console logging
#---- "normal" - messages INFO level and higher are outputted
#---- "debug" - all log messages are outputted
level = "normal"
#---- controls logging to a file (could duplicate CONSOLE messages)
[logger.file]
#---- logging level
#---- "none" - suppress logging
#---- "normal" - messages INFO level and higher are printed
#---- "debug" - all log output is printed
level = "debug"
#---- path to the log file, if relative - relative to current working directory
# destination = "conversion.log"
#---- how to handle output file during consecutive program runs
#---- "append" - keep all old log messages, append new ones at the end
#---- "overwrite" - keep only messages from the last run, log is overwritten
mode = "append"
[document]
#---- NOTE: in all format specifications curly brackets are indicating conditional blocks: only if result of keywords
#---- expansion inside block is not empty - block will be used, otherwise entire block will be ignored. Could be recursive,
#---- to output curly brackets escape them with backslash.
#
#---- NOTE: unless specified separately all relative paths in configuration are relative to the directory of configuration
#---- file!
#---- CSS stylesheet to use. If absent - default one will be supplied
# style = "profiles/default.css"
#---- Some programs (CoolReader and some versions of FBReader) expect "old" zip format. We have this on by default, if
#---- you encounter unreadable epub/kepub files - turn it off
# fix_zip_format = true
# When true program removes transparency on PNG files - Kindle eInc devices do not handle it well
remove_png_transparency = false
#---- Forcefully resize all images (but cover) with specified ratio
# images_scale_factor = 0
#---- Forcefully recompress all supported images (presently JPEG, PNG)
#---- For JPEG quality respects "jpeg_quality_level" - if detected level for an image is higher than requested one image will be re-encoded
#---- For PNG best compression_level is always specified
#---- use on your own risk - results may vary
# optimize_images = false
#---- JPEG quality level to use, percentage points (40% - 100%), when not specified or wrong 75% is used
# jpeq_quality_level = 75
#---- Pattern to format book title
#---- "#title" - book title
#---- "#file_name" - name of original FB2 file (no path, no extension)
#---- "#file_name_ext" - name of original FB2 file (no path)
#---- "#series" - name of sequence book belongs to
#---- "#series_first_word" - first word in the name of series book belongs to, up to "series_first_word_length" letters
#---- "#abbrseries" - abbreviated #series, lower case
#---- "#ABBRseries" - abbreviated #series, upper case
#---- "#number" - number in a series
#---- "#padnumber" - number in a series padded with zeros to "series_number_positions"
#---- "#date" - date specified in a book description
title_format = "{(#ABBRseries{ - #padnumber}) }#title"
#---- How many positions padded series number will take
# series_number_positions = 2
#---- How many letters take from first word of series name, if less or equal 0 - take whole word, if word is shorter than specified - take whole word only
# series_first_word_length = 4
#---- Patterns to format author name (#author, #autors) in different places
#---- "#f" - first name
#---- "#fi" - first name initial (first letter)
#---- "#m" - middle name
#---- "#mi" - middle name initial (first letter of middle name)
#---- "#l" - last name
author_format = "#l{ #f}{ #m}"
# author_format_meta = "#l{ #f}{ #m}"
# author_format_file_name = "#l{ #f}{ #m}"
#---- Output file name pattern - output file will have name created using FB2 information
#---- NOTE: watch out for path separators, directories will be created!
#---- "#title" - book title
#---- "#series" - name of sequence book belongs to
#---- "#series_first_word" - first word in the name of series book belongs to, up to "series_first_word_length" letters
#---- "#abbrseries" - abbreviated #series, lower case
#---- "#ABBRseries" - abbreviated #series, upper case
#---- "#number" - number in a series
#---- "#padnumber" - number in a series padded with zeros to "series_number_positions"
#---- "#authors" - list of all authors (each formatted as specified in "author_format")
#---- "#author" - name of the first author (formatted as specified in "author_format"). If more then one - it will
#---- be indicated with either ", et al" or " и др" depending on book language
#---- "#bookid" - Book UUID (either parsed from or genrated based of fb2 information)
# file_name_format = "{#author - }#title"
#---- Slugify/transliterate output file name - after all other processing on file name is completed
# file_name_transliterate = false
#---- Place book chapters in separate files. On most reading devices it also means starting
#---- chapter on a new page. This mode usually provides faster reading experience as most readers
#---- keep only current content file in memory.
#---- NOTE: when this is "false" other settings controlling size of the resulting content are ignored.
chapter_per_file = true
#---- Determines on what level fb2 <section> becomes book chapter
# chapter_level = 2147483647
#---- Slugify/transliterate book title and author(s) names
# transliterate_meta = false
#---- On supported devices allows to open book from cover page, rather than from beginning of the text
#---- Kindles do not support this mode, instead if annotation page creation was specified book will open on annotation page
# open_from_cover = false
#---- Insert soft hyphen symbols '\u00AD' inside words - for devices which do not support proper hyphenation
#---- Hyphenation dictionaries are from http://ctan.math.utah.edu/ctan/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/txt
#---- NOTE: modern day Kindles always have hyphenation on for Russian language (and off for English)
# insert_soft_hyphen = false
#---- When breaking sentences into words nbsp symbols are considered to be part of the word. This will replace all
#---- nbsp symbols with ordinary spaces, potentially breaking original formatting and changing hyphenation
# ignore_nonbreakable_space = false
#---- To generate epub page map we use very rough text processing, controlling approximate page size in Unicode code points
# characters_per_page = 2300
#---- Some devices (definitely Kobo) become very slow when epub XHTML content file becomes too big.
#---- When set program will split content into smaller files using number of pages (see characters_per_page).
#---- NOTE: does not respect original formatting, ignored when chapter_per_file set to "false"
# pages_per_file = 2147483647
#---- or you could specify subtitles on which chapter would be broken into smaller files. This setting is off by default - it has no default value.
#---- NOTE: it rarely makes sense to have both pages_per_file and chapter_subtitle_dividers active at the same time, ignored when chapter_per_file set to "false".
# chapter_subtitle_dividers = [ "* * *", "///" ]
#---- Do not skip images which cannot be decoded by program. Use them without any processing, allowing reader to decide what to do.
#---- Not a good idea in general - for example kindlegen will likely drop them anyways
# use_broken_images = false
[document.dropcaps]
#---- Allow dropcap styles
create = false
#---- Characters to ignore when styling dropcaps
ignore_symbols = "'\"-.…0123456789‒–—«»“”<>"
[document.annotation]
#---- Create separate "chapter" with book annotation if available
create = false
#---- And use provded annotation title
title = "Annotation"
#---- Show annotation in TOC
# add_to_toc = false
[document.notes]
#---- How to render notes in the book
#---- "default" - notes are links
#---- "inline" - note is shown "in-place" and could be styled via css
#---- "block" - notes are shown "in-place" at the paragraph end and could be styled via css
#---- "float" - pop up notes using "bi-directional links" method
#---- "float-old" - same as "float", pop up notes using "bi-directional links" method
#---- "float-new" - pop up notes using "preferred" method - HTML5 with <aside> recommended by Amazon publishing guidelines
#---- "float-new-more" - pop up notes using "preferred" method - HTML5 with <aside> recommended by Amazon publishing guidelines.
#---- Shows (…etc.) at the end of first paragraph of the note when note has more than one paragraph (Kindle shows
#---- only first paragraph in floating window)
mode = "default"
#---- Names of the <body> tags in fb2 document to consider for notes processing
body_names = [ "notes", "comments" ]
#---- Make sure that links in the content are named and numbered consistently
#---- NOTE: only works for pop up notes formatting (float, float-old, float-new)
renumber = false
#---- Pattern to format notes links when renumbering them
#---- "#body_number" - number of the body where note is located. If there is only one body with notes it will be empty
#---- "#number" - number of note in the body
#---- "#body_name" - either title of the body where note is located or body's name if there is no title
#---- "#body_name_Fl" - first letter of the #body_name exactly as it was encountered
#---- "#body_name_fl" - first letter of the #body_name lowercased
#---- "#body_name_FL" - first letter of the #body_name uppercased
link_format = "[{#body_number.}#number]"
[document.toc]
#---- Type of ncx TOC generated, depends on device support
#---- "normal" - TOC could have as many levels as possible
#---- "kindle" - TOC will have two levels for Kindle eInk support
#---- "flat" - TOC will have single level
type = "normal"
#---- Generate additional page with TOC (some devices may not support proper ncx TOC at all)
#---- "none" - do not generate it at all
#---- "before" - place it at the beginning of the book
#---- "after" - place it at the end of the book
page_placement = "after"
#---- Name of the TOC page in a book
# page_title = "Content"
#---- How many levels TOC page will have before flattening
# page_maxlevel = 2147483647
#---- Include chapter without title to TOC - this prevents empty TOC on "bad" books adding chapters without titles to the TOC
include_chapters_without_title = false
#---- When creating TOC page take book title and author(s) from meta info and not from first title of main body
# book_title_from_meta = false
[document.cover]
#---- Process cover images for any output format the same way we do it for Kindle formats: converting to jpeg and resizing
#---- it is set to true atomatically when "stk" is requested
# always_convert = false
#---- If book does not have cover image - use default one. For Amazon formats always true
# default = false
#---- Will be used as default cover image. If not specified - one will be provided by the program
# image_path = "default_cover.jpeg"
#---- Specify device screen size so cover image could be adjusted properly. It defaults to Oasis 2 (width = 1264, height = 1680)
width = 1264
height = 1680
#---- Specifies how to additionally process cover image.
#---- "none" - do nothing for non-Kindle formats, for Kindle if image height is less than specified above, resize to specified height keeping aspect ratio
#---- "keepAR" - unconditionally resize to specified height keeping aspect ratio
#---- "stretch" - unconditionally resize to specified width and height
resize = "none"
#---- Places stamp with title, author and book sequence on cover image (if default cover used - it always will be stamped)
#---- "none" - no stamping
#---- "top" - stamp at the top of cover
#---- "middle" - stamp in the middle of cover
#---- "bottom" - stamp at the bottom of cover
stamp_placement = "none"
#---- Font to use for stamping, if not specified program will use default
# stamp_font = "LinLibertine_RBah.ttf"
[document.transform]
#---- Additional text transformations, presently "direct speech normalization" and "dashes unification" are supported
#---- At the beginning of paragraph text starting with Unicode symbol included in "from" string possibly
#---- followed by any number of Unicode space symbols is replaced with "to" string
# [document.transform.speech]
# from = "‐‑−–—―"
# to = "— "
#---- In paragraphs any Unicode symbol included in "from" string, surrounded by Unicode spaces is replaced with
#---- first Unicode symbol from "to" string.
# [document.transform.dashes]
# from = "‐‑−–—―"
# to = "—"
#---- Vignette images could be specified for up to 6 levels of headers (h0 - h6) and "default"
#---- "none" has a special meaning suppressing particular vignette usage
[document.vignettes]
#---- Use vignette images
create = true
#---- "default" level images (for all non specified levels) and images for specific header levels ("h0" - "h6") are supported
#---- For any header to overwrite any image from "default" level use "none" keyword
[document.vignettes.images.default]
before_title = "profiles/vignettes/title_before.png"
after_title = "profiles/vignettes/title_after.png"
chapter_end = "profiles/vignettes/chapter_end.png"
[document.vignettes.images.h0]
before_title = "none"
after_title = "none"
chapter_end = "none"
#---- Data from this section only used when output is requested in Amazon's format: mobi or azw3
[document.kindlegen]
#---- Specifies exact location of platform specific Amazon kindlegen utility
#---- (to download visit "https://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211")
#---- If path is not absolute - it is assumed to be relative to program directory
#---- If not specified at all program will look for proper kindlegen the directory it is started from
# path = "linux/kindlegen"
#---- Kindlegen compression level
# compression_level = 1
#---- Kindlegen will produce verbose output (when debugging - always verbose)
verbose = false
#---- When producing mobi - do not touch it after kindlegen
# no_mobi_optimization = false
#---- If set to true "Personal label" will be removed from the resulting book producing "EBOK" document.
#---- Otherwise - "PDOC", default for kndlegen
remove_personal_label = true
#---- When producing azw3 - make sure that ASIN is set.
#---- Looks like this is important for "vocabulary builder" at least on eInk devices
# force_asin_on_azw3 = false
#---- depending on device Kindle expects APNX page map file in different places
#---- "none" - nothing will be generated
#---- "eink" - apnx will be located in .sbr directory
#---- "app" - apnx will be located alongside with converted file
generate_apnx = "none"
[sendtokindle]
#---- In case book sent successfully - delete it from disk
# delete_sent_book = false
#---- SMTP server parameters
# smtp_server = "smtp.gmail.com"
# smtp_port = 587
# smtp_user = "your mail user"
# smtp_password = "your mail password"
#---- Required by Amazon service
# from_mail = "address authorized by your Amazon account"
# to_mail = "mail address of your Kindle device"
#-----------------------------------------------------------------------------------------------------------------------------
#---- Sometimes external processors will need to overwrite some or all of book meta-data and or cover image. You could specify
#---- array of overwrites.
#----
#---- "name" specifies to which book overwrite is applicable, "*" means to all converted books, name could specify part of the
#---- file path (relative to source path), for example "aaa/bbb.fb2" will cause meta data for all "bbb.fb2" files found under
#---- "aaa" path converted during program run to be overwritten. Overwrites are always searched from most specific to less
#---- specific: "aaa/bbb.fb2", then "bbb.fb2", then "*". When first suitable overwrite is found - it will be used, no further
#---- search is performed.
#-----
#---- "meta" section could have any or all of following tags: "id", "language", "title", "genres", "authors", "sequence",
#---- "sequence_number", "date" and "cover_image", where genres and authors are arrays of strings and cover_image is a path
#---- to valid image. Additional "asin" tag (10 alphanumeric characters) could be used for kindle formats providing GoodReads
#---- integration on devices. If any of the tags are wrong (file does not exists or bad, sequence number is negative, etc.) -
#---- they will be dropped silently and no overwrite will be performed.
#-----------------------------------------------------------------------------------------------------------------------------
#[[overwrites]]
# name = "*"
# [overwrites.meta]
# id = "250ddd1e-86e8-41c0-a881-0e0c96c4da7c"
# asin = "B06XWTFSKH"
# language = "hu"
# title = "Global title"
# genres = ["sci_fy", "history"]
# authors = [
# { first_name = "First", last_name = "Author" },
# { first_name = "Second", last_name = "Author" }
# ]
# sequence = "Super Series"
# sequence_number = 666
# date = "1984"
# cover_image = "full_file_name" or "remove cover" if you want to completly remove cover image
#-----------------------------------------------------------------------------------------------------------------------------
#---- Windows only, support for MyHomeLib
#-----------------------------------------------------------------------------------------------------------------------------
#---- fb2mobi.exe or fb2epub.exe wrappers will search for fb2c.exe either in the directory they started from: "./fb2c.exe"
#---- or in "fb2converter" directory one level up in path hierarchy: "../fb2converter/fb2c.exe". They will check for
#---- existence of fb2mobi.toml or fb2epub.toml in the directory they are started from and if found will supply those files
#---- as configuration to fb2c.exe
[fb2mobi]
#---- NOTE: due to specifics of current MyHomeLib implementation there is no way to specify azw3 output format
#---- via command line to fb2mobi.exe. So in one and only case when fb2c is started indirectly using fb2mobi helper
#---- "convert" command line option "--to" will be ignored and value of "output_format" will be used instead
#---- If it is not specified here - "mobi" is assumed.
# output_format = "mobi"
[fb2epub]
#---- NOTE: due to specifics of current MyHomeLib implementation there is no way to specify kepub output format
#---- via command line to fb2epub.exe. So in one and only case when fb2c is started indirectly using fb2epub helper
#---- "convert" command line option "--to" will be ignored and value of "output_format" will be used instead
#---- If it is not specified here - "epub" is assumed.
# output_format = "epub"
#---- NOTE: due to specifics of current MyHomeLib implementation there is no way to activate SendToKindle
#---- via command line to fb2epub.exe. So in one and only case when fb2c is started indirectly using fb2epub helper
#---- "convert" command line option "--stk" will be ignored and value of "send_to_kindle" will be used instead
#---- If it is not specified here - "false" is assumed.
# send_to_kindle = false