txt2ebook 0.1.145__py3-none-any.whl → 0.1.147__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
txt2ebook/__init__.py CHANGED
@@ -38,7 +38,9 @@ def setup_logger(config: argparse.Namespace) -> None:
38
38
  return
39
39
 
40
40
  log_level = logging.DEBUG if config.debug else logging.INFO
41
- log_format = "%(levelname)5s: %(message)s" if config.debug else "%(message)s"
41
+ log_format = (
42
+ "%(levelname)5s: %(message)s" if config.debug else "%(message)s"
43
+ )
42
44
 
43
45
  logging.basicConfig(
44
46
  level=log_level,
@@ -48,7 +50,9 @@ def setup_logger(config: argparse.Namespace) -> None:
48
50
  )
49
51
 
50
52
 
51
- def log_or_raise_on_warning(message: str, raise_on_warning: bool = False) -> None:
53
+ def log_or_raise_on_warning(
54
+ message: str, raise_on_warning: bool = False
55
+ ) -> None:
52
56
  """Logs a warning message or raises an exception.
53
57
 
54
58
  Args:
txt2ebook/formats/base.py CHANGED
@@ -126,7 +126,9 @@ class BaseWriter(ABC):
126
126
  # do not create to output folder when we explicit set the output path
127
127
  # and file
128
128
  if self.config.output_file:
129
- return Path(file.parent, lower_underscore(file.stem)).with_suffix(extension)
129
+ return Path(file.parent, lower_underscore(file.stem)).with_suffix(
130
+ extension
131
+ )
130
132
 
131
133
  return Path(
132
134
  file.parent, self.config.output_folder, lower_underscore(file.stem)
@@ -139,7 +141,12 @@ class BaseWriter(ABC):
139
141
  self._("translator:") + ",".join(self.book.translators),
140
142
  self._("tag:") + ",".join(self.book.tags),
141
143
  ]
142
- return "---\n" + "\n".join(metadata) + "\n---" + self.config.paragraph_separator
144
+ return (
145
+ "---\n"
146
+ + "\n".join(metadata)
147
+ + "\n---"
148
+ + self.config.paragraph_separator
149
+ )
143
150
 
144
151
  def _to_toc(self, list_symbol, header_symbol="") -> str:
145
152
  toc = ""
txt2ebook/formats/epub.py CHANGED
@@ -81,7 +81,9 @@ class EpubWriter(BaseWriter):
81
81
  logger.debug("Create separate volume page: %s", section)
82
82
  book.toc.append((html_volume, html_chapters))
83
83
  else:
84
- book.toc.append((epub.Section(section.title), html_chapters))
84
+ book.toc.append(
85
+ (epub.Section(section.title), html_chapters)
86
+ )
85
87
 
86
88
  if isinstance(section, Chapter):
87
89
  html_chapter = self._build_chapter(section)
@@ -113,12 +115,16 @@ class EpubWriter(BaseWriter):
113
115
  book.add_item(book_css)
114
116
 
115
117
  nav = epub.EpubNav()
116
- nav.add_link(href="style/book.css", rel="stylesheet", type="text/css")
118
+ nav.add_link(
119
+ href="style/book.css", rel="stylesheet", type="text/css"
120
+ )
117
121
  book.add_item(nav)
118
122
  book.spine.append("nav")
119
123
 
120
124
  except FileNotFoundError as error:
121
- logger.error("Unknown EPUB template name: %s", self.config.epub_template)
125
+ logger.error(
126
+ "Unknown EPUB template name: %s", self.config.epub_template
127
+ )
122
128
  raise SystemExit() from error
123
129
 
124
130
  def _gen_id(self) -> str:
@@ -143,7 +149,9 @@ class EpubWriter(BaseWriter):
143
149
  lang=self.book.language,
144
150
  content=html,
145
151
  )
146
- cover.add_link(href="style/book.css", rel="stylesheet", type="text/css")
152
+ cover.add_link(
153
+ href="style/book.css", rel="stylesheet", type="text/css"
154
+ )
147
155
  return cover
148
156
 
149
157
  def _build_volume(self, volume: Volume) -> epub.EpubHtml:
@@ -166,7 +174,9 @@ class EpubWriter(BaseWriter):
166
174
  lang=self.book.language,
167
175
  content=html,
168
176
  )
169
- epub_html.add_link(href="style/book.css", rel="stylesheet", type="text/css")
177
+ epub_html.add_link(
178
+ href="style/book.css", rel="stylesheet", type="text/css"
179
+ )
170
180
 
171
181
  return epub_html
172
182
 
@@ -192,6 +202,8 @@ class EpubWriter(BaseWriter):
192
202
  lang=self.book.language,
193
203
  content=html,
194
204
  )
195
- epub_html.add_link(href="style/book.css", rel="stylesheet", type="text/css")
205
+ epub_html.add_link(
206
+ href="style/book.css", rel="stylesheet", type="text/css"
207
+ )
196
208
 
197
209
  return epub_html
txt2ebook/formats/gmi.py CHANGED
@@ -96,7 +96,9 @@ class GmiWriter(BaseWriter):
96
96
  export_filename.parent.mkdir(parents=True, exist_ok=True)
97
97
  logger.info("Creating %s", export_filename)
98
98
  with open(export_filename, "w", encoding="utf8") as file:
99
- file.write(self._to_volume_chapter_txt(section, chapter))
99
+ file.write(
100
+ self._to_volume_chapter_txt(section, chapter)
101
+ )
100
102
  ct_seq = ct_seq + 1
101
103
  if isinstance(section, Chapter):
102
104
  filename = lower_underscore(
@@ -145,7 +147,10 @@ class GmiWriter(BaseWriter):
145
147
  f"# {volume.title}"
146
148
  + self.config.paragraph_separator
147
149
  + self.config.paragraph_separator.join(
148
- [self._to_chapter_txt(chapter, True) for chapter in volume.chapters]
150
+ [
151
+ self._to_chapter_txt(chapter, True)
152
+ for chapter in volume.chapters
153
+ ]
149
154
  )
150
155
  )
151
156
 
txt2ebook/formats/md.py CHANGED
@@ -95,7 +95,9 @@ class MdWriter(BaseWriter):
95
95
  export_filename.parent.mkdir(parents=True, exist_ok=True)
96
96
  logger.info("Creating %s", export_filename)
97
97
  with open(export_filename, "w", encoding="utf8") as file:
98
- file.write(self._to_volume_chapter_txt(section, chapter))
98
+ file.write(
99
+ self._to_volume_chapter_txt(section, chapter)
100
+ )
99
101
  ct_seq = ct_seq + 1
100
102
  if isinstance(section, Chapter):
101
103
  filename = lower_underscore(
@@ -144,7 +146,10 @@ class MdWriter(BaseWriter):
144
146
  f"# {volume.title}"
145
147
  + self.config.paragraph_separator
146
148
  + self.config.paragraph_separator.join(
147
- [self._to_chapter_txt(chapter, True) for chapter in volume.chapters]
149
+ [
150
+ self._to_chapter_txt(chapter, True)
151
+ for chapter in volume.chapters
152
+ ]
148
153
  )
149
154
  )
150
155
 
txt2ebook/formats/pdf.py CHANGED
@@ -153,7 +153,9 @@ class PdfWriter(BaseWriter):
153
153
  canvas.restoreState()
154
154
 
155
155
  def _get_pagesize(self) -> Tuple:
156
- page_size = self.config.page_size or self.langconf.DEFAULT_PDF_PAGE_SIZE
156
+ page_size = (
157
+ self.config.page_size or self.langconf.DEFAULT_PDF_PAGE_SIZE
158
+ )
157
159
  return portrait(getattr(reportlab.lib.pagesizes, page_size.upper()))
158
160
 
159
161
  def _init_styles(self) -> None:
txt2ebook/formats/tex.py CHANGED
@@ -100,7 +100,9 @@ class TexWriter(BaseWriter):
100
100
  doc.append(NoEsc(r"\maketitle"))
101
101
  doc.append(NoEsc(r"\thispagestyle{empty}"))
102
102
  doc.append(NoEsc(r"\addtocontents{toc}{\protect\pagestyle{empty}}"))
103
- doc.append(NoEsc(r"\addtocontents{toc}{\protect\thispagestyle{empty}}"))
103
+ doc.append(
104
+ NoEsc(r"\addtocontents{toc}{\protect\thispagestyle{empty}}")
105
+ )
104
106
  doc.append(NoEsc(r"\tableofcontents"))
105
107
  doc.append(NoEsc(r"\pagestyle{empty}"))
106
108
  doc.append(NoEsc(r"\cleardoublepage"))
@@ -126,7 +128,9 @@ class TexWriter(BaseWriter):
126
128
 
127
129
  filename = str(new_filename.parent / new_filename.stem)
128
130
  pdf_filename = Path(filename).with_suffix(".pdf")
129
- doc.generate_pdf(filename, compiler="latexmk", clean_tex=self.config.clean_tex)
131
+ doc.generate_pdf(
132
+ filename, compiler="latexmk", clean_tex=self.config.clean_tex
133
+ )
130
134
  logger.info("Generate PDF file: %s", pdf_filename.resolve())
131
135
 
132
136
  if self.config.open:
txt2ebook/formats/txt.py CHANGED
@@ -105,7 +105,9 @@ class TxtWriter(BaseWriter):
105
105
  export_filename.parent.mkdir(parents=True, exist_ok=True)
106
106
  logger.info("Creating %s", export_filename)
107
107
  with open(export_filename, "w", encoding="utf8") as file:
108
- file.write(self._to_volume_chapter_txt(section, chapter))
108
+ file.write(
109
+ self._to_volume_chapter_txt(section, chapter)
110
+ )
109
111
  ct_seq = ct_seq + 1
110
112
  if isinstance(section, Chapter):
111
113
  filename = lower_underscore(
@@ -132,7 +134,9 @@ class TxtWriter(BaseWriter):
132
134
  ymd_hms = dt.now().strftime("%Y%m%d_%H%M%S")
133
135
  new_filename = Path(
134
136
  txt_filename.resolve().parent.joinpath(
135
- lower_underscore(txt_filename.stem + "_" + ymd_hms + ".txt")
137
+ lower_underscore(
138
+ txt_filename.stem + "_" + ymd_hms + ".txt"
139
+ )
136
140
  )
137
141
  )
138
142
 
txt2ebook/formats/typ.py CHANGED
@@ -175,7 +175,10 @@ class TypWriter(BaseWriter):
175
175
  f"= {volume.title}"
176
176
  + self.config.paragraph_separator
177
177
  + self.config.paragraph_separator.join(
178
- [self._to_chapter_txt(chapter, True) for chapter in volume.chapters]
178
+ [
179
+ self._to_chapter_txt(chapter, True)
180
+ for chapter in volume.chapters
181
+ ]
179
182
  )
180
183
  )
181
184
 
txt2ebook/languages/en.py CHANGED
@@ -17,7 +17,8 @@
17
17
 
18
18
  DEFAULT_RE_TITLE = r"Title:(.*)"
19
19
  DEFAULT_RE_AUTHOR = r"Author:(.*)"
20
- DEFAULT_RE_TAG = r"Tags(.*)"
21
- DEFAULT_RE_INDEX = r"Index(.*)"
20
+ DEFAULT_RE_TAG = r"Tags:(.*)"
21
+ DEFAULT_RE_INDEX = r"Index:(.*)"
22
22
  DEFAULT_RE_VOLUME = r"(Volume.*)"
23
23
  DEFAULT_RE_CHAPTER = r"(Chapter.*)"
24
+ DEFAULT_RE_TRANSLATOR = r"Translator:(.*)"
txt2ebook/models/book.py CHANGED
@@ -60,7 +60,9 @@ class Book:
60
60
  try:
61
61
  return format_options[filename_format]
62
62
  except KeyError:
63
- raise AttributeError(f"Invalid filename format: '{filename_format}'!")
63
+ raise AttributeError(
64
+ f"Invalid filename format: '{filename_format}'!"
65
+ )
64
66
 
65
67
  def debug(self, verbosity: int = 1) -> None:
66
68
  """Dump debug log of sections in self.toc."""
txt2ebook/parser.py CHANGED
@@ -57,8 +57,8 @@ class Parser:
57
57
  """
58
58
  tokenizer = Tokenizer(self.raw_content, self.config)
59
59
 
60
- (book_title, authors, translators, tags, index, toc) = self.parse_tokens(
61
- tokenizer
60
+ (book_title, authors, translators, tags, index, toc) = (
61
+ self.parse_tokens(tokenizer)
62
62
  )
63
63
 
64
64
  book = Book(
@@ -103,13 +103,17 @@ class Parser:
103
103
  match = re.match(rf"第([{self.langconf.HALFWIDTH_NUMS}]*)", words)
104
104
  if match and match.group(1) != "":
105
105
  header_nums = match.group(1)
106
- return words.replace(header_nums, str(header_nums).rjust(length, "0"))
106
+ return words.replace(
107
+ header_nums, str(header_nums).rjust(length, "0")
108
+ )
107
109
 
108
110
  # left pad the section number if found as fullwidth integer
109
111
  match = re.match(rf"第([{self.langconf.FULLWIDTH_NUMS}]*)", words)
110
112
  if match and match.group(1) != "":
111
113
  header_nums = match.group(1)
112
- return words.replace(header_nums, str(header_nums).rjust(length, "0"))
114
+ return words.replace(
115
+ header_nums, str(header_nums).rjust(length, "0")
116
+ )
113
117
 
114
118
  replaced_words = zh_words_to_numbers(words, length=length)
115
119
 
@@ -148,7 +152,8 @@ class Parser:
148
152
  if (
149
153
  token.type not in ["CHAPTER", "PARAGRAPH"]
150
154
  or (
151
- token.type == "CHAPTER" and self.config.verbose >= chapter_verbosity
155
+ token.type == "CHAPTER"
156
+ and self.config.verbose >= chapter_verbosity
152
157
  )
153
158
  or (
154
159
  token.type == "PARAGRAPH"
@@ -24,7 +24,8 @@ def build_subparser(subparsers):
24
24
  iter_namespace = pkgutil.iter_modules(__path__, __name__ + ".")
25
25
 
26
26
  subcommands = {
27
- name: importlib.import_module(name) for finder, name, ispkg in iter_namespace
27
+ name: importlib.import_module(name)
28
+ for finder, name, ispkg in iter_namespace
28
29
  }
29
30
 
30
31
  for subcommand in subcommands.values():
@@ -27,7 +27,9 @@ logger = logging.getLogger(__name__)
27
27
 
28
28
  def build_subparser(subparsers) -> None:
29
29
  """Build the subparser."""
30
- gmi_parser = subparsers.add_parser("gmi", help="generate ebook in Gemtext format")
30
+ gmi_parser = subparsers.add_parser(
31
+ "gmi", help="generate ebook in Gemtext format"
32
+ )
31
33
 
32
34
  gmi_parser.set_defaults(func=run)
33
35
 
@@ -19,6 +19,7 @@ import argparse
19
19
  import logging
20
20
  import sys
21
21
  from importlib import import_module
22
+ from pathlib import Path
22
23
 
23
24
  import cjkwrap
24
25
  import regex as re
@@ -201,21 +202,48 @@ def run(args: argparse.Namespace) -> None:
201
202
  None
202
203
  """
203
204
  massaged_txt = massage_txt(args)
204
- args.language = detect_and_expect_language(massaged_txt, args.language)
205
- config_lang = args.language.replace("-", "_")
206
- langconf = import_module(f"txt2ebook.languages.{config_lang}")
207
- args.with_toc = False
208
- parser = Parser(massaged_txt, args, langconf)
209
- book = parser.parse()
205
+ if args.overwrite:
206
+ _overwrite_file(args, massaged_txt)
207
+ else:
208
+ _new_file(args, massaged_txt)
209
+
210
+ # args.language = detect_and_expect_language(massaged_txt, args.language)
211
+ # config_lang = args.language.replace("-", "_")
212
+ # langconf = import_module(f"txt2ebook.languages.{config_lang}")
213
+ # args.with_toc = False
214
+ # parser = Parser(massaged_txt, args, langconf)
215
+ # book = parser.parse()
216
+
217
+ # if args.debug:
218
+ # book.debug(args.verbose)
219
+
220
+ # if args.header_number:
221
+ # book = header_number(args, book)
222
+
223
+ # writer = TxtWriter(book, args)
224
+ # writer.write()
225
+
210
226
 
211
- if args.debug:
212
- book.debug(args.verbose)
227
+ def _overwrite_file(args, massaged_txt) -> None:
228
+ txt_filename = Path(args.input_file.name)
213
229
 
214
- if args.header_number:
215
- book = header_number(args, book)
230
+ with open(txt_filename, "w", encoding="utf8") as file:
231
+ file.write(massaged_txt)
232
+ logger.info("Overwrite txt file: %s", txt_filename.resolve())
216
233
 
217
- writer = TxtWriter(book, args)
218
- writer.write()
234
+
235
+ def _new_file(args, massaged_txt) -> None:
236
+ txt_filename = Path(args.input_file.name)
237
+ export_filename = Path(
238
+ txt_filename.resolve().parent.joinpath(
239
+ args.output_folder, txt_filename.name
240
+ )
241
+ )
242
+ export_filename.parent.mkdir(parents=True, exist_ok=True)
243
+
244
+ with open(export_filename, "w", encoding="utf8") as file:
245
+ file.write(massaged_txt)
246
+ logger.info("New txt file: %s", export_filename.resolve())
219
247
 
220
248
 
221
249
  def header_number(args: argparse.Namespace, book: Book) -> Book:
@@ -230,7 +258,9 @@ def header_number(args: argparse.Namespace, book: Book) -> Book:
230
258
  for toc_item in book.toc:
231
259
  toc_type = type(toc_item).__name__
232
260
  if toc_type in seq_lengths:
233
- toc_item.title = words_to_nums(args, toc_item.title, seq_lengths[toc_type])
261
+ toc_item.title = words_to_nums(
262
+ args, toc_item.title, seq_lengths[toc_type]
263
+ )
234
264
 
235
265
  return book
236
266
 
@@ -337,7 +367,9 @@ def do_delete_regex(args, content: str) -> str:
337
367
  str: The formatted book content.
338
368
  """
339
369
  for delete_regex in args.re_delete:
340
- content = re.sub(re.compile(rf"{delete_regex}", re.MULTILINE), "", content)
370
+ content = re.sub(
371
+ re.compile(rf"{delete_regex}", re.MULTILINE), "", content
372
+ )
341
373
  return content
342
374
 
343
375
 
@@ -27,7 +27,9 @@ logger = logging.getLogger(__name__)
27
27
 
28
28
  def build_subparser(subparsers) -> None:
29
29
  """Build the subparser."""
30
- md_parser = subparsers.add_parser("md", help="generate ebook in Markdown format")
30
+ md_parser = subparsers.add_parser(
31
+ "md", help="generate ebook in Markdown format"
32
+ )
31
33
 
32
34
  md_parser.set_defaults(func=run)
33
35
 
@@ -28,7 +28,9 @@ logger = logging.getLogger(__name__)
28
28
 
29
29
  def build_subparser(subparsers) -> None:
30
30
  """Build the subparser."""
31
- pdf_parser = subparsers.add_parser("pdf", help="generate ebook in Markdown format")
31
+ pdf_parser = subparsers.add_parser(
32
+ "pdf", help="generate ebook in Markdown format"
33
+ )
32
34
 
33
35
  pdf_parser.set_defaults(func=run)
34
36
 
@@ -27,7 +27,9 @@ logger = logging.getLogger(__name__)
27
27
 
28
28
  def build_subparser(subparsers) -> None:
29
29
  """Build the subparser."""
30
- tex_parser = subparsers.add_parser("tex", help="generate ebook in TeX/PDF format")
30
+ tex_parser = subparsers.add_parser(
31
+ "tex", help="generate ebook in TeX/PDF format"
32
+ )
31
33
 
32
34
  tex_parser.add_argument(
33
35
  "input_file",
@@ -28,7 +28,9 @@ logger = logging.getLogger(__name__)
28
28
 
29
29
  def build_subparser(subparsers) -> None:
30
30
  """Build the subparser."""
31
- typ_parser = subparsers.add_parser("typ", help="generate ebook in Typst format")
31
+ typ_parser = subparsers.add_parser(
32
+ "typ", help="generate ebook in Typst format"
33
+ )
32
34
 
33
35
  typ_parser.set_defaults(func=run)
34
36
 
txt2ebook/tokenizer.py CHANGED
@@ -134,7 +134,9 @@ class Tokenizer:
134
134
  match = re.search(regex, line)
135
135
  if match:
136
136
  token_value = match.group(1).strip()
137
- token = Token(token_type, token_value, self._lineno(token_value))
137
+ token = Token(
138
+ token_type, token_value, self._lineno(token_value)
139
+ )
138
140
  self.tokens.append(token)
139
141
 
140
142
  def _extract_metadata(self) -> List:
@@ -172,7 +174,9 @@ class Tokenizer:
172
174
  metadata_block_re = (
173
175
  rf"^(?:{self.metadata_marker})\n(.*)\n(?:{self.metadata_marker})$"
174
176
  )
175
- match = re.search(metadata_block_re, self.raw_content, re.MULTILINE | re.DOTALL)
177
+ match = re.search(
178
+ metadata_block_re, self.raw_content, re.MULTILINE | re.DOTALL
179
+ )
176
180
 
177
181
  if match:
178
182
  # Content starts after the matched metadata block
@@ -217,7 +221,10 @@ class Tokenizer:
217
221
  rf"^{self.langconf.DEFAULT_RE_VOLUME}\s*"
218
222
  rf"{self.langconf.DEFAULT_RE_CHAPTER}"
219
223
  )
220
- if hasattr(self.config, "re_volume_chapter") and self.config.re_volume_chapter:
224
+ if (
225
+ hasattr(self.config, "re_volume_chapter")
226
+ and self.config.re_volume_chapter
227
+ ):
221
228
  re_volume_chapter = self.config.re_volume_chapter[0]
222
229
 
223
230
  match = re.search(re_volume_chapter, line)
txt2ebook/zh_utils.py CHANGED
@@ -121,7 +121,10 @@ def zh_words_to_numbers(words: str, **kwargs: Any) -> str:
121
121
  for word_grp in re.findall("..?", found_word):
122
122
  if len(word_grp) == 2:
123
123
  # 零 or 十
124
- if zh_numeric(word_grp[0]) == 0.0 or zh_numeric(word_grp[0]) == 10.0:
124
+ if (
125
+ zh_numeric(word_grp[0]) == 0.0
126
+ or zh_numeric(word_grp[0]) == 10.0
127
+ ):
125
128
  header_nums += int(
126
129
  zh_numeric(word_grp[0]) + zh_numeric(word_grp[1])
127
130
  )
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: txt2ebook
3
- Version: 0.1.145
3
+ Version: 0.1.147
4
4
  Summary: CLI tool to convert txt file to ebook format
5
5
  Project-URL: Homepage, https://github.com/kianmeng/txt2ebook
6
6
  Project-URL: Repository, https://github.com/kianmeng/txt2ebook
7
7
  Author-email: Kian-Meng Ang <kianmeng@cpan.org>
8
8
  License-Expression: AGPL-3.0-or-later
9
9
  License-File: LICENSE.md
10
- Keywords: cjk,ebook,epub,txt
10
+ Keywords: cjk,ebook,epub,gmi,latex,md,pdf,txt,typst
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Environment :: Console
13
13
  Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
@@ -50,19 +50,13 @@ A console tool to convert txt file to different ebook formats.
50
50
  Stable version From PyPI:
51
51
 
52
52
  ```console
53
- python3 -m pip install txt2ebook
53
+ uv tool install txt2ebook
54
54
  ```
55
55
 
56
56
  Upgrade to latest stable version:
57
57
 
58
58
  ```console
59
- python3 -m pip install txt2ebook --upgrade
60
- ```
61
-
62
- Latest development version from GitHub:
63
-
64
- ```console
65
- python3 -m pip install -e git+https://github.com/kianmeng/txt2ebook.git
59
+ uv tool upgrade txt2ebook
66
60
  ```
67
61
 
68
62
  ## Usage
@@ -108,12 +102,12 @@ positional arguments:
108
102
  typ
109
103
  generate ebook in Typst format
110
104
 
111
- optional arguments:
112
- -of OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER
105
+ options:
106
+ -of, --output-folder OUTPUT_FOLDER
113
107
  set default output folder (default: 'output')
114
108
  -p, --purge
115
109
  remove converted ebooks specified by --output-folder option (default: 'False')
116
- -l LANGUAGE, --language LANGUAGE
110
+ -l, --language LANGUAGE
117
111
  language of the ebook (default: 'None')
118
112
  -rw, --raise-on-warning
119
113
  raise exception and stop parsing upon warning
@@ -1,19 +1,19 @@
1
- txt2ebook/__init__.py,sha256=ZGn_FN2OfUH6PmcgBW4qT0rialjwa3Knk0kRbjxGVdA,3033
1
+ txt2ebook/__init__.py,sha256=Oq0Yor9IB6LPfAsVVTl-wbh-EFVy8T309BR1UVMC0kw,3055
2
2
  txt2ebook/__main__.py,sha256=L29rlfPSx9XMnVaHBYP2dyYgDmutJvONR3yUejjYwRY,855
3
3
  txt2ebook/cli.py,sha256=i8NrYJyC9ckMC5opCGkIcs42p4AFzhE0lTGKSU-S8Zw,4418
4
4
  txt2ebook/exceptions.py,sha256=PT3m85PE5QopHHUfRwEQzp0kJ4AA9yjLO6V6lYC8WhQ,858
5
- txt2ebook/parser.py,sha256=WT5fl616xNYvilOq2PyumRAKm_eE6R3oW5eH_dOS_JY,8886
6
- txt2ebook/tokenizer.py,sha256=R-L6RiHYj8ARTwO3Pa402qDdKE_fudJHRFYU9FWfj_g,10195
7
- txt2ebook/zh_utils.py,sha256=I_dtRQAhd6Jmorcl8OjaNQ__nfBBmrOLWzyhAIAfMsg,4827
5
+ txt2ebook/parser.py,sha256=ITn6pGHO4vTfdrYouVV2mEe9jUM2zm3-FKEcspp2qzI,8968
6
+ txt2ebook/tokenizer.py,sha256=UGyOBGxlKOXJtvP2UFp38EgFym8-PAU3A7Jl9RF3w6Y,10299
7
+ txt2ebook/zh_utils.py,sha256=0Yq9r-JL4HntW68vFR6TBP9yQim1a07mfsh_sp-XmaE,4887
8
8
  txt2ebook/formats/__init__.py,sha256=_fW9UuoOTFxCKlej6t-PsFzJOqDFLzVatCci9tcPQeE,1645
9
- txt2ebook/formats/base.py,sha256=23CNXjYopq3gRMTMRrNfIZimrvOOmfsJDjr2zqNJFy4,5706
10
- txt2ebook/formats/epub.py,sha256=a4SLQkxvtovFlsL2KK_9ECqRuANARlIE0h5QtQlCYGU,6769
11
- txt2ebook/formats/gmi.py,sha256=6_kZFuQFidb0kgPHRrVaMqjp-0wVee1zNf2Fn3b1G64,6550
12
- txt2ebook/formats/md.py,sha256=MR9e5y-CiEolwUpkrnXr24rItzH_CWTOrg7ptN89iuM,6296
13
- txt2ebook/formats/pdf.py,sha256=RwjebgqPbTg9SjOh3rtjzfKPq9L74842zeUbNSvrvgc,7239
14
- txt2ebook/formats/tex.py,sha256=U2Z4C89_PT_haET-3Pb9XkgzstEdf_WKbY33QCGBczY,5853
15
- txt2ebook/formats/txt.py,sha256=_NdWy1IC84wGBNiSpFZy3XgeXbzT-PwWXqodYwaf5Xo,7312
16
- txt2ebook/formats/typ.py,sha256=o1RTciNmJhSgd2QGJtc8Zd5dFM0pnCbfU9dLjqMo-1k,6647
9
+ txt2ebook/formats/base.py,sha256=xUrLOPlJyV_8tSIbBzrbBe3fP481CuHYSdOUSdtxeik,5796
10
+ txt2ebook/formats/epub.py,sha256=IVz-FmYQlcChOw38YqfKy46bPVSIrHyxA_94iz06N3Y,6941
11
+ txt2ebook/formats/gmi.py,sha256=k9PY6tcXf1aXrW3ZGo-0nvt1PDS1LoG5i31hze5oYqM,6662
12
+ txt2ebook/formats/md.py,sha256=BzT3jsSYZR7rx9Lxuu1DvxCWQutSmMzoab8huKvxaxE,6408
13
+ txt2ebook/formats/pdf.py,sha256=tr_ozVlL976yo7Ggny71zjOwzSd6tSnHTl7mcsLII_g,7263
14
+ txt2ebook/formats/tex.py,sha256=V5B1nPR-WzGc4jqWu-BqxfQhtQsUTKM_sZZJsCcDBAk,5897
15
+ txt2ebook/formats/txt.py,sha256=0DOVBTDRV2gcixham5Wj7NaZlNKAeLG9MLRlZgtUxqM,7412
16
+ txt2ebook/formats/typ.py,sha256=MNclD5RdCnYAmPRzAaI6ZE6NnI8GdHKJla54wyfTUdc,6705
17
17
  txt2ebook/formats/templates/__init__.py,sha256=f3K7pJByNmmvu-wvziks6qb2QnnLmkDjUACXyw2s60E,760
18
18
  txt2ebook/formats/templates/epub/__init__.py,sha256=-XVLvnknTJTmQZY9UTH705vMcHgy56rQVRTusYawEZ4,766
19
19
  txt2ebook/formats/templates/epub/clean.css,sha256=AnEwMckzUSKcjKsDiWtJW1oaceuklt2tyuS1VbpVK1s,462
@@ -21,7 +21,7 @@ txt2ebook/formats/templates/epub/condense.css,sha256=Fz80ZqkPsFRmGdURduAxqMV8drD
21
21
  txt2ebook/formats/templates/epub/noindent.css,sha256=_O5Tv90TKyyPBRdgjuNKFwtKFbdheh2V9PtDhgRUg3U,483
22
22
  txt2ebook/helpers/__init__.py,sha256=c2EItHvPABDORfgfjArfa5XR--43es4D1tKWqaPcBxY,1309
23
23
  txt2ebook/languages/__init__.py,sha256=1AfDn-D0q-dvODGP-9KxPHY_Wtk-ifZdN1FutZMT9-Q,763
24
- txt2ebook/languages/en.py,sha256=e5VzZwfrO2kABMwEB0l--eo4XbOre6f6uJ-ySU3ORT8,960
24
+ txt2ebook/languages/en.py,sha256=8qsmbKB69M3SD9nBnSX8rP8hAL_RFkhB-zyH93INgaQ,999
25
25
  txt2ebook/languages/zh_cn.py,sha256=lcbgPFO4Uaog8sKHKF5fQtvRwkKiQ3v5wMvYNEvNk9k,1943
26
26
  txt2ebook/languages/zh_tw.py,sha256=_fdXOOSLK0nTMuBe1Om2qjb4zr2PVd6N4xi2rrYkNTI,1515
27
27
  txt2ebook/locales/txt2ebook.pot,sha256=mAbxkYqivFTrRmmo412Um3ZcvIS_yGiG7zxE3MCRavU,641
@@ -32,21 +32,21 @@ txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po,sha256=1CDj15DzFqpcUMYnZGsRlHiX
32
32
  txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo,sha256=1GIuOcO_bISiFcfhFez-A7mSi11Mo-x3PBobBENgMEc,675
33
33
  txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po,sha256=QSB2qrYJJUnY1S80uQi4wNchOLxsAtkYAKwR1JUw23I,698
34
34
  txt2ebook/models/__init__.py,sha256=Z3zClWLj08Q8HgaWV1RRgIKatEhIUfYBAVWm-j4m05w,930
35
- txt2ebook/models/book.py,sha256=kJToU9uHElNons_6TTjkPtlQ70TTWQx1wo_sQFoANZY,2700
35
+ txt2ebook/models/book.py,sha256=P-SQabvrRgWoafrk0tw6zjD-3hq_r8_jGvgTORUS-DM,2730
36
36
  txt2ebook/models/chapter.py,sha256=6YvUDHzR6amGMZgkQl_xHWrYZUmlfpF7mnDLilG2BpA,1686
37
37
  txt2ebook/models/volume.py,sha256=koz1KfWjvGWLFbmGEQlZ23frsP93cDsuBMySYBHiXm8,1597
38
- txt2ebook/subcommands/__init__.py,sha256=1O_yTOheT9QwYarGl-zqFsVtcYveL4R9EztEeSFe0h8,1138
38
+ txt2ebook/subcommands/__init__.py,sha256=ldhzvsrMsR8lZmhZef77JFz0jValpV3pytFfwJSkjls,1146
39
39
  txt2ebook/subcommands/env.py,sha256=gEzra4b6guy7pRZUTCWX1_eiR7JmrtR1Z-J-vxljvMY,1549
40
40
  txt2ebook/subcommands/epub.py,sha256=_obM1_fvVBPHOBXBOCYK8nyJadBX3_gOn9kaXA5HipA,3570
41
- txt2ebook/subcommands/gmi.py,sha256=TUHoQ05q3TofYDRBAcXaDtqFWbqV0VcJHzFfGYKbqYs,3304
42
- txt2ebook/subcommands/massage.py,sha256=BYshlwCgAr9CWK0OgtRafgIm5O5_5egwF25Z2SUVhSU,11884
43
- txt2ebook/subcommands/md.py,sha256=hwb65z95NTSLAz87FJI7ZLB3du1pBx3A4FlF2UD2xio,3315
41
+ txt2ebook/subcommands/gmi.py,sha256=ANnPg-RFsylTo44fUzFOSHN1fC3Ce82gBzrv-sBv5fU,3318
42
+ txt2ebook/subcommands/massage.py,sha256=DS1jFEYylLf7z-r8tNDU_2aRETBlgj2xtQT8k1mvAv8,12819
43
+ txt2ebook/subcommands/md.py,sha256=PmIqrqrnzLywvN4qTkle0V9N3FTIJGRWpC0Xbk76B5o,3329
44
44
  txt2ebook/subcommands/parse.py,sha256=tdWqssFsg70GSgz4S2YoaERydt3zQ5Sq1rLtkvB-WQU,2902
45
- txt2ebook/subcommands/pdf.py,sha256=-DjeMmRKPZoTg8WZfNc028ZaZZ3xLCSAdnZDZFtCsbI,2966
46
- txt2ebook/subcommands/tex.py,sha256=4Wk_-l3UzuJYck0oWkRaKXVrf05jkGTJiyc7YORwMK0,3117
47
- txt2ebook/subcommands/typ.py,sha256=qCbaGFP5n6yJ-P6biXw2JHhjiYk3emOpthoSf9XWhOY,3667
48
- txt2ebook-0.1.145.dist-info/METADATA,sha256=zhreNz6L2jLyO99etM8D4BRY2VtfbrGHKSTGNtxqBWg,4901
49
- txt2ebook-0.1.145.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
50
- txt2ebook-0.1.145.dist-info/entry_points.txt,sha256=3jm5vpUsDRgoM6S3CQVMMiP7tJQqfq1vfV0sh_KaK9s,74
51
- txt2ebook-0.1.145.dist-info/licenses/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
52
- txt2ebook-0.1.145.dist-info/RECORD,,
45
+ txt2ebook/subcommands/pdf.py,sha256=1JQtpugzAIaho6G3CK1rGYk74hotAexXZxPH9PHpRps,2980
46
+ txt2ebook/subcommands/tex.py,sha256=ToYdFXnFLwsXxTsZzCRsURo7TCeOIFJtp5sFJDt0R-E,3131
47
+ txt2ebook/subcommands/typ.py,sha256=qXpHMmtu_1nAMs264oKUSolWAUBjZpTziTSBcTe2JgA,3681
48
+ txt2ebook-0.1.147.dist-info/METADATA,sha256=InAyTbRMSvYqH_AA0-h9hO6OWyIXnoIeFJ07jZwwD4c,4737
49
+ txt2ebook-0.1.147.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
50
+ txt2ebook-0.1.147.dist-info/entry_points.txt,sha256=3jm5vpUsDRgoM6S3CQVMMiP7tJQqfq1vfV0sh_KaK9s,74
51
+ txt2ebook-0.1.147.dist-info/licenses/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
52
+ txt2ebook-0.1.147.dist-info/RECORD,,