markdown_convert 1.2.21__py3-none-any.whl → 1.2.23__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.
- markdown_convert/__main__.py +7 -7
- markdown_convert/modules/constants.py +1 -1
- markdown_convert/modules/convert.py +40 -22
- markdown_convert/modules/resources.py +14 -11
- markdown_convert/modules/validate.py +5 -5
- markdown_convert-1.2.23.dist-info/METADATA +104 -0
- markdown_convert-1.2.23.dist-info/RECORD +15 -0
- markdown_convert-1.2.21.dist-info/METADATA +0 -79
- markdown_convert-1.2.21.dist-info/RECORD +0 -15
- {markdown_convert-1.2.21.dist-info → markdown_convert-1.2.23.dist-info}/WHEEL +0 -0
- {markdown_convert-1.2.21.dist-info → markdown_convert-1.2.23.dist-info}/entry_points.txt +0 -0
- {markdown_convert-1.2.21.dist-info → markdown_convert-1.2.23.dist-info}/licenses/LICENSE +0 -0
markdown_convert/__main__.py
CHANGED
|
@@ -32,8 +32,8 @@ def main():
|
|
|
32
32
|
|
|
33
33
|
# Get the markdown path
|
|
34
34
|
try:
|
|
35
|
-
|
|
36
|
-
validate_markdown_path(
|
|
35
|
+
markdown_path = arg["markdown_file_path"]
|
|
36
|
+
validate_markdown_path(markdown_path)
|
|
37
37
|
except KeyError as key_err:
|
|
38
38
|
raise IndexError("Missing 'markdown_file_path' argument.") from key_err
|
|
39
39
|
except Exception as exc:
|
|
@@ -61,18 +61,18 @@ def main():
|
|
|
61
61
|
try:
|
|
62
62
|
output_path = arg["--out"]
|
|
63
63
|
validate_output_path(output_path)
|
|
64
|
-
output_path = get_output_path(
|
|
64
|
+
output_path = get_output_path(markdown_path, output_path)
|
|
65
65
|
except KeyError:
|
|
66
|
-
output_path = get_output_path(
|
|
66
|
+
output_path = get_output_path(markdown_path, None)
|
|
67
67
|
except Exception as exc:
|
|
68
68
|
raise IndexError(f"Invalid 'output_path' argument: {exc}") from exc
|
|
69
69
|
|
|
70
70
|
# Compile the markdown file
|
|
71
|
-
print(f"\nGenerating PDF file from '{
|
|
71
|
+
print(f"\nGenerating PDF file from '{markdown_path}'...\n")
|
|
72
72
|
if mode in ("once", "debug"):
|
|
73
|
-
convert(
|
|
73
|
+
convert(markdown_path, css_path, output_path, dump_html=mode == "debug")
|
|
74
74
|
else:
|
|
75
|
-
live_convert(
|
|
75
|
+
live_convert(markdown_path, css_path, output_path)
|
|
76
76
|
|
|
77
77
|
sys_exit(0)
|
|
78
78
|
|
|
@@ -14,7 +14,7 @@ OPTIONS = ("markdown_file_path", "--mode", "--css", "--out", "-h", "--help")
|
|
|
14
14
|
|
|
15
15
|
OPTIONS_MODES = ("once", "live", "debug")
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
MARKDOWN_EXTENSIONS = {
|
|
18
18
|
"fenced-code-blocks": None,
|
|
19
19
|
"header-ids": True,
|
|
20
20
|
"breaks": {"on_newline": True},
|
|
@@ -12,7 +12,7 @@ from pathlib import Path
|
|
|
12
12
|
import markdown2
|
|
13
13
|
from playwright.sync_api import sync_playwright
|
|
14
14
|
|
|
15
|
-
from .constants import
|
|
15
|
+
from .constants import MARKDOWN_EXTENSIONS
|
|
16
16
|
from .resources import get_code_css_path, get_css_path, get_output_path
|
|
17
17
|
from .utils import drop_duplicates
|
|
18
18
|
|
|
@@ -35,8 +35,8 @@ def _generate_pdf_with_playwright(
|
|
|
35
35
|
base_dir (Path, optional): Base directory for resolving relative paths in HTML.
|
|
36
36
|
dump_html (bool, optional): Whether to dump the HTML content to a file.
|
|
37
37
|
"""
|
|
38
|
-
with sync_playwright() as
|
|
39
|
-
browser =
|
|
38
|
+
with sync_playwright() as playwright:
|
|
39
|
+
browser = playwright.chromium.launch(headless=True)
|
|
40
40
|
page = browser.new_page()
|
|
41
41
|
|
|
42
42
|
# Handle loading based on presence of base_dir
|
|
@@ -55,7 +55,12 @@ def _generate_pdf_with_playwright(
|
|
|
55
55
|
pdf_params = {
|
|
56
56
|
"format": "A4",
|
|
57
57
|
"print_background": True,
|
|
58
|
-
"margin": {
|
|
58
|
+
"margin": {
|
|
59
|
+
"top": "20mm",
|
|
60
|
+
"bottom": "20mm",
|
|
61
|
+
"left": "20mm",
|
|
62
|
+
"right": "20mm",
|
|
63
|
+
},
|
|
59
64
|
"path": output_path,
|
|
60
65
|
} # Playwright ignores None paths
|
|
61
66
|
|
|
@@ -101,7 +106,7 @@ def _create_sections(html):
|
|
|
101
106
|
|
|
102
107
|
|
|
103
108
|
def convert(
|
|
104
|
-
|
|
109
|
+
markdown_path,
|
|
105
110
|
css_path=None,
|
|
106
111
|
output_path=None,
|
|
107
112
|
*,
|
|
@@ -112,7 +117,7 @@ def convert(
|
|
|
112
117
|
Convert a markdown file to a pdf file.
|
|
113
118
|
|
|
114
119
|
Args:
|
|
115
|
-
|
|
120
|
+
markdown_path (str): Path to the markdown file.
|
|
116
121
|
css_path (str=None): Path to the CSS file.
|
|
117
122
|
output_path (str=None): Path to the output file.
|
|
118
123
|
extend_default_css (bool=True): Extend the default CSS file.
|
|
@@ -122,7 +127,7 @@ def convert(
|
|
|
122
127
|
css_path = get_css_path()
|
|
123
128
|
|
|
124
129
|
if output_path is None:
|
|
125
|
-
output_path = get_output_path(
|
|
130
|
+
output_path = get_output_path(markdown_path, None)
|
|
126
131
|
|
|
127
132
|
if extend_default_css:
|
|
128
133
|
css_sources = [get_code_css_path(), get_css_path(), css_path]
|
|
@@ -132,14 +137,14 @@ def convert(
|
|
|
132
137
|
css_sources = drop_duplicates(css_sources)
|
|
133
138
|
|
|
134
139
|
try:
|
|
135
|
-
html = markdown2.markdown_path(
|
|
140
|
+
html = markdown2.markdown_path(markdown_path, extras=MARKDOWN_EXTENSIONS)
|
|
136
141
|
html = _create_sections(html)
|
|
137
142
|
|
|
138
143
|
_generate_pdf_with_playwright(
|
|
139
144
|
html,
|
|
140
145
|
output_path,
|
|
141
146
|
css_content=_get_css_content(css_sources),
|
|
142
|
-
base_dir=Path(
|
|
147
|
+
base_dir=Path(markdown_path).resolve().parent,
|
|
143
148
|
dump_html=dump_html,
|
|
144
149
|
)
|
|
145
150
|
|
|
@@ -147,12 +152,14 @@ def convert(
|
|
|
147
152
|
raise RuntimeError(exc) from exc
|
|
148
153
|
|
|
149
154
|
|
|
150
|
-
def live_convert(
|
|
155
|
+
def live_convert(
|
|
156
|
+
markdown_path, css_path=None, output_path=None, *, extend_default_css=True
|
|
157
|
+
):
|
|
151
158
|
"""
|
|
152
159
|
Convert a markdown file to a pdf file and watch for changes.
|
|
153
160
|
|
|
154
161
|
Args:
|
|
155
|
-
|
|
162
|
+
markdown_path (str): Path to the markdown file.
|
|
156
163
|
css_path (str=None): Path to the CSS file.
|
|
157
164
|
output_path (str=None): Path to the output file.
|
|
158
165
|
extend_default_css (bool=True): Extend the default CSS file.
|
|
@@ -161,10 +168,10 @@ def live_convert(md_path, css_path=None, output_path=None, *, extend_default_css
|
|
|
161
168
|
css_path = get_css_path()
|
|
162
169
|
|
|
163
170
|
if output_path is None:
|
|
164
|
-
output_path = get_output_path(
|
|
171
|
+
output_path = get_output_path(markdown_path, None)
|
|
165
172
|
|
|
166
173
|
live_converter = LiveConverter(
|
|
167
|
-
|
|
174
|
+
markdown_path,
|
|
168
175
|
css_path,
|
|
169
176
|
output_path,
|
|
170
177
|
extend_default_css=extend_default_css,
|
|
@@ -173,12 +180,12 @@ def live_convert(md_path, css_path=None, output_path=None, *, extend_default_css
|
|
|
173
180
|
live_converter.observe()
|
|
174
181
|
|
|
175
182
|
|
|
176
|
-
def convert_text(
|
|
183
|
+
def convert_text(markdown_text, css_text=None, *, extend_default_css=True):
|
|
177
184
|
"""
|
|
178
185
|
Convert markdown text to a pdf file.
|
|
179
186
|
|
|
180
187
|
Args:
|
|
181
|
-
|
|
188
|
+
markdown_text (str): Markdown text.
|
|
182
189
|
css_text (str=None): CSS text.
|
|
183
190
|
extend_default_css (bool=True): Extend the default CSS file.
|
|
184
191
|
|
|
@@ -197,7 +204,7 @@ def convert_text(md_text, css_text=None, *, extend_default_css=True):
|
|
|
197
204
|
css_sources = [code_css, css_text]
|
|
198
205
|
|
|
199
206
|
try:
|
|
200
|
-
html = markdown2.markdown(
|
|
207
|
+
html = markdown2.markdown(markdown_text, extras=MARKDOWN_EXTENSIONS)
|
|
201
208
|
html = _create_sections(html)
|
|
202
209
|
|
|
203
210
|
return _generate_pdf_with_playwright(
|
|
@@ -215,17 +222,25 @@ class LiveConverter:
|
|
|
215
222
|
Class to convert a markdown file to a pdf file and watch for changes.
|
|
216
223
|
"""
|
|
217
224
|
|
|
218
|
-
def __init__(
|
|
225
|
+
def __init__(
|
|
226
|
+
self,
|
|
227
|
+
markdown_path,
|
|
228
|
+
css_path,
|
|
229
|
+
output_path,
|
|
230
|
+
*,
|
|
231
|
+
extend_default_css=True,
|
|
232
|
+
loud=False,
|
|
233
|
+
):
|
|
219
234
|
"""
|
|
220
235
|
Initialize the LiveConverter class.
|
|
221
236
|
|
|
222
237
|
Args:
|
|
223
|
-
|
|
238
|
+
markdown_path (str): Path to the markdown file.
|
|
224
239
|
css_path (str): Path to the CSS file.
|
|
225
240
|
output_path (str): Path to the output file.
|
|
226
241
|
extend_default_css (bool): Extend the default CSS file.
|
|
227
242
|
"""
|
|
228
|
-
self.md_path = Path(
|
|
243
|
+
self.md_path = Path(markdown_path).absolute()
|
|
229
244
|
self.css_path = Path(css_path).absolute()
|
|
230
245
|
self.output_path = output_path
|
|
231
246
|
self.extend_default_css = extend_default_css
|
|
@@ -272,14 +287,17 @@ class LiveConverter:
|
|
|
272
287
|
try:
|
|
273
288
|
while True:
|
|
274
289
|
|
|
275
|
-
|
|
290
|
+
markdown_modified = self.get_last_modified_date(self.md_path)
|
|
276
291
|
css_modified = self.get_last_modified_date(self.css_path)
|
|
277
292
|
|
|
278
|
-
if
|
|
293
|
+
if (
|
|
294
|
+
markdown_modified != self.md_last_modified
|
|
295
|
+
or css_modified != self.css_last_modified
|
|
296
|
+
):
|
|
279
297
|
|
|
280
298
|
self.write_pdf()
|
|
281
299
|
|
|
282
|
-
self.md_last_modified =
|
|
300
|
+
self.md_last_modified = markdown_modified
|
|
283
301
|
self.css_last_modified = css_modified
|
|
284
302
|
|
|
285
303
|
time.sleep(poll_interval)
|
|
@@ -17,28 +17,28 @@ from .constants import BLUE, CYAN, GREEN, YELLOW, OPTIONS, OPTIONS_MODES
|
|
|
17
17
|
from .utils import color
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
def get_output_path(
|
|
20
|
+
def get_output_path(markdown_path, output_dir=None):
|
|
21
21
|
"""
|
|
22
22
|
Get the output path for the pdf file.
|
|
23
23
|
|
|
24
24
|
Args:
|
|
25
|
-
|
|
25
|
+
markdown_path (str): The path to the markdown file.
|
|
26
26
|
output_dir (str): The output directory.
|
|
27
27
|
|
|
28
28
|
Returns:
|
|
29
29
|
str: The output path.
|
|
30
30
|
"""
|
|
31
|
-
|
|
31
|
+
markdown_path = Path(markdown_path)
|
|
32
32
|
|
|
33
33
|
if output_dir is None:
|
|
34
|
-
return
|
|
34
|
+
return markdown_path.parent / f"{markdown_path.stem}.pdf"
|
|
35
35
|
|
|
36
36
|
output_dir = Path(output_dir)
|
|
37
37
|
|
|
38
38
|
if output_dir.suffix == ".pdf":
|
|
39
39
|
return output_dir
|
|
40
40
|
|
|
41
|
-
return output_dir.parent / f"{Path(
|
|
41
|
+
return output_dir.parent / f"{Path(markdown_path).stem}.pdf"
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
def get_css_path():
|
|
@@ -76,11 +76,14 @@ def get_usage():
|
|
|
76
76
|
f"{color(GREEN, 'markdown-convert')} "
|
|
77
77
|
f"[{color(YELLOW, OPTIONS[0])}] [{color(BLUE, 'options')}]"
|
|
78
78
|
)
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
option_one = (
|
|
80
|
+
f"{color(BLUE, OPTIONS[1])}{color(CYAN, '=')}"
|
|
81
|
+
f"{color(CYAN, '|'.join(OPTIONS_MODES))}"
|
|
82
|
+
)
|
|
83
|
+
option_two = (
|
|
81
84
|
f"{color(BLUE, OPTIONS[2])}{color(CYAN, '=')}[{color(CYAN, 'css_file_path')}]"
|
|
82
85
|
)
|
|
83
|
-
|
|
86
|
+
option_three = f"{color(BLUE, OPTIONS[3])}{color(CYAN, '=')}[{color(CYAN, 'output_file_path')}]"
|
|
84
87
|
|
|
85
88
|
usage = (
|
|
86
89
|
"\n"
|
|
@@ -88,11 +91,11 @@ def get_usage():
|
|
|
88
91
|
f" {commd}\n"
|
|
89
92
|
"\n"
|
|
90
93
|
"Options:\n"
|
|
91
|
-
f" {
|
|
94
|
+
f" {option_one}\n"
|
|
92
95
|
" Convert the markdown file once (default) or live.\n"
|
|
93
|
-
f" {
|
|
96
|
+
f" {option_two}\n"
|
|
94
97
|
" Use a custom CSS file.\n"
|
|
95
|
-
f" {
|
|
98
|
+
f" {option_three}\n"
|
|
96
99
|
" Specify the output file path.\n"
|
|
97
100
|
)
|
|
98
101
|
return usage
|
|
@@ -6,21 +6,21 @@ Author: @julynx
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
def validate_markdown_path(
|
|
9
|
+
def validate_markdown_path(markdown_path):
|
|
10
10
|
"""
|
|
11
11
|
Validate the markdown file path.
|
|
12
12
|
|
|
13
13
|
Args:
|
|
14
|
-
|
|
14
|
+
markdown_path (str): The path to the markdown file.
|
|
15
15
|
|
|
16
16
|
Raises:
|
|
17
17
|
FileNotFoundError: If the file is not found.
|
|
18
18
|
ValueError: If the file is not a Markdown file.
|
|
19
19
|
"""
|
|
20
|
-
if not Path(
|
|
21
|
-
raise FileNotFoundError(f"File not found: '{
|
|
20
|
+
if not Path(markdown_path).is_file():
|
|
21
|
+
raise FileNotFoundError(f"File not found: '{markdown_path}'")
|
|
22
22
|
|
|
23
|
-
if not
|
|
23
|
+
if not markdown_path.endswith(".md"):
|
|
24
24
|
raise ValueError("File must be a Markdown file.")
|
|
25
25
|
|
|
26
26
|
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: markdown_convert
|
|
3
|
+
Version: 1.2.23
|
|
4
|
+
Summary: Convert Markdown files to PDF from your command line.
|
|
5
|
+
Project-URL: homepage, https://github.com/Julynx/markdown_convert
|
|
6
|
+
Author-email: Julio Cabria <juliocabria@tutanota.com>
|
|
7
|
+
License: GPL-2.0-only
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: <3.15,>=3.9
|
|
13
|
+
Requires-Dist: argsdict==1.0.0
|
|
14
|
+
Requires-Dist: latex2mathml>=3.78.1
|
|
15
|
+
Requires-Dist: markdown2<3,>=2.4.13
|
|
16
|
+
Requires-Dist: playwright>=1.57.0
|
|
17
|
+
Requires-Dist: pygments<3,>=2.17.2
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# markdown-convert
|
|
21
|
+
|
|
22
|
+
_Convert Markdown files to PDF from your command line._
|
|
23
|
+
|
|
24
|
+
`pip install markdown-convert`
|
|
25
|
+
|
|
26
|
+
<br>
|
|
27
|
+
|
|
28
|
+
[](https://github.com/Julynx/markdown-convert)
|
|
29
|
+
[](https://pypi.org/project/markdown_convert)
|
|
30
|
+
|
|
31
|
+
<br>
|
|
32
|
+
|
|
33
|
+
<img src='https://i.imgur.com/uWDm7s0.png' width='80%'>
|
|
34
|
+
|
|
35
|
+
----
|
|
36
|
+
|
|
37
|
+
- [markdown-convert](#markdown-convert)
|
|
38
|
+
- [Why `markdown-convert`?](#why-markdown-convert)
|
|
39
|
+
- [Installation](#installation)
|
|
40
|
+
- [Usage](#usage)
|
|
41
|
+
- [1. From your terminal](#1-from-your-terminal)
|
|
42
|
+
- [2. As a Python library](#2-as-a-python-library)
|
|
43
|
+
- [3. From the context menu of your file explorer](#3-from-the-context-menu-of-your-file-explorer)
|
|
44
|
+
|
|
45
|
+
## Why `markdown-convert`?
|
|
46
|
+
|
|
47
|
+
Unlike other similar tools, `markdown-convert`:
|
|
48
|
+
|
|
49
|
+
- Can be fully installed via `pip install markdown-convert`, with no external system-level dependencies.
|
|
50
|
+
- Comes with a sensible default CSS stylesheet out of the box.
|
|
51
|
+
- Supports:
|
|
52
|
+
- **LaTeX math equations:** `$...$` for inline and `$$...$$` for block equations.
|
|
53
|
+
- **Syntax highlighting for code blocks:** Applied automatically based on the specified language.
|
|
54
|
+
- **Live conversion:** `markdown-convert file.md --mode=live` updates the PDF every time the Markdown file changes.
|
|
55
|
+
- **Custom CSS** `markdown-convert file.md --css=style.css` extends the default CSS with your own stylesheet.
|
|
56
|
+
- **Pipe tables, header links, CSS paged media features and more!**
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
`markdown-convert` is available on PyPI and can be installed via pip:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install markdown-convert
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Usage
|
|
67
|
+
|
|
68
|
+
### 1. From your terminal
|
|
69
|
+
|
|
70
|
+
Simply run `markdown-convert file.md` to convert `file.md` to `file.pdf`.
|
|
71
|
+
|
|
72
|
+
You can specify the following options:
|
|
73
|
+
|
|
74
|
+
- `--mode=once|live`: Convert the markdown file once (default) or live.
|
|
75
|
+
- `--css=[css_file_path]`: Use a custom CSS file.
|
|
76
|
+
- `--out=[output_file_path]`: Specify the output file path.
|
|
77
|
+
|
|
78
|
+
For example: `markdown-convert README.md --mode=live --css=style.css --out=output.pdf` will convert `README.md` to `output.pdf` using `style.css` and update the PDF live as you edit the Markdown file.
|
|
79
|
+
|
|
80
|
+
### 2. As a Python library
|
|
81
|
+
|
|
82
|
+
You can also use `markdown-convert` as a library in your Python code:
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
from markdown_convert import convert, convert_text, live_convert
|
|
86
|
+
|
|
87
|
+
# Convert your Markdown file and save it as a PDF file
|
|
88
|
+
convert('README.md', 'style.css', 'README.pdf')
|
|
89
|
+
|
|
90
|
+
# Convert your Markdown string and get the PDF bytes
|
|
91
|
+
pdf_bytes = convert_text('# Hello World', 'h1 { color: red; }')
|
|
92
|
+
|
|
93
|
+
# Convert your Markdown file to PDF every time it changes
|
|
94
|
+
live_convert('README.md', 'style.css', 'README.pdf')
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 3. From the context menu of your file explorer
|
|
98
|
+
|
|
99
|
+
Install the extension of your choice:
|
|
100
|
+
|
|
101
|
+
- For Windows Explorer: [markdown_convert_explorer](https://github.com/Julynx/markdown_convert_explorer)
|
|
102
|
+
- For Linux (Nautilus): [markdown_convert_nautilus](https://github.com/Julynx/markdown_convert_nautilus)
|
|
103
|
+
|
|
104
|
+
Then right click any Markdown file and select `Convert to PDF` to convert it.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
markdown_convert/__init__.py,sha256=ysW3pXsDGGK4PzZHcIBTpfVW58IkDUwHffDkf_GM6UU,303
|
|
2
|
+
markdown_convert/__main__.py,sha256=hO7AO0GnzPMPNqls8r5aF2C-7l9aFHDf1m8mXSy1GBE,2809
|
|
3
|
+
markdown_convert/code.css,sha256=Wt4FqFqJcpT-jwY3GN-o4ZRCCXU8DQj-9lqKdGiuoyw,4935
|
|
4
|
+
markdown_convert/default.css,sha256=sTIJmfRWOe8SVwlhzw9CSXD44TUtgfjKCHJjf6u2O8U,2877
|
|
5
|
+
markdown_convert/modules/__init__.py,sha256=PFPgiQhMXgyfjD8BkfLC_X8AR1jz-dCxfif2qmNofJs,65
|
|
6
|
+
markdown_convert/modules/constants.py,sha256=Pdm-yoTuvUQbqWiufiydTeuA5ysSF_ZuAafRBrnXPt8,454
|
|
7
|
+
markdown_convert/modules/convert.py,sha256=MPr6CM-KNtfHEnPv0sVegOd26mlmG_v49C55MYXjW_M,8718
|
|
8
|
+
markdown_convert/modules/resources.py,sha256=tnW8JmCrJNBRbzOcaOVG6GX5jPC8Kzj3dA7gX0B935A,2488
|
|
9
|
+
markdown_convert/modules/utils.py,sha256=NX0WegM8e8MPKNNmweTujAWO8ZghdB8LSGDx20K2E44,655
|
|
10
|
+
markdown_convert/modules/validate.py,sha256=XV_k7cHeifEKDaltF26tCmabs2-Me5msP3enI_eVwfA,1517
|
|
11
|
+
markdown_convert-1.2.23.dist-info/METADATA,sha256=llxbzt0ME2aa4n_mucnYoLgFyxkWytJlrnhMIRjLOwg,3797
|
|
12
|
+
markdown_convert-1.2.23.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
+
markdown_convert-1.2.23.dist-info/entry_points.txt,sha256=RCmzC7C0sX-SpzIP2Cr34rhg3lMd7BRx-exaZPfK8bU,68
|
|
14
|
+
markdown_convert-1.2.23.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
|
15
|
+
markdown_convert-1.2.23.dist-info/RECORD,,
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: markdown_convert
|
|
3
|
-
Version: 1.2.21
|
|
4
|
-
Summary: Convert Markdown files to PDF from your command line.
|
|
5
|
-
Project-URL: homepage, https://github.com/Julynx/markdown_convert
|
|
6
|
-
Author-email: Julio Cabria <juliocabria@tutanota.com>
|
|
7
|
-
License: GPL-2.0-only
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Requires-Python: <3.15,>=3.9
|
|
13
|
-
Requires-Dist: argsdict==1.0.0
|
|
14
|
-
Requires-Dist: latex2mathml>=3.78.1
|
|
15
|
-
Requires-Dist: markdown2<3,>=2.4.13
|
|
16
|
-
Requires-Dist: playwright>=1.57.0
|
|
17
|
-
Requires-Dist: pygments<3,>=2.17.2
|
|
18
|
-
Description-Content-Type: text/markdown
|
|
19
|
-
|
|
20
|
-
# markdown-convert
|
|
21
|
-
|
|
22
|
-
_Convert Markdown files to PDF from your command line._
|
|
23
|
-
|
|
24
|
-
### `pip install markdown-convert`
|
|
25
|
-
|
|
26
|
-
<br>
|
|
27
|
-
|
|
28
|
-
[](https://github.com/Julynx/markdown-convert)
|
|
29
|
-
[](https://pypi.org/project/markdown_convert)
|
|
30
|
-
|
|
31
|
-
<br>
|
|
32
|
-
|
|
33
|
-
<img src='https://i.imgur.com/SZIz2gY.png' width='80%'>
|
|
34
|
-
|
|
35
|
-
`markdown-convert` is an elegant command-line tool that converts Markdown files to PDF, powered by the amazing `markdown2` and `playwright` libraries.
|
|
36
|
-
|
|
37
|
-
Unlike other similar tools, it relies solely on Python packages to do the job, eliminating the need for any external system-level dependencies.
|
|
38
|
-
|
|
39
|
-
### Features
|
|
40
|
-
|
|
41
|
-
- ⚡️ Supports live compilation, so you can preview your PDF in real-time as you type.
|
|
42
|
-
- 🌸 Comes with beautiful CSS out of the box, making your documents look great from the start.
|
|
43
|
-
- 🎨 Syntax highlighting for code blocks included.
|
|
44
|
-
- 🪐 Designed for the 21st century, with relative links, pipe tables, and modern CSS paged media features.
|
|
45
|
-
|
|
46
|
-
### Usage
|
|
47
|
-
|
|
48
|
-
> Note: If you just installed the package, you may need to log out and log back in for the `markdown-convert` command to be registered to your PATH.
|
|
49
|
-
|
|
50
|
-
Run `markdown-convert -h` right from your terminal to check out the available options:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
Usage:
|
|
54
|
-
markdown-convert [markdown_file_path] [options]
|
|
55
|
-
|
|
56
|
-
Options:
|
|
57
|
-
--mode=once|live
|
|
58
|
-
Convert the markdown file once (default) or live.
|
|
59
|
-
--css=[css_file_path]
|
|
60
|
-
Use a custom CSS file.
|
|
61
|
-
--out=[output_file_path]
|
|
62
|
-
Specify the output file path.
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
...or import any of the functions from the package to use them in your own code:
|
|
66
|
-
|
|
67
|
-
```python
|
|
68
|
-
from markdown_convert import convert, live_convert
|
|
69
|
-
|
|
70
|
-
# Convert your Markdown file to PDF once
|
|
71
|
-
convert('README.md', 'style.css', 'README.pdf')
|
|
72
|
-
|
|
73
|
-
# Convert your Markdown file to PDF every time it changes
|
|
74
|
-
live_convert('README.md', 'style.css', 'README.pdf')
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Integrations
|
|
78
|
-
|
|
79
|
-
Right click a Markdown file and `Convert to PDF` with the [markdown_convert_explorer](https://github.com/Julynx/markdown_convert_explorer) and [markdown_convert_nautilus](https://github.com/Julynx/markdown_convert_nautilus) extensions for Windows and Linux.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
markdown_convert/__init__.py,sha256=ysW3pXsDGGK4PzZHcIBTpfVW58IkDUwHffDkf_GM6UU,303
|
|
2
|
-
markdown_convert/__main__.py,sha256=zKgFcnxlXTRsR6AYhTdGEvQea2TVyLYeIxJSMksCMR0,2767
|
|
3
|
-
markdown_convert/code.css,sha256=Wt4FqFqJcpT-jwY3GN-o4ZRCCXU8DQj-9lqKdGiuoyw,4935
|
|
4
|
-
markdown_convert/default.css,sha256=sTIJmfRWOe8SVwlhzw9CSXD44TUtgfjKCHJjf6u2O8U,2877
|
|
5
|
-
markdown_convert/modules/__init__.py,sha256=PFPgiQhMXgyfjD8BkfLC_X8AR1jz-dCxfif2qmNofJs,65
|
|
6
|
-
markdown_convert/modules/constants.py,sha256=Yd7o0OGwliYcmBGrwoeckagc9E8p1l-zXQx_P4CuiK4,448
|
|
7
|
-
markdown_convert/modules/convert.py,sha256=cU-wATfsM5Y8WFklkw7NIa2KSrMpc50aZecO4rewua8,8346
|
|
8
|
-
markdown_convert/modules/resources.py,sha256=aMDbM7Oab8A3nRN1tc1uNkmz8JfUdLJR6rF3ZR0IElo,2384
|
|
9
|
-
markdown_convert/modules/utils.py,sha256=NX0WegM8e8MPKNNmweTujAWO8ZghdB8LSGDx20K2E44,655
|
|
10
|
-
markdown_convert/modules/validate.py,sha256=cerfQ5Qt8gBQbh-NZ57zLmDfg-Vnyo0zsEFb8RUzVCQ,1487
|
|
11
|
-
markdown_convert-1.2.21.dist-info/METADATA,sha256=ugunfrpmL6ivecjGLKnQvMmLNlU0w4qvPPm-kvizRF4,2935
|
|
12
|
-
markdown_convert-1.2.21.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
-
markdown_convert-1.2.21.dist-info/entry_points.txt,sha256=RCmzC7C0sX-SpzIP2Cr34rhg3lMd7BRx-exaZPfK8bU,68
|
|
14
|
-
markdown_convert-1.2.21.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
|
15
|
-
markdown_convert-1.2.21.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|