txt2ebook 0.1.83__py3-none-any.whl → 0.1.86__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
@@ -22,7 +22,7 @@ import sys
22
22
 
23
23
  logger = logging.getLogger(__name__)
24
24
 
25
- __version__ = "0.1.83"
25
+ __version__ = "0.1.86"
26
26
 
27
27
 
28
28
  def setup_logger(config: argparse.Namespace) -> None:
txt2ebook/formats/tex.py CHANGED
@@ -26,8 +26,7 @@ from pylatex import Document as Doc
26
26
  from pylatex import NoEscape as NoEsc
27
27
  from pylatex import Package as Pkg
28
28
  from pylatex.section import Chapter as Chap
29
- from pylatex.section import Paragraph as Par
30
- from pylatex.section import Part as Part
29
+ from pylatex.section import Part
31
30
 
32
31
  from txt2ebook.formats.base import BaseWriter
33
32
  from txt2ebook.models import Chapter, Volume
@@ -53,6 +52,35 @@ class TexWriter(BaseWriter):
53
52
  doc = Doc(documentclass="ctexbook", document_options=[self._fontset()])
54
53
 
55
54
  doc.packages.append(Pkg("geometry", options=["a6paper"]))
55
+ doc.packages.append(Pkg("makeidx"))
56
+ doc.packages.append(
57
+ Pkg(
58
+ "idxlayout",
59
+ options=[
60
+ "columns=1",
61
+ "font=footnotesize",
62
+ "itemlayout=singlepar",
63
+ "indentunit=0pt",
64
+ ],
65
+ )
66
+ )
67
+ doc.packages.append(
68
+ Pkg("hyperref", options=["colorlinks=true", "linktocpage=true"])
69
+ )
70
+
71
+ doc.packages.append(Pkg("tocloft", options=["titles"]))
72
+ tocloft = NoEsc(
73
+ r"""
74
+ \renewcommand{\cftbeforepartskip}{1em}
75
+ \renewcommand{\cftbeforechapskip}{0em}
76
+ \renewcommand{\cftpartfont}{\normalfont\bfseries}
77
+ \renewcommand{\cftchapfont}{\normalfont}
78
+ \renewcommand{\cftchapleader}{\dotfill}
79
+ \renewcommand{\cftpartpagefont}{\small\bfseries}
80
+ \renewcommand{\cftchappagefont}{\small\bfseries}
81
+ """
82
+ )
83
+ doc.preamble.append(tocloft)
56
84
 
57
85
  hide_section_seq = (
58
86
  r"chapter/name={},chapter/number={},part/name={},part/number={}"
@@ -60,36 +88,63 @@ class TexWriter(BaseWriter):
60
88
  doc.preamble.append(Cmd("ctexset", NoEsc(hide_section_seq)))
61
89
  doc.preamble.append(Cmd("title", self.book.title))
62
90
  doc.preamble.append(Cmd("author", ", ".join(self.book.authors)))
63
- doc.preamble.append(Cmd("date", NoEsc(r"\today")))
91
+ doc.preamble.append(NoEsc(r"\date{}"))
92
+ doc.preamble.append(Cmd("makeindex"))
64
93
 
65
94
  doc.append(NoEsc(r"\maketitle"))
66
95
  doc.append(NoEsc(r"\thispagestyle{empty}"))
96
+ doc.append(NoEsc(r"\addtocontents{toc}{\protect\pagestyle{empty}}"))
97
+ doc.append(
98
+ NoEsc(r"\addtocontents{toc}{\protect\thispagestyle{empty}}")
99
+ )
100
+ doc.append(NoEsc(r"\tableofcontents"))
101
+ doc.append(NoEsc(r"\pagestyle{empty}"))
102
+ doc.append(NoEsc(r"\cleardoublepage"))
103
+ doc.append(NoEsc(r"\pagenumbering{arabic}"))
104
+ doc.append(NoEsc(r"\pagestyle{headings}"))
67
105
 
68
106
  for section in self.book.toc:
69
107
  if isinstance(section, Volume):
70
- with doc.create(Part(section.title)):
108
+ with doc.create(Part(section.title, label=False)):
71
109
  for chapter in section.chapters:
72
- with doc.create(Chap(chapter.title)):
110
+ with doc.create(Chap(chapter.title, label=False)):
73
111
  for paragraph in chapter.paragraphs:
74
- doc.append(Par(paragraph.replace("\n", "")))
112
+ par = self._process_paragraph(paragraph)
113
+ doc.append(NoEsc(rf"\par{{{par}}}"))
114
+
75
115
  if isinstance(section, Chapter):
76
- with doc.create(Chap(section.title)):
116
+ with doc.create(Chap(section.title, label=False)):
77
117
  for paragraph in section.paragraphs:
78
- doc.append(Par(paragraph.replace("\n", "")))
118
+ par = self._process_paragraph(paragraph)
119
+ doc.append(NoEsc(rf"\par{{{par}}}"))
120
+
121
+ doc.append(Cmd("printindex"))
79
122
 
80
123
  filename = str(new_filename.parent / new_filename.stem)
81
124
  pdf_filename = Path(filename).with_suffix(".pdf")
82
- doc.generate_pdf(filename, compiler="xelatex", clean_tex=False)
125
+ doc.generate_pdf(filename, compiler="latexmk", clean_tex=False)
83
126
 
84
127
  if self.config.open:
85
128
  self._open_file(pdf_filename)
86
129
 
130
+ def _process_paragraph(self, paragraph) -> str:
131
+ par = paragraph.strip()
132
+ for keyword in self.config.index_keyword:
133
+ par = par.replace(keyword, rf"\index{{{keyword}}}")
134
+
135
+ for keyword in self.book.index:
136
+ par = par.replace(keyword, rf"\index{{{keyword}}}")
137
+
138
+ return par
139
+
87
140
  def _fontset(self) -> str:
88
141
  if sys.platform == "linux":
89
- return "fontset = ubuntu"
142
+ return "fontset=ubuntu"
90
143
 
91
144
  if sys.platform == "darwin":
92
- return "fontset = macos"
145
+ return "fontset=macos"
93
146
 
94
147
  if sys.platform == "windows":
95
- return "fontset = windows"
148
+ return "fontset=windows"
149
+
150
+ return "fontset=ubuntu"
txt2ebook/languages/en.py CHANGED
@@ -18,5 +18,6 @@
18
18
  DEFAULT_RE_TITLE = r"Title:(.*)"
19
19
  DEFAULT_RE_AUTHOR = r"Author:(.*)"
20
20
  DEFAULT_RE_TAG = r"Tags:(.*)"
21
+ DEFAULT_RE_INDEX = r"Index:(.*)"
21
22
  DEFAULT_RE_VOLUME = r"(Volume.*)"
22
23
  DEFAULT_RE_CHAPTER = r"(Chapter.*)"
@@ -52,6 +52,7 @@ RE_CHAPTERS = [
52
52
  DEFAULT_RE_AUTHOR = r"作者:(.*)"
53
53
  DEFAULT_RE_CHAPTER = "(" + "|".join(RE_CHAPTERS) + ")"
54
54
  DEFAULT_RE_TAG = r"标签:(.*)"
55
+ DEFAULT_RE_INDEX = r"索引:(.*)"
55
56
  DEFAULT_RE_TITLE = r"书名:(.*)"
56
57
  DEFAULT_RE_TRANSLATOR = r"翻译:(.*)"
57
58
  DEFAULT_RE_VOLUME = "(" + "|".join(RE_VOLUMES) + ")"
@@ -18,6 +18,7 @@
18
18
  from txt2ebook.languages.zh_cn import (
19
19
  DEFAULT_RE_AUTHOR,
20
20
  DEFAULT_RE_CHAPTER,
21
+ DEFAULT_RE_INDEX,
21
22
  DEFAULT_RE_TAG,
22
23
  DEFAULT_RE_TITLE,
23
24
  DEFAULT_RE_TRANSLATOR,
@@ -39,6 +40,7 @@ __all__ = [
39
40
  "DEFAULT_RE_AUTHOR",
40
41
  "DEFAULT_RE_CHAPTER",
41
42
  "DEFAULT_RE_TAG",
43
+ "DEFAULT_RE_INDEX",
42
44
  "DEFAULT_RE_TITLE",
43
45
  "DEFAULT_RE_TRANSLATOR",
44
46
  "DEFAULT_RE_VOLUME",
@@ -1,34 +1,31 @@
1
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:141
1
+ #: src/txt2ebook/formats/base.py:141
2
2
  msgid "title:"
3
3
  msgstr "Title:"
4
4
 
5
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:142
5
+ #: src/txt2ebook/formats/base.py:142
6
6
  msgid "author:"
7
7
  msgstr "Author:"
8
8
 
9
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:143
9
+ #: src/txt2ebook/formats/base.py:143
10
10
  msgid "translator:"
11
11
  msgstr "Translator:"
12
12
 
13
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:144
13
+ #: src/txt2ebook/formats/base.py:144
14
14
  msgid "tag:"
15
15
  msgstr "Tag:"
16
16
 
17
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:155
18
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:62
19
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:61
20
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:130
21
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:71
17
+ #: src/txt2ebook/formats/base.py:155 src/txt2ebook/formats/gmi.py:62
18
+ #: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
19
+ #: src/txt2ebook/formats/txt.py:71
22
20
  msgid "toc"
23
21
  msgstr "Table of Content"
24
22
 
25
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/epub.py:147
23
+ #: src/txt2ebook/formats/epub.py:147
26
24
  msgid "cover"
27
25
  msgstr "Cover"
28
26
 
29
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:47
30
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:46
31
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:56
27
+ #: src/txt2ebook/formats/gmi.py:47 src/txt2ebook/formats/md.py:46
28
+ #: src/txt2ebook/formats/txt.py:56
32
29
  msgid "metadata"
33
30
  msgstr "Metadata"
34
31
 
@@ -1,34 +1,31 @@
1
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:141
1
+ #: src/txt2ebook/formats/base.py:141
2
2
  msgid "title:"
3
3
  msgstr ""
4
4
 
5
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:142
5
+ #: src/txt2ebook/formats/base.py:142
6
6
  msgid "author:"
7
7
  msgstr ""
8
8
 
9
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:143
9
+ #: src/txt2ebook/formats/base.py:143
10
10
  msgid "translator:"
11
11
  msgstr ""
12
12
 
13
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:144
13
+ #: src/txt2ebook/formats/base.py:144
14
14
  msgid "tag:"
15
15
  msgstr ""
16
16
 
17
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:155
18
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:62
19
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:61
20
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:130
21
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:71
17
+ #: src/txt2ebook/formats/base.py:155 src/txt2ebook/formats/gmi.py:62
18
+ #: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
19
+ #: src/txt2ebook/formats/txt.py:71
22
20
  msgid "toc"
23
21
  msgstr ""
24
22
 
25
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/epub.py:147
23
+ #: src/txt2ebook/formats/epub.py:147
26
24
  msgid "cover"
27
25
  msgstr ""
28
26
 
29
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:47
30
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:46
31
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:56
27
+ #: src/txt2ebook/formats/gmi.py:47 src/txt2ebook/formats/md.py:46
28
+ #: src/txt2ebook/formats/txt.py:56
32
29
  msgid "metadata"
33
30
  msgstr ""
34
31
 
@@ -1,34 +1,31 @@
1
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:141
1
+ #: src/txt2ebook/formats/base.py:141
2
2
  msgid "title:"
3
3
  msgstr "书名:"
4
4
 
5
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:142
5
+ #: src/txt2ebook/formats/base.py:142
6
6
  msgid "author:"
7
7
  msgstr "作者:"
8
8
 
9
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:143
9
+ #: src/txt2ebook/formats/base.py:143
10
10
  msgid "translator:"
11
11
  msgstr "翻译:"
12
12
 
13
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:144
13
+ #: src/txt2ebook/formats/base.py:144
14
14
  msgid "tag:"
15
15
  msgstr "票签:"
16
16
 
17
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:155
18
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:62
19
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:61
20
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:130
21
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:71
17
+ #: src/txt2ebook/formats/base.py:155 src/txt2ebook/formats/gmi.py:62
18
+ #: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
19
+ #: src/txt2ebook/formats/txt.py:71
22
20
  msgid "toc"
23
21
  msgstr "目录"
24
22
 
25
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/epub.py:147
23
+ #: src/txt2ebook/formats/epub.py:147
26
24
  msgid "cover"
27
25
  msgstr "封面"
28
26
 
29
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:47
30
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:46
31
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:56
27
+ #: src/txt2ebook/formats/gmi.py:47 src/txt2ebook/formats/md.py:46
28
+ #: src/txt2ebook/formats/txt.py:56
32
29
  msgid "metadata"
33
30
  msgstr "元数据"
34
31
 
@@ -1,34 +1,31 @@
1
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:141
1
+ #: src/txt2ebook/formats/base.py:141
2
2
  msgid "title:"
3
3
  msgstr "书名:"
4
4
 
5
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:142
5
+ #: src/txt2ebook/formats/base.py:142
6
6
  msgid "author:"
7
7
  msgstr "作者:"
8
8
 
9
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:143
9
+ #: src/txt2ebook/formats/base.py:143
10
10
  msgid "translator:"
11
11
  msgstr "翻译:"
12
12
 
13
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:144
13
+ #: src/txt2ebook/formats/base.py:144
14
14
  msgid "tag:"
15
15
  msgstr "标签:"
16
16
 
17
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:155
18
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:62
19
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:61
20
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:130
21
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:71
17
+ #: src/txt2ebook/formats/base.py:155 src/txt2ebook/formats/gmi.py:62
18
+ #: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
19
+ #: src/txt2ebook/formats/txt.py:71
22
20
  msgid "toc"
23
21
  msgstr "目录"
24
22
 
25
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/epub.py:147
23
+ #: src/txt2ebook/formats/epub.py:147
26
24
  msgid "cover"
27
25
  msgstr "封面"
28
26
 
29
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:47
30
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:46
31
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:56
27
+ #: src/txt2ebook/formats/gmi.py:47 src/txt2ebook/formats/md.py:46
28
+ #: src/txt2ebook/formats/txt.py:56
32
29
  msgid "metadata"
33
30
  msgstr "元数据"
34
31
 
txt2ebook/models/book.py CHANGED
@@ -36,6 +36,7 @@ class Book:
36
36
  authors: List[str] = field(default_factory=lambda: [])
37
37
  translators: List[str] = field(default_factory=lambda: [])
38
38
  tags: List[str] = field(default_factory=lambda: [])
39
+ index: List[str] = field(default_factory=lambda: [])
39
40
  language: str = field(default="")
40
41
  cover: str = field(default="", repr=False)
41
42
  raw_content: str = field(default="", repr=False)
txt2ebook/parser.py CHANGED
@@ -55,13 +55,17 @@ class Parser:
55
55
  massaged_content = self.massage()
56
56
  tokenizer = Tokenizer(massaged_content, self.config)
57
57
 
58
- (book_title, authors, tags, toc) = self.parse_tokens(tokenizer)
58
+ (book_title, authors, translators, tags, index, toc) = (
59
+ self.parse_tokens(tokenizer)
60
+ )
59
61
 
60
62
  book = Book(
61
63
  title=book_title,
62
64
  language=self.config.language,
63
65
  authors=authors,
66
+ translators=translators,
64
67
  tags=tags,
68
+ index=index,
65
69
  cover=self.config.cover,
66
70
  raw_content=self.raw_content,
67
71
  massaged_content=massaged_content,
@@ -126,6 +130,7 @@ class Parser:
126
130
  book_title = ""
127
131
  authors = []
128
132
  tags = []
133
+ index = []
129
134
  translators = []
130
135
  current_volume = Volume("")
131
136
  current_chapter = Chapter("")
@@ -163,6 +168,9 @@ class Parser:
163
168
  if token.type == "TAG":
164
169
  tags.append(token.value)
165
170
 
171
+ if token.type == "INDEX":
172
+ index = token.value.split(" ")
173
+
166
174
  if token.type == "TRANSLATOR":
167
175
  translators.append(token.value)
168
176
 
@@ -216,15 +224,19 @@ class Parser:
216
224
  if self.config.title:
217
225
  book_title = self.config.title
218
226
 
227
+ if self.config.translator:
228
+ authors = self.config.translator
229
+
219
230
  logger.info("Found or set book title: %s", book_title)
220
231
  logger.info("Found or set authors: %s", repr(authors))
221
- logger.info("Found or set categories: %s", repr(tags))
222
232
  logger.info("Found or set translators: %s", repr(translators))
233
+ logger.info("Found or set tags: %s", repr(tags))
234
+ logger.info("Found or set index: %s", repr(index))
223
235
 
224
236
  if self.config.sort_volume_and_chapter:
225
237
  self.sort_volume_and_chapter(toc)
226
238
 
227
- return (book_title, authors, tags, toc)
239
+ return (book_title, authors, translators, tags, index, toc)
228
240
 
229
241
  def sort_volume_and_chapter(self, toc: List) -> None:
230
242
  """Sort by title of volumes and its chapters.
txt2ebook/tokenizer.py CHANGED
@@ -129,6 +129,7 @@ class Tokenizer:
129
129
  ("TITLE", re_title),
130
130
  ("AUTHOR", re_author),
131
131
  ("TAG", f"{self.langconf.DEFAULT_RE_TAG}"),
132
+ ("INDEX", f"{self.langconf.DEFAULT_RE_INDEX}"),
132
133
  ("TRANSLATOR", f"{self.langconf.DEFAULT_RE_TRANSLATOR}"),
133
134
  ]
134
135
 
@@ -151,8 +152,9 @@ class Tokenizer:
151
152
  2 书名:
152
153
  3 作者:
153
154
  4 标签:
154
- 5 翻译:
155
- 6 ---
155
+ 5 索引:
156
+ 6 翻译:
157
+ 7 ---
156
158
 
157
159
  """
158
160
  match = re.search(
txt2ebook/txt2ebook.py CHANGED
@@ -155,6 +155,15 @@ def build_parser(
155
155
  help="ebook format (default: 'epub')",
156
156
  )
157
157
 
158
+ parser.add_argument(
159
+ "-ik",
160
+ "--index-keyword",
161
+ dest="index_keyword",
162
+ action="append",
163
+ default=[],
164
+ help="keyword to index (default: '%(default)s')",
165
+ )
166
+
158
167
  parser.add_argument(
159
168
  "-t",
160
169
  "--title",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: txt2ebook
3
- Version: 0.1.83
3
+ Version: 0.1.86
4
4
  Summary: CLI tool to convert txt file to ebook format
5
5
  Home-page: https://github.com/kianmeng/txt2ebook
6
6
  License: AGPL-3.0-or-later
@@ -73,14 +73,16 @@ txt2ebook --help
73
73
  ```
74
74
 
75
75
  ```console
76
+
76
77
  usage: txt2ebook [-of OUTPUT_FOLDER] [-p] [-f {epub,gmi,md,pdf,tex,txt,typ}]
77
- [-t TITLE] [-l LANGUAGE] [-a AUTHOR] [-tr TRANSLATOR]
78
- [-c IMAGE_FILENAME] [-w WIDTH] [-ff FILENAME_FORMAT]
79
- [-ps SEPARATOR] [-pz PAGE_SIZE] [-rd REGEX] [-rvc REGEX]
80
- [-rv REGEX] [-rc REGEX] [-rt REGEX] [-ra REGEX] [-rl REGEX]
81
- [-rr REGEX REGEX] [-et {clean,condense,noindent}] [-vp] [-tp]
82
- [-sp] [-ss] [-toc] [-hn] [-fw] [-rw] [-ow] [-op] [-q] [-v]
83
- [-y] [-d] [--env] [-h] [-V]
78
+ [-ik INDEX_KEYWORD] [-t TITLE] [-l LANGUAGE] [-a AUTHOR]
79
+ [-tr TRANSLATOR] [-c IMAGE_FILENAME] [-w WIDTH]
80
+ [-ff FILENAME_FORMAT] [-ps SEPARATOR] [-pz PAGE_SIZE]
81
+ [-rd REGEX] [-rvc REGEX] [-rv REGEX] [-rc REGEX] [-rt REGEX]
82
+ [-ra REGEX] [-rl REGEX] [-rr REGEX REGEX]
83
+ [-et {clean,condense,noindent}] [-vp] [-tp] [-sp] [-ss]
84
+ [-toc] [-hn] [-fw] [-rw] [-ow] [-op] [-q] [-v] [-y] [-d]
85
+ [--env] [-h] [-V]
84
86
  TXT_FILENAME [EBOOK_FILENAME]
85
87
 
86
88
  txt2ebook/tte is a cli tool to convert txt file to ebook format.
@@ -102,6 +104,8 @@ optional arguments:
102
104
  remove converted ebooks specified by --output-folder option (default: 'False')
103
105
  -f {epub,gmi,md,pdf,tex,txt,typ}, --format {epub,gmi,md,pdf,tex,txt,typ}
104
106
  ebook format (default: 'epub')
107
+ -ik INDEX_KEYWORD, --index-keyword INDEX_KEYWORD
108
+ keyword to index (default: '[]')
105
109
  -t TITLE, --title TITLE
106
110
  title of the ebook (default: 'None')
107
111
  -l LANGUAGE, --language LANGUAGE
@@ -1,4 +1,4 @@
1
- txt2ebook/__init__.py,sha256=iD2uJuXzihfchfyYed9PS077YBUK268_w72rwNEgR4A,2061
1
+ txt2ebook/__init__.py,sha256=54Kv0R691Fp2bMorGDwIagjpoU-wQCRA9L_8nm4pP64,2061
2
2
  txt2ebook/__main__.py,sha256=gMLvgpqc_BL4cBqNe0vqErRF5dlJPAbvqu1zndcAHYI,850
3
3
  txt2ebook/exceptions.py,sha256=b2HDsXdqweLJbvSJEGt48nxvGkZq20SfYezSjwp77JU,842
4
4
  txt2ebook/formats/__init__.py,sha256=WhiRWGvbUjc8QZfhAIkKCg6GL8vNNlEF73meZSzYhDA,2463
@@ -12,31 +12,31 @@ txt2ebook/formats/templates/epub/__init__.py,sha256=DeIsL4WDqgTU7zCLxlCidFItvG4N
12
12
  txt2ebook/formats/templates/epub/clean.css,sha256=AnEwMckzUSKcjKsDiWtJW1oaceuklt2tyuS1VbpVK1s,462
13
13
  txt2ebook/formats/templates/epub/condense.css,sha256=Fz80ZqkPsFRmGdURduAxqMV8drD0CCUlrv41P8rUsm8,477
14
14
  txt2ebook/formats/templates/epub/noindent.css,sha256=_O5Tv90TKyyPBRdgjuNKFwtKFbdheh2V9PtDhgRUg3U,483
15
- txt2ebook/formats/tex.py,sha256=_Etvp6ZKNfcspd_dpYAaLZniJIH_YARbJEdsQO5zUfQ,3616
15
+ txt2ebook/formats/tex.py,sha256=aNF5mMbO4woxlm38yIPoi55GE2QhdtwUz0D14Q9QWs0,5564
16
16
  txt2ebook/formats/txt.py,sha256=8PkJ54r-0saZYyYEH64nYSkM-oW5LnurCbAk6d2Ue78,7536
17
17
  txt2ebook/formats/typ.py,sha256=79WQyaexmNVJ0Xh7ykNjpwcS0vK7sdkSlrOBm-uV6dA,5200
18
18
  txt2ebook/helpers/__init__.py,sha256=cQmFjEsEEI0gRxDPL-284FMS5Z-iBMcu-4qe7Icf7is,1971
19
19
  txt2ebook/languages/__init__.py,sha256=oShuwgKn784v_XYrAKQM2x1h0-KEsJPeia9XWMnJTYU,758
20
- txt2ebook/languages/en.py,sha256=LVZsvr6JLbQFrfI1XSYG54mFwzlHa0fhKghlUemkQbo,920
21
- txt2ebook/languages/zh_cn.py,sha256=_3DnB7mDW_EJW3-jy9ZfnxIZ85zNgfXqzPoc7daBHIY,1930
22
- txt2ebook/languages/zh_tw.py,sha256=ISjDXJes-jbOUC_5RDH8Bsc0ttBf-4Dt2HNDEBxwRgE,1464
20
+ txt2ebook/languages/en.py,sha256=ZUhkXzZrs3Sy11-hj0SGj5XYrMnafTHEN8WxMOJEtEo,955
21
+ txt2ebook/languages/zh_cn.py,sha256=Qtu_k9LiXkib_7Tp5Wwi3ESSKDJ59BvArW4s7jr7kwA,1966
22
+ txt2ebook/languages/zh_tw.py,sha256=MGu99-dSPq7bwS9PyRTUExJuYGtViq8d2ubrjH9C7cA,1510
23
23
  txt2ebook/locales/en/LC_MESSAGES/txt2ebook.mo,sha256=Ym6soeijV3zsv9FUPWlJnu18-CNb5tcOTN5JsMOfV9c,672
24
- txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po,sha256=Idp783OJpRQGvohvt_nCaNfg1gz2QAcyDKXwJZ5-iZ8,1214
25
- txt2ebook/locales/txt2ebook.pot,sha256=mVjjv_qcm498tOU5-avSv_2Qi97J9Hi6p6XWKId6_tc,1157
24
+ txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po,sha256=cXhuoliGo0pP3nYQZ9oVBr9KlZoH3rObT3InvYrcFt0,698
25
+ txt2ebook/locales/txt2ebook.pot,sha256=7Kx5R2IajWqXlTwvG9aTILzpnodLKeONlGBbaHW2-no,641
26
26
  txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo,sha256=rRGW7HByDVZV8WpQkhyIFOWYNTQc4NnStrn0eGJX8Wc,675
27
- txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po,sha256=P5EHatQZg6G7ZDbs29v6VicNWKi6plCyRRPgYpjz9Qs,1214
27
+ txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po,sha256=D01adM7HEKkFzlKu-6eBG0LhN5KDXcMny-ajV8kkumo,698
28
28
  txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo,sha256=1GIuOcO_bISiFcfhFez-A7mSi11Mo-x3PBobBENgMEc,675
29
- txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po,sha256=bEQxFGwdkAX3or1VSMTNDnjUijJ4ZnSENefzreXPkL4,1214
29
+ txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po,sha256=JN6iot1G9roKZi7FkB6kXSZYg3uR6wBBUoRrmF8aKRk,698
30
30
  txt2ebook/models/__init__.py,sha256=8_k1oI_PnPMekhdZCXiTtg5WghdR6fugQEHJHsy1-Ds,925
31
- txt2ebook/models/book.py,sha256=GYXvklHnLIuodEgbjzulyA0OSX72K37ohGBn8xDwCgw,2759
31
+ txt2ebook/models/book.py,sha256=4dQBIYLBpxTHrSKTSYTzanD9LTYelzL0B4hUX2r1a4c,2816
32
32
  txt2ebook/models/chapter.py,sha256=buECAklNQgM3tDehzyVO9YfA_F0iXyLq2PaMZGV_Zaw,1681
33
33
  txt2ebook/models/volume.py,sha256=HyT4XO9yZ8d0PgZVfMMyAYUDFv58RrUmsSFNNmU-sHY,1592
34
- txt2ebook/parser.py,sha256=vdC--8I2c89xve7OA1OkYTDjSMwwKoyv4Wkmca0iFhE,11823
35
- txt2ebook/tokenizer.py,sha256=y1CQ3Xf5g74o_mUZSOwrwwu0grKmgmt6x3yxCWWokhU,9318
36
- txt2ebook/txt2ebook.py,sha256=Nwf30JA5aAXwHZEH1bnqXtD_eT3QBbpHQfsG4DP9uAc,13212
34
+ txt2ebook/parser.py,sha256=DbivznOgBOzlY5btTdB09D6yNGk5QXsE-gD2zc6lJyc,12188
35
+ txt2ebook/tokenizer.py,sha256=Bm56thLiYSmRDuFiAaOH-NibzhYZQvnLo_u21KaV4Oo,9406
36
+ txt2ebook/txt2ebook.py,sha256=O9YG6k5vDSRFpawc2iVRmi7uNxP89GrSR68D1mGepHc,13419
37
37
  txt2ebook/zh_utils.py,sha256=EgKVbwqYGaTGswQUGcOCeSfRelzwkAb9WWY9TrsX1x4,4882
38
- txt2ebook-0.1.83.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
39
- txt2ebook-0.1.83.dist-info/METADATA,sha256=Dgflg8SSIEm9OZ-W1suCiAZ_us2tcvPcyBKMZTBplxk,7511
40
- txt2ebook-0.1.83.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
41
- txt2ebook-0.1.83.dist-info/entry_points.txt,sha256=IQHyIIhd0MHjSSRVC1a6tMeIoLus8D06KHL_cumvEbg,83
42
- txt2ebook-0.1.83.dist-info/RECORD,,
38
+ txt2ebook-0.1.86.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
39
+ txt2ebook-0.1.86.dist-info/METADATA,sha256=DIdQOtjx2MYxUC7OBbjmZ3-KUHaaYG2mgKl8LKYQ9Bs,7639
40
+ txt2ebook-0.1.86.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
41
+ txt2ebook-0.1.86.dist-info/entry_points.txt,sha256=IQHyIIhd0MHjSSRVC1a6tMeIoLus8D06KHL_cumvEbg,83
42
+ txt2ebook-0.1.86.dist-info/RECORD,,