txt2ebook 0.1.36__tar.gz → 0.1.38__tar.gz
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-0.1.36 → txt2ebook-0.1.38}/CHANGELOG.md +27 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/PKG-INFO +3 -8
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/README.md +2 -2
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/pyproject.toml +3 -1
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/__init__.py +1 -1
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/formats/pdf.py +34 -28
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/languages/zh_cn.py +3 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/languages/zh_tw.py +2 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po +8 -8
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/locales/txt2ebook.pot +8 -8
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po +8 -8
- txt2ebook-0.1.38/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po +25 -0
- txt2ebook-0.1.36/setup.py +0 -61
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/CONTRIBUTING.md +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/LICENSE.md +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/__main__.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/exceptions.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/formats/__init__.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/formats/base.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/formats/epub.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/formats/md.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/formats/templates/__init__.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/formats/templates/epub/__init__.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/formats/templates/epub/clean.css +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/formats/templates/epub/condense.css +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/formats/templates/epub/noindent.css +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/formats/txt.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/helpers/__init__.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/languages/__init__.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/languages/en.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.mo +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/models/__init__.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/models/book.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/models/chapter.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/models/volume.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/parser.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/tokenizer.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/txt2ebook.py +0 -0
- {txt2ebook-0.1.36 → txt2ebook-0.1.38}/src/txt2ebook/zh_utils.py +0 -0
@@ -7,6 +7,33 @@ and this project adheres to [0-based versioning](https://0ver.org/).
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## v0.1.38 - 2023-06-04
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
- Add `zh-tw` translations
|
15
|
+
|
16
|
+
### Updated
|
17
|
+
|
18
|
+
- Update deprecating call of script_runner in tests
|
19
|
+
|
20
|
+
## v0.1.37 - 2023-05-28
|
21
|
+
|
22
|
+
### Added
|
23
|
+
|
24
|
+
- Add chapter regex rules for `zh-cn` language
|
25
|
+
|
26
|
+
### Fixed
|
27
|
+
|
28
|
+
- Fix missing export variable for `zh-tw` language
|
29
|
+
- Update outdated translation
|
30
|
+
|
31
|
+
### Changed
|
32
|
+
|
33
|
+
- Add missing return type for PDFWriter
|
34
|
+
- Align page number against body content in PDF file
|
35
|
+
- Refactor TOC generation in PDF file
|
36
|
+
|
10
37
|
## v0.1.36 - 2023-05-21
|
11
38
|
|
12
39
|
### Added
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: txt2ebook
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.38
|
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
|
@@ -21,11 +21,6 @@ Classifier: Programming Language :: Python :: 3.9
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.10
|
22
22
|
Classifier: Programming Language :: Python :: 3.11
|
23
23
|
Classifier: Programming Language :: Python :: 3 :: Only
|
24
|
-
Classifier: Programming Language :: Python :: 3.10
|
25
|
-
Classifier: Programming Language :: Python :: 3.11
|
26
|
-
Classifier: Programming Language :: Python :: 3.7
|
27
|
-
Classifier: Programming Language :: Python :: 3.8
|
28
|
-
Classifier: Programming Language :: Python :: 3.9
|
29
24
|
Classifier: Topic :: Text Processing
|
30
25
|
Classifier: Topic :: Text Processing :: Filters
|
31
26
|
Classifier: Topic :: Text Processing :: General
|
@@ -73,7 +68,7 @@ usage: txt2ebook [-f {epub,md,pdf,txt}] [-t TITLE] [-l LANGUAGE] [-a AUTHOR]
|
|
73
68
|
[-c IMAGE_FILENAME] [-w WIDTH] [-ff FILENAME_FORMAT]
|
74
69
|
[-ps SEPARATOR] [-pz PAGE_SIZE] [-rd REGEX] [-rvc REGEX]
|
75
70
|
[-rv REGEX] [-rc REGEX] [-rt REGEX] [-ra REGEX] [-rl REGEX]
|
76
|
-
[-rr REGEX REGEX] [-et {clean,noindent
|
71
|
+
[-rr REGEX REGEX] [-et {clean,condense,noindent}] [-vp] [-tp]
|
77
72
|
[-sp] [-toc] [-hn] [-fw] [-rw] [-ow] [-v] [-d] [-h] [-V]
|
78
73
|
TXT_FILENAME [EBOOK_FILENAME]
|
79
74
|
|
@@ -138,7 +133,7 @@ optional arguments:
|
|
138
133
|
--format epub:
|
139
134
|
-c IMAGE_FILENAME, --cover IMAGE_FILENAME
|
140
135
|
cover of the ebook
|
141
|
-
-et {clean,noindent
|
136
|
+
-et {clean,condense,noindent}, --epub-template {clean,condense,noindent}
|
142
137
|
CSS template for epub ebook (default: 'clean')
|
143
138
|
-vp, --volume-page
|
144
139
|
generate each volume as separate page
|
@@ -29,7 +29,7 @@ usage: txt2ebook [-f {epub,md,pdf,txt}] [-t TITLE] [-l LANGUAGE] [-a AUTHOR]
|
|
29
29
|
[-c IMAGE_FILENAME] [-w WIDTH] [-ff FILENAME_FORMAT]
|
30
30
|
[-ps SEPARATOR] [-pz PAGE_SIZE] [-rd REGEX] [-rvc REGEX]
|
31
31
|
[-rv REGEX] [-rc REGEX] [-rt REGEX] [-ra REGEX] [-rl REGEX]
|
32
|
-
[-rr REGEX REGEX] [-et {clean,noindent
|
32
|
+
[-rr REGEX REGEX] [-et {clean,condense,noindent}] [-vp] [-tp]
|
33
33
|
[-sp] [-toc] [-hn] [-fw] [-rw] [-ow] [-v] [-d] [-h] [-V]
|
34
34
|
TXT_FILENAME [EBOOK_FILENAME]
|
35
35
|
|
@@ -94,7 +94,7 @@ optional arguments:
|
|
94
94
|
--format epub:
|
95
95
|
-c IMAGE_FILENAME, --cover IMAGE_FILENAME
|
96
96
|
cover of the ebook
|
97
|
-
-et {clean,noindent
|
97
|
+
-et {clean,condense,noindent}, --epub-template {clean,condense,noindent}
|
98
98
|
CSS template for epub ebook (default: 'clean')
|
99
99
|
-vp, --volume-page
|
100
100
|
generate each volume as separate page
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "txt2ebook"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.38"
|
4
4
|
description = "CLI tool to convert txt file to ebook format"
|
5
5
|
authors = ["Kian-Meng Ang <kianmeng@cpan.org>"]
|
6
6
|
license = "AGPL-3.0-or-later"
|
@@ -126,6 +126,8 @@ commands =
|
|
126
126
|
pygettext3 -d txt2ebook -o {toxinidir}/src/txt2ebook/locales/txt2ebook.pot {toxinidir}/src/txt2ebook/
|
127
127
|
msgmerge --update {toxinidir}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po {toxinidir}/src/txt2ebook/locales/txt2ebook.pot
|
128
128
|
msgmerge --update {toxinidir}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po {toxinidir}/src/txt2ebook/locales/txt2ebook.pot
|
129
|
+
msgmerge --update {toxinidir}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po {toxinidir}/src/txt2ebook/locales/txt2ebook.pot
|
129
130
|
msgfmt -o {toxinidir}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.mo {toxinidir}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po
|
130
131
|
msgfmt -o {toxinidir}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo {toxinidir}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po
|
132
|
+
msgfmt -o {toxinidir}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo {toxinidir}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po
|
131
133
|
"""
|
@@ -16,6 +16,7 @@
|
|
16
16
|
"""Convert and back source text file into text as well."""
|
17
17
|
|
18
18
|
import logging
|
19
|
+
from typing import List, Tuple
|
19
20
|
|
20
21
|
import reportlab
|
21
22
|
from reportlab.lib.enums import TA_RIGHT
|
@@ -73,9 +74,7 @@ class PdfWriter(BaseWriter):
|
|
73
74
|
def write(self) -> None:
|
74
75
|
"""Generate PDF files."""
|
75
76
|
pdf = []
|
76
|
-
pdf.
|
77
|
-
pdf.append(self._init_toc())
|
78
|
-
pdf.append(PageBreak())
|
77
|
+
pdf.extend(self._toc_page())
|
79
78
|
|
80
79
|
for section in self.book.toc:
|
81
80
|
if isinstance(section, Volume):
|
@@ -92,7 +91,7 @@ class PdfWriter(BaseWriter):
|
|
92
91
|
pdf, onFirstPage=self._cover_page, onLaterPages=self._regular_page
|
93
92
|
)
|
94
93
|
|
95
|
-
def _cover_page(self, canvas, _doc):
|
94
|
+
def _cover_page(self, canvas, _doc) -> None:
|
96
95
|
(page_width, page_height) = self._get_pagesize()
|
97
96
|
canvas.saveState()
|
98
97
|
canvas.setFont(self.langconf.DEFAULT_PDF_FONT_NAME, 28)
|
@@ -110,7 +109,31 @@ class PdfWriter(BaseWriter):
|
|
110
109
|
canvas.restoreState()
|
111
110
|
canvas.showPage()
|
112
111
|
|
113
|
-
def
|
112
|
+
def _toc_page(self) -> List:
|
113
|
+
toc = TableOfContents()
|
114
|
+
toc.levelStyles = [
|
115
|
+
ParagraphStyle(
|
116
|
+
name="TOCHeading1",
|
117
|
+
fontName=self.langconf.DEFAULT_PDF_FONT_NAME,
|
118
|
+
fontSize=self.langconf.DEFAULT_PDF_FONT_SIZE,
|
119
|
+
firstLineIndent=0,
|
120
|
+
leftIndent=0,
|
121
|
+
),
|
122
|
+
ParagraphStyle(
|
123
|
+
name="TOCHeading2",
|
124
|
+
fontName=self.langconf.DEFAULT_PDF_FONT_NAME,
|
125
|
+
fontSize=self.langconf.DEFAULT_PDF_FONT_SIZE,
|
126
|
+
firstLineIndent=0,
|
127
|
+
leftIndent=-(self.langconf.DEFAULT_PDF_FONT_SIZE * 4 - 4),
|
128
|
+
),
|
129
|
+
]
|
130
|
+
return [
|
131
|
+
self.to_title(self._("toc")),
|
132
|
+
toc,
|
133
|
+
PageBreak(),
|
134
|
+
]
|
135
|
+
|
136
|
+
def _regular_page(self, canvas, doc) -> None:
|
114
137
|
canvas.saveState()
|
115
138
|
|
116
139
|
style = ParagraphStyle(
|
@@ -118,15 +141,19 @@ class PdfWriter(BaseWriter):
|
|
118
141
|
fontName=self.langconf.DEFAULT_PDF_FONT_NAME,
|
119
142
|
fontSize=self.langconf.DEFAULT_PDF_FONT_SIZE,
|
120
143
|
alignment=TA_RIGHT,
|
144
|
+
rightIndent=18,
|
121
145
|
)
|
122
146
|
|
147
|
+
if self.config.debug:
|
148
|
+
style.borderColor = "#000000"
|
149
|
+
|
123
150
|
footer = Paragraph(f"{doc.page}", style=style)
|
124
151
|
_width, _height = footer.wrap(doc.width, doc.bottomMargin)
|
125
152
|
footer.drawOn(canvas, doc.leftMargin, doc.bottomMargin - cm)
|
126
153
|
|
127
154
|
canvas.restoreState()
|
128
155
|
|
129
|
-
def _get_pagesize(self) ->
|
156
|
+
def _get_pagesize(self) -> Tuple:
|
130
157
|
page_size = (
|
131
158
|
self.config.page_size or self.langconf.DEFAULT_PDF_PAGE_SIZE
|
132
159
|
)
|
@@ -152,27 +179,6 @@ class PdfWriter(BaseWriter):
|
|
152
179
|
)
|
153
180
|
)
|
154
181
|
|
155
|
-
def _init_toc(self):
|
156
|
-
"""Initialize toc and its styles."""
|
157
|
-
toc = TableOfContents()
|
158
|
-
toc.levelStyles = [
|
159
|
-
ParagraphStyle(
|
160
|
-
name="TOCHeading1",
|
161
|
-
fontName=self.langconf.DEFAULT_PDF_FONT_NAME,
|
162
|
-
fontSize=self.langconf.DEFAULT_PDF_FONT_SIZE,
|
163
|
-
firstLineIndent=0,
|
164
|
-
leftIndent=0,
|
165
|
-
),
|
166
|
-
ParagraphStyle(
|
167
|
-
name="TOCHeading2",
|
168
|
-
fontName=self.langconf.DEFAULT_PDF_FONT_NAME,
|
169
|
-
fontSize=self.langconf.DEFAULT_PDF_FONT_SIZE,
|
170
|
-
firstLineIndent=0,
|
171
|
-
leftIndent=-(self.langconf.DEFAULT_PDF_FONT_SIZE * 4 - 4),
|
172
|
-
),
|
173
|
-
]
|
174
|
-
return toc
|
175
|
-
|
176
182
|
def to_title(self, words: str, style: str = "title") -> str:
|
177
183
|
"""Create the title for the section."""
|
178
184
|
font_name = self.langconf.DEFAULT_PDF_FONT_NAME
|
@@ -181,7 +187,7 @@ class PdfWriter(BaseWriter):
|
|
181
187
|
self.styles[style],
|
182
188
|
)
|
183
189
|
|
184
|
-
def to_chapter(self, pdf, chapter, under_volume=False):
|
190
|
+
def to_chapter(self, pdf, chapter, under_volume=False) -> None:
|
185
191
|
"""Generate each chapter."""
|
186
192
|
style = "Heading2" if under_volume else "Heading1"
|
187
193
|
pdf.append(self.to_title(chapter.title, style))
|
@@ -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_TAG,
|
21
22
|
DEFAULT_RE_TITLE,
|
22
23
|
DEFAULT_RE_VOLUME,
|
23
24
|
FULLWIDTH_NUMS,
|
@@ -35,6 +36,7 @@ DEFAULT_PDF_FONT_SIZE = 12
|
|
35
36
|
__all__ = [
|
36
37
|
"DEFAULT_RE_AUTHOR",
|
37
38
|
"DEFAULT_RE_CHAPTER",
|
39
|
+
"DEFAULT_RE_TAG",
|
38
40
|
"DEFAULT_RE_TITLE",
|
39
41
|
"DEFAULT_RE_VOLUME",
|
40
42
|
"FULLWIDTH_NUMS",
|
@@ -5,7 +5,7 @@
|
|
5
5
|
msgid ""
|
6
6
|
msgstr ""
|
7
7
|
"Project-Id-Version: PACKAGE VERSION\n"
|
8
|
-
"POT-Creation-Date: 2023-05-
|
8
|
+
"POT-Creation-Date: 2023-05-29 23:40+0800\n"
|
9
9
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
10
10
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
11
11
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -15,7 +15,7 @@ msgstr ""
|
|
15
15
|
"Content-Transfer-Encoding: 8bit\n"
|
16
16
|
"Generated-By: pygettext.py 1.5\n"
|
17
17
|
|
18
|
-
#: src/txt2ebook/formats/epub.py:
|
18
|
+
#: src/txt2ebook/formats/epub.py:142
|
19
19
|
msgid "cover"
|
20
20
|
msgstr "Cover"
|
21
21
|
|
@@ -23,20 +23,20 @@ msgstr "Cover"
|
|
23
23
|
msgid "metadata"
|
24
24
|
msgstr "Metadata"
|
25
25
|
|
26
|
-
#: src/txt2ebook/formats/md.py:58 src/txt2ebook/formats/md.py:
|
27
|
-
#: src/txt2ebook/formats/pdf.py:
|
28
|
-
#: src/txt2ebook/formats/txt.py:
|
26
|
+
#: src/txt2ebook/formats/md.py:58 src/txt2ebook/formats/md.py:126
|
27
|
+
#: src/txt2ebook/formats/pdf.py:131 src/txt2ebook/formats/txt.py:68
|
28
|
+
#: src/txt2ebook/formats/txt.py:155
|
29
29
|
msgid "toc"
|
30
30
|
msgstr "Table of Content"
|
31
31
|
|
32
|
-
#: src/txt2ebook/formats/md.py:
|
32
|
+
#: src/txt2ebook/formats/md.py:140 src/txt2ebook/formats/txt.py:169
|
33
33
|
msgid "title:"
|
34
34
|
msgstr "Title:"
|
35
35
|
|
36
|
-
#: src/txt2ebook/formats/md.py:
|
36
|
+
#: src/txt2ebook/formats/md.py:141 src/txt2ebook/formats/txt.py:170
|
37
37
|
msgid "author:"
|
38
38
|
msgstr "Author:"
|
39
39
|
|
40
|
-
#: src/txt2ebook/formats/md.py:
|
40
|
+
#: src/txt2ebook/formats/md.py:142 src/txt2ebook/formats/txt.py:171
|
41
41
|
msgid "tag:"
|
42
42
|
msgstr "Tag:"
|
@@ -5,7 +5,7 @@
|
|
5
5
|
msgid ""
|
6
6
|
msgstr ""
|
7
7
|
"Project-Id-Version: PACKAGE VERSION\n"
|
8
|
-
"POT-Creation-Date: 2023-05-
|
8
|
+
"POT-Creation-Date: 2023-05-29 23:41+0800\n"
|
9
9
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
10
10
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
11
11
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -15,7 +15,7 @@ msgstr ""
|
|
15
15
|
"Generated-By: pygettext.py 1.5\n"
|
16
16
|
|
17
17
|
|
18
|
-
#: src/txt2ebook/formats/epub.py:
|
18
|
+
#: src/txt2ebook/formats/epub.py:142
|
19
19
|
msgid "cover"
|
20
20
|
msgstr ""
|
21
21
|
|
@@ -23,21 +23,21 @@ msgstr ""
|
|
23
23
|
msgid "metadata"
|
24
24
|
msgstr ""
|
25
25
|
|
26
|
-
#: src/txt2ebook/formats/md.py:58 src/txt2ebook/formats/md.py:
|
27
|
-
#: src/txt2ebook/formats/pdf.py:
|
28
|
-
#: src/txt2ebook/formats/txt.py:
|
26
|
+
#: src/txt2ebook/formats/md.py:58 src/txt2ebook/formats/md.py:126
|
27
|
+
#: src/txt2ebook/formats/pdf.py:131 src/txt2ebook/formats/txt.py:68
|
28
|
+
#: src/txt2ebook/formats/txt.py:155
|
29
29
|
msgid "toc"
|
30
30
|
msgstr ""
|
31
31
|
|
32
|
-
#: src/txt2ebook/formats/md.py:
|
32
|
+
#: src/txt2ebook/formats/md.py:140 src/txt2ebook/formats/txt.py:169
|
33
33
|
msgid "title:"
|
34
34
|
msgstr ""
|
35
35
|
|
36
|
-
#: src/txt2ebook/formats/md.py:
|
36
|
+
#: src/txt2ebook/formats/md.py:141 src/txt2ebook/formats/txt.py:170
|
37
37
|
msgid "author:"
|
38
38
|
msgstr ""
|
39
39
|
|
40
|
-
#: src/txt2ebook/formats/md.py:
|
40
|
+
#: src/txt2ebook/formats/md.py:142 src/txt2ebook/formats/txt.py:171
|
41
41
|
msgid "tag:"
|
42
42
|
msgstr ""
|
43
43
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
msgid ""
|
6
6
|
msgstr ""
|
7
7
|
"Project-Id-Version: \n"
|
8
|
-
"POT-Creation-Date: 2023-05-
|
8
|
+
"POT-Creation-Date: 2023-05-29 23:40+0800\n"
|
9
9
|
"PO-Revision-Date: 2023-01-14 18:07+0800\n"
|
10
10
|
"Last-Translator: \n"
|
11
11
|
"Language-Team: \n"
|
@@ -16,7 +16,7 @@ msgstr ""
|
|
16
16
|
"Generated-By: pygettext.py 1.5\n"
|
17
17
|
"X-Generator: Poedit 3.1.1\n"
|
18
18
|
|
19
|
-
#: src/txt2ebook/formats/epub.py:
|
19
|
+
#: src/txt2ebook/formats/epub.py:142
|
20
20
|
msgid "cover"
|
21
21
|
msgstr "封面"
|
22
22
|
|
@@ -24,20 +24,20 @@ msgstr "封面"
|
|
24
24
|
msgid "metadata"
|
25
25
|
msgstr "元数据"
|
26
26
|
|
27
|
-
#: src/txt2ebook/formats/md.py:58 src/txt2ebook/formats/md.py:
|
28
|
-
#: src/txt2ebook/formats/pdf.py:
|
29
|
-
#: src/txt2ebook/formats/txt.py:
|
27
|
+
#: src/txt2ebook/formats/md.py:58 src/txt2ebook/formats/md.py:126
|
28
|
+
#: src/txt2ebook/formats/pdf.py:131 src/txt2ebook/formats/txt.py:68
|
29
|
+
#: src/txt2ebook/formats/txt.py:155
|
30
30
|
msgid "toc"
|
31
31
|
msgstr "目录"
|
32
32
|
|
33
|
-
#: src/txt2ebook/formats/md.py:
|
33
|
+
#: src/txt2ebook/formats/md.py:140 src/txt2ebook/formats/txt.py:169
|
34
34
|
msgid "title:"
|
35
35
|
msgstr "书名:"
|
36
36
|
|
37
|
-
#: src/txt2ebook/formats/md.py:
|
37
|
+
#: src/txt2ebook/formats/md.py:141 src/txt2ebook/formats/txt.py:170
|
38
38
|
msgid "author:"
|
39
39
|
msgstr "作者:"
|
40
40
|
|
41
|
-
#: src/txt2ebook/formats/md.py:
|
41
|
+
#: src/txt2ebook/formats/md.py:142 src/txt2ebook/formats/txt.py:171
|
42
42
|
msgid "tag:"
|
43
43
|
msgstr "票签:"
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#: src/txt2ebook/formats/epub.py:142
|
2
|
+
msgid "cover"
|
3
|
+
msgstr ""
|
4
|
+
|
5
|
+
#: src/txt2ebook/formats/md.py:45 src/txt2ebook/formats/txt.py:55
|
6
|
+
msgid "metadata"
|
7
|
+
msgstr ""
|
8
|
+
|
9
|
+
#: src/txt2ebook/formats/md.py:58 src/txt2ebook/formats/md.py:126
|
10
|
+
#: src/txt2ebook/formats/pdf.py:131 src/txt2ebook/formats/txt.py:68
|
11
|
+
#: src/txt2ebook/formats/txt.py:155
|
12
|
+
msgid "toc"
|
13
|
+
msgstr ""
|
14
|
+
|
15
|
+
#: src/txt2ebook/formats/md.py:140 src/txt2ebook/formats/txt.py:169
|
16
|
+
msgid "title:"
|
17
|
+
msgstr ""
|
18
|
+
|
19
|
+
#: src/txt2ebook/formats/md.py:141 src/txt2ebook/formats/txt.py:170
|
20
|
+
msgid "author:"
|
21
|
+
msgstr ""
|
22
|
+
|
23
|
+
#: src/txt2ebook/formats/md.py:142 src/txt2ebook/formats/txt.py:171
|
24
|
+
msgid "tag:"
|
25
|
+
msgstr ""
|
txt2ebook-0.1.36/setup.py
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
from setuptools import setup
|
3
|
-
|
4
|
-
package_dir = \
|
5
|
-
{'': 'src'}
|
6
|
-
|
7
|
-
packages = \
|
8
|
-
['txt2ebook',
|
9
|
-
'txt2ebook.formats',
|
10
|
-
'txt2ebook.formats.templates',
|
11
|
-
'txt2ebook.formats.templates.epub',
|
12
|
-
'txt2ebook.helpers',
|
13
|
-
'txt2ebook.languages',
|
14
|
-
'txt2ebook.models']
|
15
|
-
|
16
|
-
package_data = \
|
17
|
-
{'': ['*'],
|
18
|
-
'txt2ebook': ['locales/*',
|
19
|
-
'locales/en/LC_MESSAGES/txt2ebook.mo',
|
20
|
-
'locales/en/LC_MESSAGES/txt2ebook.mo',
|
21
|
-
'locales/en/LC_MESSAGES/txt2ebook.po',
|
22
|
-
'locales/en/LC_MESSAGES/txt2ebook.po',
|
23
|
-
'locales/zh-cn/LC_MESSAGES/txt2ebook.mo',
|
24
|
-
'locales/zh-cn/LC_MESSAGES/txt2ebook.mo',
|
25
|
-
'locales/zh-cn/LC_MESSAGES/txt2ebook.po',
|
26
|
-
'locales/zh-cn/LC_MESSAGES/txt2ebook.po']}
|
27
|
-
|
28
|
-
install_requires = \
|
29
|
-
['CJKwrap>=2.2,<3.0',
|
30
|
-
'EbookLib>=0.17.1,<0.18.0',
|
31
|
-
'bs4>=0.0.1,<0.0.2',
|
32
|
-
'langdetect>=1.0.9,<2.0.0',
|
33
|
-
'pypandoc>=1.11,<2.0',
|
34
|
-
'regex>=2021.11.10,<2022.0.0',
|
35
|
-
'reportlab>=4.0.0,<5.0.0',
|
36
|
-
'typing-extensions>=4.5.0,<5.0.0']
|
37
|
-
|
38
|
-
entry_points = \
|
39
|
-
{'console_scripts': ['tte = txt2ebook.txt2ebook:main',
|
40
|
-
'txt2ebook = txt2ebook.txt2ebook:main']}
|
41
|
-
|
42
|
-
setup_kwargs = {
|
43
|
-
'name': 'txt2ebook',
|
44
|
-
'version': '0.1.36',
|
45
|
-
'description': 'CLI tool to convert txt file to ebook format',
|
46
|
-
'long_description': "# txt2ebook\n\nConsole tool to convert txt file to different ebook format.\n\n## Installation\n\nStable version From PyPI:\n\n```console\npython3 -m pip install txt2ebook\n```\n\nLatest development version from GitHub:\n\n```console\npython3 -m pip install -e git+https://github.com/kianmeng/txt2ebook.git\n```\n\n## Usage\n\nShowing help message of command-line options:\n\n```console\ntxt2ebook --help\n```\n\n```console\nusage: txt2ebook [-f {epub,md,pdf,txt}] [-t TITLE] [-l LANGUAGE] [-a AUTHOR]\n [-c IMAGE_FILENAME] [-w WIDTH] [-ff FILENAME_FORMAT]\n [-ps SEPARATOR] [-pz PAGE_SIZE] [-rd REGEX] [-rvc REGEX]\n [-rv REGEX] [-rc REGEX] [-rt REGEX] [-ra REGEX] [-rl REGEX]\n [-rr REGEX REGEX] [-et {clean,noindent,condense}] [-vp] [-tp]\n [-sp] [-toc] [-hn] [-fw] [-rw] [-ow] [-v] [-d] [-h] [-V]\n TXT_FILENAME [EBOOK_FILENAME]\n\ntxt2ebook/tte is a cli tool to convert txt file to ebook format.\n website: https://github.com/kianmeng/txt2ebook\n issues: https://github.com/kianmeng/txt2ebook/issues\n\npositional arguments:\n TXT_FILENAME\n source text filename\n EBOOK_FILENAME\n converted ebook filename (default: 'TXT_FILENAME.epub')\n\noptional arguments:\n -f {epub,md,pdf,txt}, --format {epub,md,pdf,txt}\n ebook format (default: 'epub')\n -t TITLE, --title TITLE\n title of the ebook (default: 'None')\n -l LANGUAGE, --language LANGUAGE\n language of the ebook (default: 'None')\n -a AUTHOR, --author AUTHOR\n author of the ebook (default: '[]')\n -ff FILENAME_FORMAT, --filename-format FILENAME_FORMAT\n the output filename format (default: TXT_FILENAME [EBOOK_FILENAME])\n 1 - title_authors.EBOOK_EXTENSION\n 2 - authors_title.EBOOK_EXTENSION\n -ps SEPARATOR, --paragraph_separator SEPARATOR\n paragraph separator (default: '\\n\\n')\n -pz PAGE_SIZE, --page-size PAGE_SIZE\n page size of the ebook (default: 'None')\n -rd REGEX, --regex-delete REGEX\n regex to delete word or phrase (default: '[]')\n -rvc REGEX, --regex-volume-chapter REGEX\n regex to parse volume and chapter header (default: by LANGUAGE)\n -rv REGEX, --regex-volume REGEX\n regex to parse volume header (default: by LANGUAGE)\n -rc REGEX, --regex-chapter REGEX\n regex to parse chapter header (default: by LANGUAGE)\n -rt REGEX, --regex-title REGEX\n regex to parse title of the book (default: by LANGUAGE)\n -ra REGEX, --regex-author REGEX\n regex to parse author of the book (default: by LANGUAGE)\n -rl REGEX, --regex-delete-line REGEX\n regex to delete whole line (default: '[]')\n -rr REGEX REGEX, --regex-replace REGEX REGEX\n regex to search and replace (default: '[]')\n -tp, --test-parsing\n test parsing for volume/chapter header\n -rw, --raise-on-warning\n raise exception and stop parsing upon warning\n -ow, --overwrite\n overwrite massaged TXT_FILENAME\n -v, --verbose\n show verbosity of debugging log, use -vv, -vvv for more details\n -d, --debug\n show debugging log and stacktrace\n -h, --help\n show this help message and exit\n -V, --version\n show program's version number and exit\n\n--format epub:\n -c IMAGE_FILENAME, --cover IMAGE_FILENAME\n cover of the ebook\n -et {clean,noindent,condense}, --epub-template {clean,noindent,condense}\n CSS template for epub ebook (default: 'clean')\n -vp, --volume-page\n generate each volume as separate page\n\n--format txt:\n -w WIDTH, --width WIDTH\n width for line wrapping\n -sp, --split-volume-and-chapter\n split volume or chapter into separate file and ignore the --overwrite option\n -toc, --table-of-content\n add table of content\n\n--language zh-cn / --language zh-tw:\n -hn, --header-number\n convert section header from words to numbers\n -fw, --fullwidth\n convert ASCII character from halfwidth to fullwidth\n```\n\nConvert a txt file into epub:\n\n```console\ntxt2ebook ebook.txt\n```\n\n## Copyright and License\n\nCopyright (c) 2021,2022,2023 Kian-Meng Ang\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Affero General Public License as published by the Free\nSoftware Foundation, either version 3 of the License, or (at your option) any\nlater version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License along\nwith this program. If not, see <https://www.gnu.org/licenses/>.\n",
|
47
|
-
'author': 'Kian-Meng Ang',
|
48
|
-
'author_email': 'kianmeng@cpan.org',
|
49
|
-
'maintainer': 'None',
|
50
|
-
'maintainer_email': 'None',
|
51
|
-
'url': 'https://github.com/kianmeng/txt2ebook',
|
52
|
-
'package_dir': package_dir,
|
53
|
-
'packages': packages,
|
54
|
-
'package_data': package_data,
|
55
|
-
'install_requires': install_requires,
|
56
|
-
'entry_points': entry_points,
|
57
|
-
'python_requires': '>=3.7,<4.0',
|
58
|
-
}
|
59
|
-
|
60
|
-
|
61
|
-
setup(**setup_kwargs)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|