markdown_convert 1.2.29__tar.gz → 1.2.31__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.
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/PKG-INFO +2 -2
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/README.md +1 -1
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/markdown_convert/default.css +13 -7
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/markdown_convert/modules/convert.py +8 -1
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/markdown_convert/modules/transform.py +19 -0
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/pyproject.toml +1 -1
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/.gitignore +0 -0
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/LICENSE +0 -0
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/markdown_convert/__init__.py +0 -0
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/markdown_convert/__main__.py +0 -0
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/markdown_convert/code.css +0 -0
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/markdown_convert/modules/__init__.py +0 -0
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/markdown_convert/modules/constants.py +0 -0
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/markdown_convert/modules/resources.py +0 -0
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/markdown_convert/modules/utils.py +0 -0
- {markdown_convert-1.2.29 → markdown_convert-1.2.31}/markdown_convert/modules/validate.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: markdown_convert
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.31
|
|
4
4
|
Summary: Convert Markdown files to PDF from your command line.
|
|
5
5
|
Project-URL: homepage, https://github.com/Julynx/markdown_convert
|
|
6
6
|
Author-email: Julio Cabria <juliocabria@tutanota.com>
|
|
@@ -54,7 +54,7 @@ Unlike other similar tools, `markdown-convert`:
|
|
|
54
54
|
- **Syntax highlighting for code blocks:** Applied automatically based on the specified language.
|
|
55
55
|
- **Live conversion:** `markdown-convert file.md --mode=live` updates the PDF every time the Markdown file changes.
|
|
56
56
|
- **Custom CSS** `markdown-convert file.md --css=style.css` extends the default CSS with your own stylesheet.
|
|
57
|
-
- **Pipe tables, header links, CSS paged media features and more!**
|
|
57
|
+
- **Pipe tables, checkboxes, header links, CSS paged media features and more!**
|
|
58
58
|
|
|
59
59
|
## Installation
|
|
60
60
|
|
|
@@ -35,7 +35,7 @@ Unlike other similar tools, `markdown-convert`:
|
|
|
35
35
|
- **Syntax highlighting for code blocks:** Applied automatically based on the specified language.
|
|
36
36
|
- **Live conversion:** `markdown-convert file.md --mode=live` updates the PDF every time the Markdown file changes.
|
|
37
37
|
- **Custom CSS** `markdown-convert file.md --css=style.css` extends the default CSS with your own stylesheet.
|
|
38
|
-
- **Pipe tables, header links, CSS paged media features and more!**
|
|
38
|
+
- **Pipe tables, checkboxes, header links, CSS paged media features and more!**
|
|
39
39
|
|
|
40
40
|
## Installation
|
|
41
41
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
/* -- Standard margins */
|
|
3
|
-
--top-margin: 0.
|
|
3
|
+
--top-margin: 0.75em;
|
|
4
4
|
--bottom-margin: 0.5em;
|
|
5
5
|
--left-margin: 1.5em;
|
|
6
6
|
|
|
7
7
|
/* -- Small margins */
|
|
8
8
|
--left-margin-small: 1em;
|
|
9
|
+
--top-margin-small: 0.25em;
|
|
10
|
+
--bottom-margin-small: 0.15em;
|
|
9
11
|
|
|
10
12
|
/* -- Big margins */
|
|
11
13
|
--left-margin-big: 2em;
|
|
@@ -49,23 +51,27 @@ p {
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
h1 {
|
|
52
|
-
font-size: 2.
|
|
54
|
+
font-size: 2.2rem;
|
|
55
|
+
border-bottom: 0.5px solid #999;
|
|
56
|
+
padding-bottom: var(--bottom-margin-small);
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
h2 {
|
|
56
|
-
font-size:
|
|
60
|
+
font-size: 1.8rem;
|
|
61
|
+
border-bottom: 0.5px solid #999;
|
|
62
|
+
padding-bottom: var(--bottom-margin-small);
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
h3 {
|
|
60
|
-
font-size: 1.
|
|
66
|
+
font-size: 1.4rem;
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
h4 {
|
|
64
|
-
font-size: 1.
|
|
70
|
+
font-size: 1.2rem;
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
h5 {
|
|
68
|
-
font-size:
|
|
74
|
+
font-size: 1rem;
|
|
69
75
|
}
|
|
70
76
|
|
|
71
77
|
p {
|
|
@@ -98,7 +104,7 @@ ul ul {
|
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
li {
|
|
101
|
-
margin-top: var(--top-margin);
|
|
107
|
+
margin-top: var(--top-margin-small);
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
/* Code blocks */
|
|
@@ -14,7 +14,12 @@ from playwright.sync_api import sync_playwright
|
|
|
14
14
|
|
|
15
15
|
from .constants import MARKDOWN_EXTENSIONS
|
|
16
16
|
from .resources import get_code_css_path, get_css_path, get_output_path
|
|
17
|
-
from .transform import
|
|
17
|
+
from .transform import (
|
|
18
|
+
create_sections,
|
|
19
|
+
render_mermaid_diagrams,
|
|
20
|
+
create_html_document,
|
|
21
|
+
render_checkboxes,
|
|
22
|
+
)
|
|
18
23
|
from .utils import drop_duplicates
|
|
19
24
|
|
|
20
25
|
|
|
@@ -159,6 +164,7 @@ def convert(
|
|
|
159
164
|
html = markdown2.markdown_path(markdown_path, extras=MARKDOWN_EXTENSIONS)
|
|
160
165
|
html = create_sections(html)
|
|
161
166
|
html = render_mermaid_diagrams(html, nonce=nonce)
|
|
167
|
+
html = render_checkboxes(html)
|
|
162
168
|
|
|
163
169
|
_generate_pdf_with_playwright(
|
|
164
170
|
html,
|
|
@@ -229,6 +235,7 @@ def convert_text(markdown_text, css_text=None, *, extend_default_css=True):
|
|
|
229
235
|
html = markdown2.markdown(markdown_text, extras=MARKDOWN_EXTENSIONS)
|
|
230
236
|
html = create_sections(html)
|
|
231
237
|
html = render_mermaid_diagrams(html, nonce=nonce)
|
|
238
|
+
html = render_checkboxes(html)
|
|
232
239
|
|
|
233
240
|
return _generate_pdf_with_playwright(
|
|
234
241
|
html,
|
|
@@ -73,3 +73,22 @@ def render_mermaid_diagrams(html, *, nonce):
|
|
|
73
73
|
html = mermaid_script + html
|
|
74
74
|
|
|
75
75
|
return html
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def render_checkboxes(html):
|
|
79
|
+
"""
|
|
80
|
+
Renders checkboxes in the HTML content by replacing input elements with SVG representations.
|
|
81
|
+
Args:
|
|
82
|
+
html (str): HTML content.
|
|
83
|
+
Returns:
|
|
84
|
+
str: HTML content with rendered checkboxes.
|
|
85
|
+
"""
|
|
86
|
+
unchecked = "[ ]"
|
|
87
|
+
checked = "[x]"
|
|
88
|
+
|
|
89
|
+
unchecked_html = "<input type='checkbox'>"
|
|
90
|
+
checked_html = "<input type='checkbox' checked>"
|
|
91
|
+
|
|
92
|
+
html = html.replace(unchecked, unchecked_html)
|
|
93
|
+
html = html.replace(checked, checked_html)
|
|
94
|
+
return html
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "markdown_convert"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.31"
|
|
8
8
|
description = "Convert Markdown files to PDF from your command line."
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Julio Cabria", email = "juliocabria@tutanota.com" },
|
|
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
|