txt2ebook 0.1.78__py3-none-any.whl → 0.1.81__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.78"
25
+ __version__ = "0.1.81"
26
26
 
27
27
 
28
28
  def setup_logger(config: argparse.Namespace) -> None:
@@ -62,9 +62,10 @@ def log_or_raise_on_warning(msg: str, raise_on_warning: bool = False) -> None:
62
62
 
63
63
  def print_env() -> None:
64
64
  """Print environment details for bug reporting."""
65
+ sys_version = sys.version.replace("\n", "")
65
66
  print(
66
67
  f"txt2ebook: {__version__}",
67
- f"python: {sys.version}",
68
+ f"python: {sys_version}",
68
69
  f"platform: {platform.platform()}",
69
70
  sep="\n",
70
71
  )
txt2ebook/formats/pdf.py CHANGED
@@ -16,6 +16,7 @@
16
16
  """Convert and back source text file into text as well."""
17
17
 
18
18
  import logging
19
+ from pathlib import Path
19
20
  from typing import List, Tuple
20
21
 
21
22
  import reportlab
@@ -86,6 +87,9 @@ class PdfWriter(BaseWriter):
86
87
  pdf, onFirstPage=self._cover_page, onLaterPages=self._regular_page
87
88
  )
88
89
 
90
+ if self.config.open:
91
+ self._open_file(Path(self.doc.filename))
92
+
89
93
  def _cover_page(self, canvas, _doc) -> None:
90
94
  (page_width, page_height) = self._get_pagesize()
91
95
  canvas.saveState()
txt2ebook/formats/typ.py CHANGED
@@ -83,7 +83,7 @@ class TypWriter(BaseWriter):
83
83
  level: 1
84
84
  ): it => block(width: 100%)[
85
85
  #set align(center)
86
- #set text(12pt, weight: "regular")
86
+ #set text(16pt, weight: "regular")
87
87
  #smallcaps(it.body)
88
88
  ]
89
89
 
@@ -91,17 +91,16 @@ class TypWriter(BaseWriter):
91
91
  level: 2
92
92
  ): it => block(width: 100%)[
93
93
  #set align(center)
94
- #set text(12pt, weight: "regular")
94
+ #set text(14pt, weight: "regular")
95
95
  #smallcaps(it.body)
96
96
  ]
97
97
 
98
98
  #set par(
99
99
  justify: true,
100
- first-line-indent: 2em,
101
100
  )
102
101
  #set text(
103
102
  font: "Noto Serif CJK SC",
104
- size: 11pt,
103
+ size: 12pt,
105
104
  )
106
105
 
107
106
  """
@@ -1,31 +1,34 @@
1
- #: src/txt2ebook/formats/base.py:141
1
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:141
2
2
  msgid "title:"
3
3
  msgstr "Title:"
4
4
 
5
- #: src/txt2ebook/formats/base.py:142
5
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:142
6
6
  msgid "author:"
7
7
  msgstr "Author:"
8
8
 
9
- #: src/txt2ebook/formats/base.py:143
9
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:143
10
10
  msgid "translator:"
11
11
  msgstr "Translator:"
12
12
 
13
- #: src/txt2ebook/formats/base.py:144
13
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:144
14
14
  msgid "tag:"
15
15
  msgstr "Tag:"
16
16
 
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:126
19
- #: src/txt2ebook/formats/txt.py:71
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
20
22
  msgid "toc"
21
23
  msgstr "Table of Content"
22
24
 
23
- #: src/txt2ebook/formats/epub.py:147
25
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/epub.py:147
24
26
  msgid "cover"
25
27
  msgstr "Cover"
26
28
 
27
- #: src/txt2ebook/formats/gmi.py:47 src/txt2ebook/formats/md.py:46
28
- #: src/txt2ebook/formats/txt.py:56
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
29
32
  msgid "metadata"
30
33
  msgstr "Metadata"
31
34
 
@@ -1,31 +1,34 @@
1
- #: src/txt2ebook/formats/base.py:141
1
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:141
2
2
  msgid "title:"
3
3
  msgstr ""
4
4
 
5
- #: src/txt2ebook/formats/base.py:142
5
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:142
6
6
  msgid "author:"
7
7
  msgstr ""
8
8
 
9
- #: src/txt2ebook/formats/base.py:143
9
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:143
10
10
  msgid "translator:"
11
11
  msgstr ""
12
12
 
13
- #: src/txt2ebook/formats/base.py:144
13
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:144
14
14
  msgid "tag:"
15
15
  msgstr ""
16
16
 
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:126
19
- #: src/txt2ebook/formats/txt.py:71
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
20
22
  msgid "toc"
21
23
  msgstr ""
22
24
 
23
- #: src/txt2ebook/formats/epub.py:147
25
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/epub.py:147
24
26
  msgid "cover"
25
27
  msgstr ""
26
28
 
27
- #: src/txt2ebook/formats/gmi.py:47 src/txt2ebook/formats/md.py:46
28
- #: src/txt2ebook/formats/txt.py:56
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
29
32
  msgid "metadata"
30
33
  msgstr ""
31
34
 
@@ -1,31 +1,34 @@
1
- #: src/txt2ebook/formats/base.py:141
1
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:141
2
2
  msgid "title:"
3
3
  msgstr "书名:"
4
4
 
5
- #: src/txt2ebook/formats/base.py:142
5
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:142
6
6
  msgid "author:"
7
7
  msgstr "作者:"
8
8
 
9
- #: src/txt2ebook/formats/base.py:143
9
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:143
10
10
  msgid "translator:"
11
11
  msgstr "翻译:"
12
12
 
13
- #: src/txt2ebook/formats/base.py:144
13
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:144
14
14
  msgid "tag:"
15
15
  msgstr "票签:"
16
16
 
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:126
19
- #: src/txt2ebook/formats/txt.py:71
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
20
22
  msgid "toc"
21
23
  msgstr "目录"
22
24
 
23
- #: src/txt2ebook/formats/epub.py:147
25
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/epub.py:147
24
26
  msgid "cover"
25
27
  msgstr "封面"
26
28
 
27
- #: src/txt2ebook/formats/gmi.py:47 src/txt2ebook/formats/md.py:46
28
- #: src/txt2ebook/formats/txt.py:56
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
29
32
  msgid "metadata"
30
33
  msgstr "元数据"
31
34
 
@@ -1,31 +1,34 @@
1
- #: src/txt2ebook/formats/base.py:141
1
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:141
2
2
  msgid "title:"
3
3
  msgstr "书名:"
4
4
 
5
- #: src/txt2ebook/formats/base.py:142
5
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:142
6
6
  msgid "author:"
7
7
  msgstr "作者:"
8
8
 
9
- #: src/txt2ebook/formats/base.py:143
9
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:143
10
10
  msgid "translator:"
11
11
  msgstr "翻译:"
12
12
 
13
- #: src/txt2ebook/formats/base.py:144
13
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:144
14
14
  msgid "tag:"
15
15
  msgstr "标签:"
16
16
 
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:126
19
- #: src/txt2ebook/formats/txt.py:71
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
20
22
  msgid "toc"
21
23
  msgstr "目录"
22
24
 
23
- #: src/txt2ebook/formats/epub.py:147
25
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/epub.py:147
24
26
  msgid "cover"
25
27
  msgstr "封面"
26
28
 
27
- #: src/txt2ebook/formats/gmi.py:47 src/txt2ebook/formats/md.py:46
28
- #: src/txt2ebook/formats/txt.py:56
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
29
32
  msgid "metadata"
30
33
  msgstr "元数据"
31
34
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: txt2ebook
3
- Version: 0.1.78
3
+ Version: 0.1.81
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
@@ -1,4 +1,4 @@
1
- txt2ebook/__init__.py,sha256=YZZtMFc394Jz4Fv8uIPr7eYOyatHaZC3RrYBb1ZXG1o,2013
1
+ txt2ebook/__init__.py,sha256=_TCqs7mbj-rTNP-FSDOlxwa265L2kRUEPgNb2K4FNLk,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=yjZsVk2L6FkUuEpyilp1XTrJeYYljws99vebiweWAKU,2395
@@ -6,26 +6,26 @@ txt2ebook/formats/base.py,sha256=5fICz70rbN9WKu0ZL1KwXsXEpDHYMry3qaFfNHilg1E,584
6
6
  txt2ebook/formats/epub.py,sha256=ZRXRnEO-qCtRIQYM9zh-VaoJfrySRdAliWr5y91l_bA,6936
7
7
  txt2ebook/formats/gmi.py,sha256=deVCwFfCE7Ys9eFTnRgZUncJX6LiUM1iXG7HXFCHlPY,6783
8
8
  txt2ebook/formats/md.py,sha256=D-6bGaNNtL11A-a8xZDVVUbfUMIdkeV6umTlsXpLSOA,6532
9
- txt2ebook/formats/pdf.py,sha256=jtYuOrqwzWyG-0rpRreXWzs2jyypwiQfomijkXAe1Z0,7168
9
+ txt2ebook/formats/pdf.py,sha256=Mz-h300tKc_-NcqL6YZTTAPaBk0i9e0323LXFR8bR0U,7276
10
10
  txt2ebook/formats/templates/__init__.py,sha256=PmObHFVHXD0GIw4328g1i1KoBks1m5-7u00XMNgb38U,755
11
11
  txt2ebook/formats/templates/epub/__init__.py,sha256=DeIsL4WDqgTU7zCLxlCidFItvG4Nl4TMKWeoeTcUuuo,761
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
15
  txt2ebook/formats/txt.py,sha256=8PkJ54r-0saZYyYEH64nYSkM-oW5LnurCbAk6d2Ue78,7536
16
- txt2ebook/formats/typ.py,sha256=LTQKe5EOot2BmaP5nYgFGnnQv2bDwjXqXWfJPcAoR0g,5234
16
+ txt2ebook/formats/typ.py,sha256=79WQyaexmNVJ0Xh7ykNjpwcS0vK7sdkSlrOBm-uV6dA,5200
17
17
  txt2ebook/helpers/__init__.py,sha256=cQmFjEsEEI0gRxDPL-284FMS5Z-iBMcu-4qe7Icf7is,1971
18
18
  txt2ebook/languages/__init__.py,sha256=oShuwgKn784v_XYrAKQM2x1h0-KEsJPeia9XWMnJTYU,758
19
19
  txt2ebook/languages/en.py,sha256=LVZsvr6JLbQFrfI1XSYG54mFwzlHa0fhKghlUemkQbo,920
20
20
  txt2ebook/languages/zh_cn.py,sha256=_3DnB7mDW_EJW3-jy9ZfnxIZ85zNgfXqzPoc7daBHIY,1930
21
21
  txt2ebook/languages/zh_tw.py,sha256=ISjDXJes-jbOUC_5RDH8Bsc0ttBf-4Dt2HNDEBxwRgE,1464
22
22
  txt2ebook/locales/en/LC_MESSAGES/txt2ebook.mo,sha256=Ym6soeijV3zsv9FUPWlJnu18-CNb5tcOTN5JsMOfV9c,672
23
- txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po,sha256=kteGa2ZfuM3K0YpuUFzeuZCrW3OwsJANbWwOyj-ZmPg,698
24
- txt2ebook/locales/txt2ebook.pot,sha256=O6sRM9qorlogmhZMo-gK4u5A0llYaI93kRNdLf3ff6o,641
23
+ txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po,sha256=Idp783OJpRQGvohvt_nCaNfg1gz2QAcyDKXwJZ5-iZ8,1214
24
+ txt2ebook/locales/txt2ebook.pot,sha256=mVjjv_qcm498tOU5-avSv_2Qi97J9Hi6p6XWKId6_tc,1157
25
25
  txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo,sha256=rRGW7HByDVZV8WpQkhyIFOWYNTQc4NnStrn0eGJX8Wc,675
26
- txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po,sha256=_U-CV9Y2uKY0BSrz3AzMKZAZQIxdg78PvvKJJjztDpY,698
26
+ txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po,sha256=P5EHatQZg6G7ZDbs29v6VicNWKi6plCyRRPgYpjz9Qs,1214
27
27
  txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo,sha256=1GIuOcO_bISiFcfhFez-A7mSi11Mo-x3PBobBENgMEc,675
28
- txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po,sha256=-ZWFc5Elhzbps7sCxiiRpACSfKkqZt4B8gNuU-9iWQ8,698
28
+ txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po,sha256=bEQxFGwdkAX3or1VSMTNDnjUijJ4ZnSENefzreXPkL4,1214
29
29
  txt2ebook/models/__init__.py,sha256=8_k1oI_PnPMekhdZCXiTtg5WghdR6fugQEHJHsy1-Ds,925
30
30
  txt2ebook/models/book.py,sha256=GYXvklHnLIuodEgbjzulyA0OSX72K37ohGBn8xDwCgw,2759
31
31
  txt2ebook/models/chapter.py,sha256=buECAklNQgM3tDehzyVO9YfA_F0iXyLq2PaMZGV_Zaw,1681
@@ -34,8 +34,8 @@ txt2ebook/parser.py,sha256=vdC--8I2c89xve7OA1OkYTDjSMwwKoyv4Wkmca0iFhE,11823
34
34
  txt2ebook/tokenizer.py,sha256=y1CQ3Xf5g74o_mUZSOwrwwu0grKmgmt6x3yxCWWokhU,9318
35
35
  txt2ebook/txt2ebook.py,sha256=Nwf30JA5aAXwHZEH1bnqXtD_eT3QBbpHQfsG4DP9uAc,13212
36
36
  txt2ebook/zh_utils.py,sha256=EgKVbwqYGaTGswQUGcOCeSfRelzwkAb9WWY9TrsX1x4,4882
37
- txt2ebook-0.1.78.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
38
- txt2ebook-0.1.78.dist-info/METADATA,sha256=EODGEpu8fdUSrMfTrW2wByCauBpAu2xccVVy7oqjieM,7388
39
- txt2ebook-0.1.78.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
40
- txt2ebook-0.1.78.dist-info/entry_points.txt,sha256=IQHyIIhd0MHjSSRVC1a6tMeIoLus8D06KHL_cumvEbg,83
41
- txt2ebook-0.1.78.dist-info/RECORD,,
37
+ txt2ebook-0.1.81.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
38
+ txt2ebook-0.1.81.dist-info/METADATA,sha256=wOCWGoN2LiF9DMu554ChEraLRR55Fb7aCk_KJ0kCviQ,7388
39
+ txt2ebook-0.1.81.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
40
+ txt2ebook-0.1.81.dist-info/entry_points.txt,sha256=IQHyIIhd0MHjSSRVC1a6tMeIoLus8D06KHL_cumvEbg,83
41
+ txt2ebook-0.1.81.dist-info/RECORD,,