md2pdf 2.0.0__tar.gz → 2.1.0__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.
- {md2pdf-2.0.0 → md2pdf-2.1.0}/.github/workflows/docker-publish.yml +2 -2
- {md2pdf-2.0.0 → md2pdf-2.1.0}/.github/workflows/quality.yml +2 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/CHANGELOG.md +9 -1
- {md2pdf-2.0.0 → md2pdf-2.1.0}/Makefile +7 -1
- {md2pdf-2.0.0 → md2pdf-2.1.0}/PKG-INFO +1 -1
- {md2pdf-2.0.0 → md2pdf-2.1.0}/pyproject.toml +9 -2
- md2pdf-2.1.0/src/md2pdf/cli.py +58 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/src/md2pdf/core.py +4 -1
- {md2pdf-2.0.0 → md2pdf-2.1.0}/src/md2pdf/exceptions.py +0 -2
- md2pdf-2.1.0/tests/conftest.py +15 -0
- md2pdf-2.1.0/tests/test_cli.py +130 -0
- md2pdf-2.1.0/tests/test_core.py +100 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/uv.lock +147 -1
- md2pdf-2.0.0/src/md2pdf/cli.py +0 -26
- md2pdf-2.0.0/tests/test_cli.py +0 -68
- md2pdf-2.0.0/tests/test_core.py +0 -39
- {md2pdf-2.0.0 → md2pdf-2.1.0}/.dockerignore +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/.github/pull_request_template.md +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/.github/workflows/chore.yml +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/.github/workflows/docker-images.yml +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/.github/workflows/package.yml +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/.gitignore +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/.python-version +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/Dockerfile +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/Dockerfile.alpine +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/LICENSE +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/README.md +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/assets/md2pdf-logo.png +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/examples/custom-styles-with-pygments.css +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/examples/custom-styles.css +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/examples/gutenberg-modern.min.css +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/examples/my-music.md.j2 +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/renovate.json +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/src/md2pdf/__init__.py +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/src/md2pdf/__main__.py +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/src/md2pdf/conf.py +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/tests/__init__.py +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/tests/assets/input.css +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/tests/assets/input.md +0 -0
- {md2pdf-2.0.0 → md2pdf-2.1.0}/tests/defaults.py +0 -0
|
@@ -18,7 +18,7 @@ jobs:
|
|
|
18
18
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
|
|
19
19
|
|
|
20
20
|
- name: Log in to Docker Hub
|
|
21
|
-
uses: docker/login-action@
|
|
21
|
+
uses: docker/login-action@916386b00027d425839f8da46d302dab33f5875b
|
|
22
22
|
with:
|
|
23
23
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
24
24
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
@@ -38,7 +38,7 @@ jobs:
|
|
|
38
38
|
|
|
39
39
|
- name: Extract metadata (tags, labels) for Docker
|
|
40
40
|
id: meta
|
|
41
|
-
uses: docker/metadata-action@
|
|
41
|
+
uses: docker/metadata-action@ed95091677497158a9ff38b314264cd965388d5e
|
|
42
42
|
with:
|
|
43
43
|
images: jmaupetit/md2pdf
|
|
44
44
|
tags: ${{ steps.version.outputs.version }}
|
|
@@ -8,6 +8,13 @@ and this project adheres to
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [2.1.0] - 2026-01-12
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Allow extra markdown extensions configuration using a JSON string (CLI) or a
|
|
16
|
+
dict (API)
|
|
17
|
+
|
|
11
18
|
## [2.0.0] - 2026-01-09
|
|
12
19
|
|
|
13
20
|
### Added
|
|
@@ -67,7 +74,8 @@ and this project adheres to
|
|
|
67
74
|
|
|
68
75
|
- Add current directory as `base_url` to md2pdf script (Fix #6)
|
|
69
76
|
|
|
70
|
-
[unreleased]: https://github.com/jmaupetit/md2pdf/compare/2.
|
|
77
|
+
[unreleased]: https://github.com/jmaupetit/md2pdf/compare/2.1.0...main
|
|
78
|
+
[2.1.0]: https://github.com/jmaupetit/md2pdf/compare/2.0.0...2.1.0
|
|
71
79
|
[2.0.0]: https://github.com/jmaupetit/md2pdf/compare/1.0.1...2.0.0
|
|
72
80
|
[1.0.1]: https://github.com/jmaupetit/md2pdf/compare/1.0.0...1.0.1
|
|
73
81
|
[1.0.0]: https://github.com/jmaupetit/md2pdf/compare/0.6...1.0.0
|
|
@@ -36,7 +36,8 @@ build-docker-alpine: ## build Docker (alpine) image
|
|
|
36
36
|
lint: ## lint all sources
|
|
37
37
|
lint: \
|
|
38
38
|
lint-black \
|
|
39
|
-
lint-ruff
|
|
39
|
+
lint-ruff \
|
|
40
|
+
lint-mypy
|
|
40
41
|
.PHONY: lint
|
|
41
42
|
|
|
42
43
|
lint-black: ## lint python sources with black
|
|
@@ -59,6 +60,11 @@ lint-ruff-fix: ## lint and fix python sources with ruff
|
|
|
59
60
|
uv run ruff check --fix src/md2pdf tests
|
|
60
61
|
.PHONY: lint-ruff-fix
|
|
61
62
|
|
|
63
|
+
lint-mypy: ## lint python sources with mypy
|
|
64
|
+
@echo 'lint:mypy started…'
|
|
65
|
+
uv run mypy src/md2pdf tests
|
|
66
|
+
.PHONY: lint-mypy
|
|
67
|
+
|
|
62
68
|
test: ## run the test suite
|
|
63
69
|
$(UV_RUN) pytest
|
|
64
70
|
.PHONY: test
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "md2pdf"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.1.0"
|
|
4
4
|
description = "The Markdown to PDF conversion tool with styles"
|
|
5
5
|
authors = [
|
|
6
6
|
{name="Julien Maupetit", email="julien@maupetit.net"},
|
|
@@ -38,9 +38,12 @@ dependencies = [
|
|
|
38
38
|
[dependency-groups]
|
|
39
39
|
dev = [
|
|
40
40
|
"black>=25.12.0",
|
|
41
|
+
"mypy>=1.19.1",
|
|
42
|
+
"pypdf>=6.6.0",
|
|
41
43
|
"pytest>=9.0.2",
|
|
42
44
|
"pytest-cov>=7.0.0",
|
|
43
45
|
"ruff>=0.14.10",
|
|
46
|
+
"types-markdown>=3.10.0.20251106",
|
|
44
47
|
]
|
|
45
48
|
|
|
46
49
|
[project.urls]
|
|
@@ -56,7 +59,7 @@ build-backend = "hatchling.build"
|
|
|
56
59
|
|
|
57
60
|
# Third party packages configuration
|
|
58
61
|
[tool.pytest.ini_options]
|
|
59
|
-
addopts = "-
|
|
62
|
+
addopts = "-v --cov=md2pdf --cov-report term-missing"
|
|
60
63
|
python_files = [
|
|
61
64
|
"test_*.py",
|
|
62
65
|
"tests.py",
|
|
@@ -96,3 +99,7 @@ convention = "google"
|
|
|
96
99
|
"S101",
|
|
97
100
|
"PLR2004", # Pylint magic-value-comparison
|
|
98
101
|
]
|
|
102
|
+
|
|
103
|
+
[tool.mypy]
|
|
104
|
+
files = "./**/*.py"
|
|
105
|
+
ignore_missing_imports = true
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""md2pdf CLI."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import logging
|
|
5
|
+
from importlib.metadata import version
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
import click
|
|
10
|
+
|
|
11
|
+
from .core import md2pdf
|
|
12
|
+
from .exceptions import ValidationError
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def parse_config(config: str) -> dict:
|
|
18
|
+
"""Parse configuration input as a JSON string."""
|
|
19
|
+
try:
|
|
20
|
+
parsed = json.loads(config)
|
|
21
|
+
except json.decoder.JSONDecodeError as err:
|
|
22
|
+
raise ValidationError(
|
|
23
|
+
"Invalid input configuration string (should be valid JSON)"
|
|
24
|
+
) from err
|
|
25
|
+
return parsed
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@click.command(name="md2pdf")
|
|
29
|
+
@click.argument("md", type=click.Path(exists=True))
|
|
30
|
+
@click.argument("pdf", type=click.Path())
|
|
31
|
+
@click.option("--css", "-c", "css", type=click.Path(exists=True))
|
|
32
|
+
@click.option("--extras", "-e", "extras", multiple=True, type=str)
|
|
33
|
+
@click.option("--config", "-C", "config", type=str)
|
|
34
|
+
@click.version_option(version=version("md2pdf"))
|
|
35
|
+
def cli(
|
|
36
|
+
md: Path,
|
|
37
|
+
pdf: Path,
|
|
38
|
+
css: Optional[Path] = None,
|
|
39
|
+
extras: Optional[list] = None,
|
|
40
|
+
config: Optional[str] = None,
|
|
41
|
+
):
|
|
42
|
+
"""Markdown to PDF conversion with styles!"""
|
|
43
|
+
if css is not None:
|
|
44
|
+
css = Path(css)
|
|
45
|
+
|
|
46
|
+
extras_config = None
|
|
47
|
+
if config is not None:
|
|
48
|
+
extras_config = parse_config(config)
|
|
49
|
+
|
|
50
|
+
md2pdf(
|
|
51
|
+
Path(pdf),
|
|
52
|
+
md=Path(md),
|
|
53
|
+
css=css,
|
|
54
|
+
base_url=Path.cwd(),
|
|
55
|
+
# FIXME: click returns a tuple and not a list
|
|
56
|
+
extras=list(extras) if extras else None,
|
|
57
|
+
extras_config=extras_config,
|
|
58
|
+
)
|
|
@@ -22,6 +22,7 @@ def md2pdf(
|
|
|
22
22
|
css: Optional[Path] = None,
|
|
23
23
|
base_url: Optional[Path] = None,
|
|
24
24
|
extras: Optional[List[str]] = None,
|
|
25
|
+
extras_config: Optional[dict] = None,
|
|
25
26
|
context: Optional[dict] = None,
|
|
26
27
|
):
|
|
27
28
|
"""Converts input markdown to styled HTML and renders it to a PDF file.
|
|
@@ -33,6 +34,7 @@ def md2pdf(
|
|
|
33
34
|
css: input styles path (CSS).
|
|
34
35
|
base_url: absolute base path for markdown linked content (as images).
|
|
35
36
|
extras: supplementary markdown extensions to activate
|
|
37
|
+
extras_config: a configuration dictionnary for active markdown extensions
|
|
36
38
|
context: input context to use for jinja template rendering
|
|
37
39
|
|
|
38
40
|
Returns:
|
|
@@ -42,6 +44,7 @@ def md2pdf(
|
|
|
42
44
|
ValidationError: if md_content and md_file_path are empty.
|
|
43
45
|
"""
|
|
44
46
|
context = context if context else {}
|
|
47
|
+
extras_config = extras_config if extras_config else {}
|
|
45
48
|
|
|
46
49
|
# Merge base extensions with extras extensions
|
|
47
50
|
extras = extras if extras and len(extras) else []
|
|
@@ -68,7 +71,7 @@ def md2pdf(
|
|
|
68
71
|
raw = Template(raw).render(context)
|
|
69
72
|
|
|
70
73
|
extensions = MARKDOWN_BASE_EXTENSIONS + extras
|
|
71
|
-
raw_html = markdown(raw, extensions=extensions)
|
|
74
|
+
raw_html = markdown(raw, extensions=extensions, extension_configs=extras_config)
|
|
72
75
|
|
|
73
76
|
# Weasyprint HTML object
|
|
74
77
|
if base_url is None:
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Tests configuration."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from .defaults import OUTPUT_PDF
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@pytest.fixture(scope="function", autouse=True)
|
|
9
|
+
def remove_generated_pdf():
|
|
10
|
+
"""Remove test-generated PDF file."""
|
|
11
|
+
yield
|
|
12
|
+
|
|
13
|
+
# Teardown
|
|
14
|
+
if OUTPUT_PDF.exists():
|
|
15
|
+
OUTPUT_PDF.unlink()
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"""md2pdf tests for the CLI."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
from click.testing import CliRunner
|
|
7
|
+
|
|
8
|
+
from md2pdf.cli import cli, parse_config
|
|
9
|
+
from md2pdf.exceptions import ValidationError
|
|
10
|
+
|
|
11
|
+
from .defaults import INPUT_CSS, INPUT_MD, OUTPUT_PDF
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@pytest.mark.parametrize(
|
|
15
|
+
"config",
|
|
16
|
+
(
|
|
17
|
+
'{"my_extension": {"option_1": 1, "option_2": true}}', # standard
|
|
18
|
+
'{"my_extension":{"option_1":1,"option_2":true}}', # compressed
|
|
19
|
+
"""
|
|
20
|
+
{
|
|
21
|
+
"my_extension": {
|
|
22
|
+
"option_1": 1,
|
|
23
|
+
"option_2": true
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
""", # formatted
|
|
27
|
+
),
|
|
28
|
+
)
|
|
29
|
+
def test_parse_config(config):
|
|
30
|
+
"""Test the input configuration parsing."""
|
|
31
|
+
expected = {"my_extension": {"option_1": 1, "option_2": True}}
|
|
32
|
+
assert parse_config(config) == expected
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@pytest.mark.parametrize(
|
|
36
|
+
"config",
|
|
37
|
+
(
|
|
38
|
+
"my_extension=value", # simple string
|
|
39
|
+
"{'my_extension': {'option_1': 1, 'option_2': true}}", # single-quotes
|
|
40
|
+
'{"my_extension": {"option_1": toto, "option_2": true}}', # string w/o quotes
|
|
41
|
+
'{"my_extension": {"option_1": 1, "option_2": true,}}', # last row comma
|
|
42
|
+
),
|
|
43
|
+
)
|
|
44
|
+
def test_parse_config_invalid_config(config):
|
|
45
|
+
"""Test the input configuration parsing when an invalid configuration is parsed."""
|
|
46
|
+
with pytest.raises(
|
|
47
|
+
ValidationError,
|
|
48
|
+
match=r"Invalid input configuration string \(should be valid JSON\)",
|
|
49
|
+
):
|
|
50
|
+
parse_config(config)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def test_print_usage_when_no_args():
|
|
54
|
+
"""Print usage when no arguments are passed."""
|
|
55
|
+
runner = CliRunner()
|
|
56
|
+
result = runner.invoke(cli)
|
|
57
|
+
expected = "Usage: md2pdf [OPTIONS] MD PDF"
|
|
58
|
+
assert result.exit_code == 2
|
|
59
|
+
assert expected in result.output
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def test_print_usage_when_partial_args():
|
|
63
|
+
"""Print usage when required arguments are missing."""
|
|
64
|
+
runner = CliRunner()
|
|
65
|
+
result = runner.invoke(cli, ["input.md"])
|
|
66
|
+
expected = "Usage: md2pdf [OPTIONS] MD PDF"
|
|
67
|
+
assert result.exit_code == 2
|
|
68
|
+
assert expected in result.output
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def test_raise_IOError_when_markdown_input_file_does_not_exists():
|
|
72
|
+
"""Raise an I/O error when markdown input file does not exist."""
|
|
73
|
+
runner = CliRunner()
|
|
74
|
+
result = runner.invoke(cli, ["input.md", "output.pdf"])
|
|
75
|
+
expected = "Error: Invalid value for 'MD': Path 'input.md' does not exist."
|
|
76
|
+
assert result.exit_code == 2
|
|
77
|
+
assert expected in result.output
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def test_raise_IOError_when_stylesheet_does_not_exists():
|
|
81
|
+
"""Raise an I/O error when CSS input file does not exist."""
|
|
82
|
+
runner = CliRunner()
|
|
83
|
+
result = runner.invoke(cli, ["--css=styles.css", str(INPUT_MD), str(OUTPUT_PDF)])
|
|
84
|
+
expected = (
|
|
85
|
+
"Error: Invalid value for '--css' / '-c': Path 'styles.css' does not exist."
|
|
86
|
+
)
|
|
87
|
+
assert result.exit_code == 2
|
|
88
|
+
assert expected in result.output
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def test_generate_pdf_from_markdown_source_file():
|
|
92
|
+
"""Generate a PDF from a markdown file."""
|
|
93
|
+
assert not OUTPUT_PDF.exists()
|
|
94
|
+
runner = CliRunner()
|
|
95
|
+
runner.invoke(cli, [str(INPUT_MD), str(OUTPUT_PDF)])
|
|
96
|
+
assert OUTPUT_PDF.exists()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def test_generate_pdf_from_markdown_source_file_and_stylesheet():
|
|
100
|
+
"""Generate a PDF from a markdown and a CSS file."""
|
|
101
|
+
assert not OUTPUT_PDF.exists()
|
|
102
|
+
runner = CliRunner()
|
|
103
|
+
runner.invoke(cli, [f"--css={INPUT_CSS}", str(INPUT_MD), str(OUTPUT_PDF)])
|
|
104
|
+
assert OUTPUT_PDF.exists()
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def test_generate_pdf_with_an_extension():
|
|
108
|
+
"""Generate a PDF from a markdown file with an extra extension."""
|
|
109
|
+
assert not OUTPUT_PDF.exists()
|
|
110
|
+
runner = CliRunner()
|
|
111
|
+
runner.invoke(cli, ["--extras", "footnotes", str(INPUT_MD), str(OUTPUT_PDF)])
|
|
112
|
+
assert OUTPUT_PDF.exists()
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def test_generate_pdf_with_a_configured_extension():
|
|
116
|
+
"""Generate a PDF from a markdown file with an extra configured extension."""
|
|
117
|
+
assert not OUTPUT_PDF.exists()
|
|
118
|
+
runner = CliRunner()
|
|
119
|
+
runner.invoke(
|
|
120
|
+
cli,
|
|
121
|
+
[
|
|
122
|
+
"--extras",
|
|
123
|
+
"footnotes",
|
|
124
|
+
"--config",
|
|
125
|
+
json.dumps({"footnotes": {"BACKLINK_TEXT": "link"}}),
|
|
126
|
+
str(INPUT_MD),
|
|
127
|
+
str(OUTPUT_PDF),
|
|
128
|
+
],
|
|
129
|
+
)
|
|
130
|
+
assert OUTPUT_PDF.exists()
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"""md2pdf tests for the core module."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from pypdf import PdfReader
|
|
5
|
+
|
|
6
|
+
from md2pdf import md2pdf
|
|
7
|
+
from md2pdf.exceptions import ValidationError
|
|
8
|
+
|
|
9
|
+
from .defaults import INPUT_MD, OUTPUT_PDF
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_generate_pdf_from_markdown_file():
|
|
13
|
+
"""Generate a PDF from markdown file content."""
|
|
14
|
+
assert not OUTPUT_PDF.exists()
|
|
15
|
+
|
|
16
|
+
md2pdf(pdf=OUTPUT_PDF, md=INPUT_MD)
|
|
17
|
+
assert OUTPUT_PDF.exists()
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def test_generate_pdf_from_raw_markdown():
|
|
21
|
+
"""Generate a PDF from raw markdown content."""
|
|
22
|
+
assert not OUTPUT_PDF.exists()
|
|
23
|
+
|
|
24
|
+
md2pdf(OUTPUT_PDF, raw="# hi there!")
|
|
25
|
+
assert OUTPUT_PDF.exists()
|
|
26
|
+
|
|
27
|
+
# Content
|
|
28
|
+
reader = PdfReader(OUTPUT_PDF)
|
|
29
|
+
assert reader.pages[0].extract_text() == "hi there!"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def test_generate_pdf_with_jinja_frontmatter_input():
|
|
33
|
+
"""Generate a PDF using a frontmatter header source and a Jinja template."""
|
|
34
|
+
assert not OUTPUT_PDF.exists()
|
|
35
|
+
|
|
36
|
+
raw = "\n".join(
|
|
37
|
+
[
|
|
38
|
+
"---",
|
|
39
|
+
"name: John",
|
|
40
|
+
"id: 2",
|
|
41
|
+
"---",
|
|
42
|
+
"Hey {{ name }} 👋\n",
|
|
43
|
+
"ID: {{ id }}",
|
|
44
|
+
]
|
|
45
|
+
)
|
|
46
|
+
md2pdf(OUTPUT_PDF, raw=raw)
|
|
47
|
+
assert OUTPUT_PDF.exists()
|
|
48
|
+
|
|
49
|
+
# Content
|
|
50
|
+
reader = PdfReader(OUTPUT_PDF)
|
|
51
|
+
assert reader.pages[0].extract_text() == "Hey John 👋\nID: 2"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def test_generate_pdf_with_jinja_context_input():
|
|
55
|
+
"""Generate a PDF using an input context and Jinja template."""
|
|
56
|
+
assert not OUTPUT_PDF.exists()
|
|
57
|
+
|
|
58
|
+
raw = "\n".join(
|
|
59
|
+
[
|
|
60
|
+
"Hey {{ name }} 👋\n",
|
|
61
|
+
"ID: {{ id }}",
|
|
62
|
+
]
|
|
63
|
+
)
|
|
64
|
+
md2pdf(OUTPUT_PDF, raw=raw, context={"name": "John", "id": 2})
|
|
65
|
+
assert OUTPUT_PDF.exists()
|
|
66
|
+
|
|
67
|
+
# Content
|
|
68
|
+
reader = PdfReader(OUTPUT_PDF)
|
|
69
|
+
assert reader.pages[0].extract_text() == "Hey John 👋\nID: 2"
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def test_generate_pdf_with_jinja_frontmatter_and_context_input():
|
|
73
|
+
"""Generate a PDF using a frontmatter header source, a context and a template.
|
|
74
|
+
|
|
75
|
+
Frontmatter value takes precedence over direct context.
|
|
76
|
+
"""
|
|
77
|
+
assert not OUTPUT_PDF.exists()
|
|
78
|
+
|
|
79
|
+
raw = "\n".join(
|
|
80
|
+
[
|
|
81
|
+
"---",
|
|
82
|
+
"name: Jane",
|
|
83
|
+
"id: 2",
|
|
84
|
+
"---",
|
|
85
|
+
"Hey {{ name }} 👋\n",
|
|
86
|
+
"ID: {{ id }}",
|
|
87
|
+
]
|
|
88
|
+
)
|
|
89
|
+
md2pdf(OUTPUT_PDF, raw=raw, context={"name": "John"})
|
|
90
|
+
assert OUTPUT_PDF.exists()
|
|
91
|
+
|
|
92
|
+
# Content
|
|
93
|
+
reader = PdfReader(OUTPUT_PDF)
|
|
94
|
+
assert reader.pages[0].extract_text() == "Hey Jane 👋\nID: 2"
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def test_raises_a_validation_error_when_generated_html_is_empty():
|
|
98
|
+
"""Raise a ValidationError when generated HTML is empty."""
|
|
99
|
+
with pytest.raises(ValidationError):
|
|
100
|
+
md2pdf(OUTPUT_PDF)
|
|
@@ -445,6 +445,79 @@ wheels = [
|
|
|
445
445
|
{ url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },
|
|
446
446
|
]
|
|
447
447
|
|
|
448
|
+
[[package]]
|
|
449
|
+
name = "librt"
|
|
450
|
+
version = "0.7.7"
|
|
451
|
+
source = { registry = "https://pypi.org/simple" }
|
|
452
|
+
sdist = { url = "https://files.pythonhosted.org/packages/b7/29/47f29026ca17f35cf299290292d5f8331f5077364974b7675a353179afa2/librt-0.7.7.tar.gz", hash = "sha256:81d957b069fed1890953c3b9c3895c7689960f233eea9a1d9607f71ce7f00b2c", size = 145910, upload-time = "2026-01-01T23:52:22.87Z" }
|
|
453
|
+
wheels = [
|
|
454
|
+
{ url = "https://files.pythonhosted.org/packages/c6/84/2cfb1f3b9b60bab52e16a220c931223fc8e963d0d7bb9132bef012aafc3f/librt-0.7.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e4836c5645f40fbdc275e5670819bde5ab5f2e882290d304e3c6ddab1576a6d0", size = 54709, upload-time = "2026-01-01T23:50:48.326Z" },
|
|
455
|
+
{ url = "https://files.pythonhosted.org/packages/19/a1/3127b277e9d3784a8040a54e8396d9ae5c64d6684dc6db4b4089b0eedcfb/librt-0.7.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6ae8aec43117a645a31e5f60e9e3a0797492e747823b9bda6972d521b436b4e8", size = 56658, upload-time = "2026-01-01T23:50:49.74Z" },
|
|
456
|
+
{ url = "https://files.pythonhosted.org/packages/3a/e9/b91b093a5c42eb218120445f3fef82e0b977fa2225f4d6fc133d25cdf86a/librt-0.7.7-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:aea05f701ccd2a76b34f0daf47ca5068176ff553510b614770c90d76ac88df06", size = 161026, upload-time = "2026-01-01T23:50:50.853Z" },
|
|
457
|
+
{ url = "https://files.pythonhosted.org/packages/c7/cb/1ded77d5976a79d7057af4a010d577ce4f473ff280984e68f4974a3281e5/librt-0.7.7-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7b16ccaeff0ed4355dfb76fe1ea7a5d6d03b5ad27f295f77ee0557bc20a72495", size = 169529, upload-time = "2026-01-01T23:50:52.24Z" },
|
|
458
|
+
{ url = "https://files.pythonhosted.org/packages/da/6e/6ca5bdaa701e15f05000ac1a4c5d1475c422d3484bd3d1ca9e8c2f5be167/librt-0.7.7-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c48c7e150c095d5e3cea7452347ba26094be905d6099d24f9319a8b475fcd3e0", size = 183271, upload-time = "2026-01-01T23:50:55.287Z" },
|
|
459
|
+
{ url = "https://files.pythonhosted.org/packages/e7/2d/55c0e38073997b4bbb5ddff25b6d1bbba8c2f76f50afe5bb9c844b702f34/librt-0.7.7-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:4dcee2f921a8632636d1c37f1bbdb8841d15666d119aa61e5399c5268e7ce02e", size = 179039, upload-time = "2026-01-01T23:50:56.807Z" },
|
|
460
|
+
{ url = "https://files.pythonhosted.org/packages/33/4e/3662a41ae8bb81b226f3968426293517b271d34d4e9fd4b59fc511f1ae40/librt-0.7.7-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:14ef0f4ac3728ffd85bfc58e2f2f48fb4ef4fa871876f13a73a7381d10a9f77c", size = 173505, upload-time = "2026-01-01T23:50:58.291Z" },
|
|
461
|
+
{ url = "https://files.pythonhosted.org/packages/f8/5d/cf768deb8bdcbac5f8c21fcb32dd483d038d88c529fd351bbe50590b945d/librt-0.7.7-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e4ab69fa37f8090f2d971a5d2bc606c7401170dbdae083c393d6cbf439cb45b8", size = 193570, upload-time = "2026-01-01T23:50:59.546Z" },
|
|
462
|
+
{ url = "https://files.pythonhosted.org/packages/a1/ea/ee70effd13f1d651976d83a2812391f6203971740705e3c0900db75d4bce/librt-0.7.7-cp310-cp310-win32.whl", hash = "sha256:4bf3cc46d553693382d2abf5f5bd493d71bb0f50a7c0beab18aa13a5545c8900", size = 42600, upload-time = "2026-01-01T23:51:00.694Z" },
|
|
463
|
+
{ url = "https://files.pythonhosted.org/packages/f0/eb/dc098730f281cba76c279b71783f5de2edcba3b880c1ab84a093ef826062/librt-0.7.7-cp310-cp310-win_amd64.whl", hash = "sha256:f0c8fe5aeadd8a0e5b0598f8a6ee3533135ca50fd3f20f130f9d72baf5c6ac58", size = 48977, upload-time = "2026-01-01T23:51:01.726Z" },
|
|
464
|
+
{ url = "https://files.pythonhosted.org/packages/f0/56/30b5c342518005546df78841cb0820ae85a17e7d07d521c10ef367306d0d/librt-0.7.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a487b71fbf8a9edb72a8c7a456dda0184642d99cd007bc819c0b7ab93676a8ee", size = 54709, upload-time = "2026-01-01T23:51:02.774Z" },
|
|
465
|
+
{ url = "https://files.pythonhosted.org/packages/72/78/9f120e3920b22504d4f3835e28b55acc2cc47c9586d2e1b6ba04c3c1bf01/librt-0.7.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f4d4efb218264ecf0f8516196c9e2d1a0679d9fb3bb15df1155a35220062eba8", size = 56663, upload-time = "2026-01-01T23:51:03.838Z" },
|
|
466
|
+
{ url = "https://files.pythonhosted.org/packages/1c/ea/7d7a1ee7dfc1151836028eba25629afcf45b56bbc721293e41aa2e9b8934/librt-0.7.7-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:b8bb331aad734b059c4b450cd0a225652f16889e286b2345af5e2c3c625c3d85", size = 161705, upload-time = "2026-01-01T23:51:04.917Z" },
|
|
467
|
+
{ url = "https://files.pythonhosted.org/packages/45/a5/952bc840ac8917fbcefd6bc5f51ad02b89721729814f3e2bfcc1337a76d6/librt-0.7.7-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:467dbd7443bda08338fc8ad701ed38cef48194017554f4c798b0a237904b3f99", size = 171029, upload-time = "2026-01-01T23:51:06.09Z" },
|
|
468
|
+
{ url = "https://files.pythonhosted.org/packages/fa/bf/c017ff7da82dc9192cf40d5e802a48a25d00e7639b6465cfdcee5893a22c/librt-0.7.7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:50d1d1ee813d2d1a3baf2873634ba506b263032418d16287c92ec1cc9c1a00cb", size = 184704, upload-time = "2026-01-01T23:51:07.549Z" },
|
|
469
|
+
{ url = "https://files.pythonhosted.org/packages/77/ec/72f3dd39d2cdfd6402ab10836dc9cbf854d145226062a185b419c4f1624a/librt-0.7.7-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c7e5070cf3ec92d98f57574da0224f8c73faf1ddd6d8afa0b8c9f6e86997bc74", size = 180719, upload-time = "2026-01-01T23:51:09.062Z" },
|
|
470
|
+
{ url = "https://files.pythonhosted.org/packages/78/86/06e7a1a81b246f3313bf515dd9613a1c81583e6fd7843a9f4d625c4e926d/librt-0.7.7-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:bdb9f3d865b2dafe7f9ad7f30ef563c80d0ddd2fdc8cc9b8e4f242f475e34d75", size = 174537, upload-time = "2026-01-01T23:51:10.611Z" },
|
|
471
|
+
{ url = "https://files.pythonhosted.org/packages/83/08/f9fb2edc9c7a76e95b2924ce81d545673f5b034e8c5dd92159d1c7dae0c6/librt-0.7.7-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:8185c8497d45164e256376f9da5aed2bb26ff636c798c9dabe313b90e9f25b28", size = 195238, upload-time = "2026-01-01T23:51:11.762Z" },
|
|
472
|
+
{ url = "https://files.pythonhosted.org/packages/ba/56/ea2d2489d3ea1f47b301120e03a099e22de7b32c93df9a211e6ff4f9bf38/librt-0.7.7-cp311-cp311-win32.whl", hash = "sha256:44d63ce643f34a903f09ff7ca355aae019a3730c7afd6a3c037d569beeb5d151", size = 42939, upload-time = "2026-01-01T23:51:13.192Z" },
|
|
473
|
+
{ url = "https://files.pythonhosted.org/packages/58/7b/c288f417e42ba2a037f1c0753219e277b33090ed4f72f292fb6fe175db4c/librt-0.7.7-cp311-cp311-win_amd64.whl", hash = "sha256:7d13cc340b3b82134f8038a2bfe7137093693dcad8ba5773da18f95ad6b77a8a", size = 49240, upload-time = "2026-01-01T23:51:14.264Z" },
|
|
474
|
+
{ url = "https://files.pythonhosted.org/packages/7c/24/738eb33a6c1516fdb2dfd2a35db6e5300f7616679b573585be0409bc6890/librt-0.7.7-cp311-cp311-win_arm64.whl", hash = "sha256:983de36b5a83fe9222f4f7dcd071f9b1ac6f3f17c0af0238dadfb8229588f890", size = 42613, upload-time = "2026-01-01T23:51:15.268Z" },
|
|
475
|
+
{ url = "https://files.pythonhosted.org/packages/56/72/1cd9d752070011641e8aee046c851912d5f196ecd726fffa7aed2070f3e0/librt-0.7.7-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2a85a1fc4ed11ea0eb0a632459ce004a2d14afc085a50ae3463cd3dfe1ce43fc", size = 55687, upload-time = "2026-01-01T23:51:16.291Z" },
|
|
476
|
+
{ url = "https://files.pythonhosted.org/packages/50/aa/d5a1d4221c4fe7e76ae1459d24d6037783cb83c7645164c07d7daf1576ec/librt-0.7.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c87654e29a35938baead1c4559858f346f4a2a7588574a14d784f300ffba0efd", size = 57136, upload-time = "2026-01-01T23:51:17.363Z" },
|
|
477
|
+
{ url = "https://files.pythonhosted.org/packages/23/6f/0c86b5cb5e7ef63208c8cc22534df10ecc5278efc0d47fb8815577f3ca2f/librt-0.7.7-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:c9faaebb1c6212c20afd8043cd6ed9de0a47d77f91a6b5b48f4e46ed470703fe", size = 165320, upload-time = "2026-01-01T23:51:18.455Z" },
|
|
478
|
+
{ url = "https://files.pythonhosted.org/packages/16/37/df4652690c29f645ffe405b58285a4109e9fe855c5bb56e817e3e75840b3/librt-0.7.7-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1908c3e5a5ef86b23391448b47759298f87f997c3bd153a770828f58c2bb4630", size = 174216, upload-time = "2026-01-01T23:51:19.599Z" },
|
|
479
|
+
{ url = "https://files.pythonhosted.org/packages/9a/d6/d3afe071910a43133ec9c0f3e4ce99ee6df0d4e44e4bddf4b9e1c6ed41cc/librt-0.7.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dbc4900e95a98fc0729523be9d93a8fedebb026f32ed9ffc08acd82e3e181503", size = 189005, upload-time = "2026-01-01T23:51:21.052Z" },
|
|
480
|
+
{ url = "https://files.pythonhosted.org/packages/d5/18/74060a870fe2d9fd9f47824eba6717ce7ce03124a0d1e85498e0e7efc1b2/librt-0.7.7-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a7ea4e1fbd253e5c68ea0fe63d08577f9d288a73f17d82f652ebc61fa48d878d", size = 183961, upload-time = "2026-01-01T23:51:22.493Z" },
|
|
481
|
+
{ url = "https://files.pythonhosted.org/packages/7c/5e/918a86c66304af66a3c1d46d54df1b2d0b8894babc42a14fb6f25511497f/librt-0.7.7-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:ef7699b7a5a244b1119f85c5bbc13f152cd38240cbb2baa19b769433bae98e50", size = 177610, upload-time = "2026-01-01T23:51:23.874Z" },
|
|
482
|
+
{ url = "https://files.pythonhosted.org/packages/b2/d7/b5e58dc2d570f162e99201b8c0151acf40a03a39c32ab824dd4febf12736/librt-0.7.7-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:955c62571de0b181d9e9e0a0303c8bc90d47670a5eff54cf71bf5da61d1899cf", size = 199272, upload-time = "2026-01-01T23:51:25.341Z" },
|
|
483
|
+
{ url = "https://files.pythonhosted.org/packages/18/87/8202c9bd0968bdddc188ec3811985f47f58ed161b3749299f2c0dd0f63fb/librt-0.7.7-cp312-cp312-win32.whl", hash = "sha256:1bcd79be209313b270b0e1a51c67ae1af28adad0e0c7e84c3ad4b5cb57aaa75b", size = 43189, upload-time = "2026-01-01T23:51:26.799Z" },
|
|
484
|
+
{ url = "https://files.pythonhosted.org/packages/61/8d/80244b267b585e7aa79ffdac19f66c4861effc3a24598e77909ecdd0850e/librt-0.7.7-cp312-cp312-win_amd64.whl", hash = "sha256:4353ee891a1834567e0302d4bd5e60f531912179578c36f3d0430f8c5e16b456", size = 49462, upload-time = "2026-01-01T23:51:27.813Z" },
|
|
485
|
+
{ url = "https://files.pythonhosted.org/packages/2d/1f/75db802d6a4992d95e8a889682601af9b49d5a13bbfa246d414eede1b56c/librt-0.7.7-cp312-cp312-win_arm64.whl", hash = "sha256:a76f1d679beccccdf8c1958e732a1dfcd6e749f8821ee59d7bec009ac308c029", size = 42828, upload-time = "2026-01-01T23:51:28.804Z" },
|
|
486
|
+
{ url = "https://files.pythonhosted.org/packages/8d/5e/d979ccb0a81407ec47c14ea68fb217ff4315521730033e1dd9faa4f3e2c1/librt-0.7.7-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8f4a0b0a3c86ba9193a8e23bb18f100d647bf192390ae195d84dfa0a10fb6244", size = 55746, upload-time = "2026-01-01T23:51:29.828Z" },
|
|
487
|
+
{ url = "https://files.pythonhosted.org/packages/f5/2c/3b65861fb32f802c3783d6ac66fc5589564d07452a47a8cf9980d531cad3/librt-0.7.7-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5335890fea9f9e6c4fdf8683061b9ccdcbe47c6dc03ab8e9b68c10acf78be78d", size = 57174, upload-time = "2026-01-01T23:51:31.226Z" },
|
|
488
|
+
{ url = "https://files.pythonhosted.org/packages/50/df/030b50614b29e443607220097ebaf438531ea218c7a9a3e21ea862a919cd/librt-0.7.7-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:9b4346b1225be26def3ccc6c965751c74868f0578cbcba293c8ae9168483d811", size = 165834, upload-time = "2026-01-01T23:51:32.278Z" },
|
|
489
|
+
{ url = "https://files.pythonhosted.org/packages/5d/e1/bd8d1eacacb24be26a47f157719553bbd1b3fe812c30dddf121c0436fd0b/librt-0.7.7-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a10b8eebdaca6e9fdbaf88b5aefc0e324b763a5f40b1266532590d5afb268a4c", size = 174819, upload-time = "2026-01-01T23:51:33.461Z" },
|
|
490
|
+
{ url = "https://files.pythonhosted.org/packages/46/7d/91d6c3372acf54a019c1ad8da4c9ecf4fc27d039708880bf95f48dbe426a/librt-0.7.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:067be973d90d9e319e6eb4ee2a9b9307f0ecd648b8a9002fa237289a4a07a9e7", size = 189607, upload-time = "2026-01-01T23:51:34.604Z" },
|
|
491
|
+
{ url = "https://files.pythonhosted.org/packages/fa/ac/44604d6d3886f791fbd1c6ae12d5a782a8f4aca927484731979f5e92c200/librt-0.7.7-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:23d2299ed007812cccc1ecef018db7d922733382561230de1f3954db28433977", size = 184586, upload-time = "2026-01-01T23:51:35.845Z" },
|
|
492
|
+
{ url = "https://files.pythonhosted.org/packages/5c/26/d8a6e4c17117b7f9b83301319d9a9de862ae56b133efb4bad8b3aa0808c9/librt-0.7.7-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:6b6f8ea465524aa4c7420c7cc4ca7d46fe00981de8debc67b1cc2e9957bb5b9d", size = 178251, upload-time = "2026-01-01T23:51:37.018Z" },
|
|
493
|
+
{ url = "https://files.pythonhosted.org/packages/99/ab/98d857e254376f8e2f668e807daccc1f445e4b4fc2f6f9c1cc08866b0227/librt-0.7.7-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:f8df32a99cc46eb0ee90afd9ada113ae2cafe7e8d673686cf03ec53e49635439", size = 199853, upload-time = "2026-01-01T23:51:38.195Z" },
|
|
494
|
+
{ url = "https://files.pythonhosted.org/packages/7c/55/4523210d6ae5134a5da959900be43ad8bab2e4206687b6620befddb5b5fd/librt-0.7.7-cp313-cp313-win32.whl", hash = "sha256:86f86b3b785487c7760247bcdac0b11aa8bf13245a13ed05206286135877564b", size = 43247, upload-time = "2026-01-01T23:51:39.629Z" },
|
|
495
|
+
{ url = "https://files.pythonhosted.org/packages/25/40/3ec0fed5e8e9297b1cf1a3836fb589d3de55f9930e3aba988d379e8ef67c/librt-0.7.7-cp313-cp313-win_amd64.whl", hash = "sha256:4862cb2c702b1f905c0503b72d9d4daf65a7fdf5a9e84560e563471e57a56949", size = 49419, upload-time = "2026-01-01T23:51:40.674Z" },
|
|
496
|
+
{ url = "https://files.pythonhosted.org/packages/1c/7a/aab5f0fb122822e2acbc776addf8b9abfb4944a9056c00c393e46e543177/librt-0.7.7-cp313-cp313-win_arm64.whl", hash = "sha256:0996c83b1cb43c00e8c87835a284f9057bc647abd42b5871e5f941d30010c832", size = 42828, upload-time = "2026-01-01T23:51:41.731Z" },
|
|
497
|
+
{ url = "https://files.pythonhosted.org/packages/69/9c/228a5c1224bd23809a635490a162e9cbdc68d99f0eeb4a696f07886b8206/librt-0.7.7-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:23daa1ab0512bafdd677eb1bfc9611d8ffbe2e328895671e64cb34166bc1b8c8", size = 55188, upload-time = "2026-01-01T23:51:43.14Z" },
|
|
498
|
+
{ url = "https://files.pythonhosted.org/packages/ba/c2/0e7c6067e2b32a156308205e5728f4ed6478c501947e9142f525afbc6bd2/librt-0.7.7-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:558a9e5a6f3cc1e20b3168fb1dc802d0d8fa40731f6e9932dcc52bbcfbd37111", size = 56895, upload-time = "2026-01-01T23:51:44.534Z" },
|
|
499
|
+
{ url = "https://files.pythonhosted.org/packages/0e/77/de50ff70c80855eb79d1d74035ef06f664dd073fb7fb9d9fb4429651b8eb/librt-0.7.7-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:2567cb48dc03e5b246927ab35cbb343376e24501260a9b5e30b8e255dca0d1d2", size = 163724, upload-time = "2026-01-01T23:51:45.571Z" },
|
|
500
|
+
{ url = "https://files.pythonhosted.org/packages/6e/19/f8e4bf537899bdef9e0bb9f0e4b18912c2d0f858ad02091b6019864c9a6d/librt-0.7.7-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6066c638cdf85ff92fc6f932d2d73c93a0e03492cdfa8778e6d58c489a3d7259", size = 172470, upload-time = "2026-01-01T23:51:46.823Z" },
|
|
501
|
+
{ url = "https://files.pythonhosted.org/packages/42/4c/dcc575b69d99076768e8dd6141d9aecd4234cba7f0e09217937f52edb6ed/librt-0.7.7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a609849aca463074c17de9cda173c276eb8fee9e441053529e7b9e249dc8b8ee", size = 186806, upload-time = "2026-01-01T23:51:48.009Z" },
|
|
502
|
+
{ url = "https://files.pythonhosted.org/packages/fe/f8/4094a2b7816c88de81239a83ede6e87f1138477d7ee956c30f136009eb29/librt-0.7.7-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:add4e0a000858fe9bb39ed55f31085506a5c38363e6eb4a1e5943a10c2bfc3d1", size = 181809, upload-time = "2026-01-01T23:51:49.35Z" },
|
|
503
|
+
{ url = "https://files.pythonhosted.org/packages/1b/ac/821b7c0ab1b5a6cd9aee7ace8309c91545a2607185101827f79122219a7e/librt-0.7.7-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:a3bfe73a32bd0bdb9a87d586b05a23c0a1729205d79df66dee65bb2e40d671ba", size = 175597, upload-time = "2026-01-01T23:51:50.636Z" },
|
|
504
|
+
{ url = "https://files.pythonhosted.org/packages/71/f9/27f6bfbcc764805864c04211c6ed636fe1d58f57a7b68d1f4ae5ed74e0e0/librt-0.7.7-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:0ecce0544d3db91a40f8b57ae26928c02130a997b540f908cefd4d279d6c5848", size = 196506, upload-time = "2026-01-01T23:51:52.535Z" },
|
|
505
|
+
{ url = "https://files.pythonhosted.org/packages/46/ba/c9b9c6fc931dd7ea856c573174ccaf48714905b1a7499904db2552e3bbaf/librt-0.7.7-cp314-cp314-win32.whl", hash = "sha256:8f7a74cf3a80f0c3b0ec75b0c650b2f0a894a2cec57ef75f6f72c1e82cdac61d", size = 39747, upload-time = "2026-01-01T23:51:53.683Z" },
|
|
506
|
+
{ url = "https://files.pythonhosted.org/packages/c5/69/cd1269337c4cde3ee70176ee611ab0058aa42fc8ce5c9dce55f48facfcd8/librt-0.7.7-cp314-cp314-win_amd64.whl", hash = "sha256:3d1fe2e8df3268dd6734dba33ededae72ad5c3a859b9577bc00b715759c5aaab", size = 45971, upload-time = "2026-01-01T23:51:54.697Z" },
|
|
507
|
+
{ url = "https://files.pythonhosted.org/packages/79/fd/e0844794423f5583108c5991313c15e2b400995f44f6ec6871f8aaf8243c/librt-0.7.7-cp314-cp314-win_arm64.whl", hash = "sha256:2987cf827011907d3dfd109f1be0d61e173d68b1270107bb0e89f2fca7f2ed6b", size = 39075, upload-time = "2026-01-01T23:51:55.726Z" },
|
|
508
|
+
{ url = "https://files.pythonhosted.org/packages/42/02/211fd8f7c381e7b2a11d0fdfcd410f409e89967be2e705983f7c6342209a/librt-0.7.7-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:8e92c8de62b40bfce91d5e12c6e8b15434da268979b1af1a6589463549d491e6", size = 57368, upload-time = "2026-01-01T23:51:56.706Z" },
|
|
509
|
+
{ url = "https://files.pythonhosted.org/packages/4c/b6/aca257affae73ece26041ae76032153266d110453173f67d7603058e708c/librt-0.7.7-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f683dcd49e2494a7535e30f779aa1ad6e3732a019d80abe1309ea91ccd3230e3", size = 59238, upload-time = "2026-01-01T23:51:58.066Z" },
|
|
510
|
+
{ url = "https://files.pythonhosted.org/packages/96/47/7383a507d8e0c11c78ca34c9d36eab9000db5989d446a2f05dc40e76c64f/librt-0.7.7-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:9b15e5d17812d4d629ff576699954f74e2cc24a02a4fc401882dd94f81daba45", size = 183870, upload-time = "2026-01-01T23:51:59.204Z" },
|
|
511
|
+
{ url = "https://files.pythonhosted.org/packages/a4/b8/50f3d8eec8efdaf79443963624175c92cec0ba84827a66b7fcfa78598e51/librt-0.7.7-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c084841b879c4d9b9fa34e5d5263994f21aea7fd9c6add29194dbb41a6210536", size = 194608, upload-time = "2026-01-01T23:52:00.419Z" },
|
|
512
|
+
{ url = "https://files.pythonhosted.org/packages/23/d9/1b6520793aadb59d891e3b98ee057a75de7f737e4a8b4b37fdbecb10d60f/librt-0.7.7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:10c8fb9966f84737115513fecbaf257f9553d067a7dd45a69c2c7e5339e6a8dc", size = 206776, upload-time = "2026-01-01T23:52:01.705Z" },
|
|
513
|
+
{ url = "https://files.pythonhosted.org/packages/ff/db/331edc3bba929d2756fa335bfcf736f36eff4efcb4f2600b545a35c2ae58/librt-0.7.7-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:9b5fb1ecb2c35362eab2dbd354fd1efa5a8440d3e73a68be11921042a0edc0ff", size = 203206, upload-time = "2026-01-01T23:52:03.315Z" },
|
|
514
|
+
{ url = "https://files.pythonhosted.org/packages/b2/e1/6af79ec77204e85f6f2294fc171a30a91bb0e35d78493532ed680f5d98be/librt-0.7.7-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:d1454899909d63cc9199a89fcc4f81bdd9004aef577d4ffc022e600c412d57f3", size = 196697, upload-time = "2026-01-01T23:52:04.857Z" },
|
|
515
|
+
{ url = "https://files.pythonhosted.org/packages/f3/46/de55ecce4b2796d6d243295c221082ca3a944dc2fb3a52dcc8660ce7727d/librt-0.7.7-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:7ef28f2e7a016b29792fe0a2dd04dec75725b32a1264e390c366103f834a9c3a", size = 217193, upload-time = "2026-01-01T23:52:06.159Z" },
|
|
516
|
+
{ url = "https://files.pythonhosted.org/packages/41/61/33063e271949787a2f8dd33c5260357e3d512a114fc82ca7890b65a76e2d/librt-0.7.7-cp314-cp314t-win32.whl", hash = "sha256:5e419e0db70991b6ba037b70c1d5bbe92b20ddf82f31ad01d77a347ed9781398", size = 40277, upload-time = "2026-01-01T23:52:07.625Z" },
|
|
517
|
+
{ url = "https://files.pythonhosted.org/packages/06/21/1abd972349f83a696ea73159ac964e63e2d14086fdd9bc7ca878c25fced4/librt-0.7.7-cp314-cp314t-win_amd64.whl", hash = "sha256:d6b7d93657332c817b8d674ef6bf1ab7796b4f7ce05e420fd45bd258a72ac804", size = 46765, upload-time = "2026-01-01T23:52:08.647Z" },
|
|
518
|
+
{ url = "https://files.pythonhosted.org/packages/51/0e/b756c7708143a63fca65a51ca07990fa647db2cc8fcd65177b9e96680255/librt-0.7.7-cp314-cp314t-win_arm64.whl", hash = "sha256:142c2cd91794b79fd0ce113bd658993b7ede0fe93057668c2f98a45ca00b7e91", size = 39724, upload-time = "2026-01-01T23:52:09.745Z" },
|
|
519
|
+
]
|
|
520
|
+
|
|
448
521
|
[[package]]
|
|
449
522
|
name = "markdown"
|
|
450
523
|
version = "3.10"
|
|
@@ -541,7 +614,7 @@ wheels = [
|
|
|
541
614
|
|
|
542
615
|
[[package]]
|
|
543
616
|
name = "md2pdf"
|
|
544
|
-
version = "2.
|
|
617
|
+
version = "2.1.0"
|
|
545
618
|
source = { editable = "." }
|
|
546
619
|
dependencies = [
|
|
547
620
|
{ name = "click" },
|
|
@@ -556,9 +629,12 @@ dependencies = [
|
|
|
556
629
|
[package.dev-dependencies]
|
|
557
630
|
dev = [
|
|
558
631
|
{ name = "black" },
|
|
632
|
+
{ name = "mypy" },
|
|
633
|
+
{ name = "pypdf" },
|
|
559
634
|
{ name = "pytest" },
|
|
560
635
|
{ name = "pytest-cov" },
|
|
561
636
|
{ name = "ruff" },
|
|
637
|
+
{ name = "types-markdown" },
|
|
562
638
|
]
|
|
563
639
|
|
|
564
640
|
[package.metadata]
|
|
@@ -575,9 +651,58 @@ requires-dist = [
|
|
|
575
651
|
[package.metadata.requires-dev]
|
|
576
652
|
dev = [
|
|
577
653
|
{ name = "black", specifier = ">=25.12.0" },
|
|
654
|
+
{ name = "mypy", specifier = ">=1.19.1" },
|
|
655
|
+
{ name = "pypdf", specifier = ">=6.6.0" },
|
|
578
656
|
{ name = "pytest", specifier = ">=9.0.2" },
|
|
579
657
|
{ name = "pytest-cov", specifier = ">=7.0.0" },
|
|
580
658
|
{ name = "ruff", specifier = ">=0.14.10" },
|
|
659
|
+
{ name = "types-markdown", specifier = ">=3.10.0.20251106" },
|
|
660
|
+
]
|
|
661
|
+
|
|
662
|
+
[[package]]
|
|
663
|
+
name = "mypy"
|
|
664
|
+
version = "1.19.1"
|
|
665
|
+
source = { registry = "https://pypi.org/simple" }
|
|
666
|
+
dependencies = [
|
|
667
|
+
{ name = "librt", marker = "platform_python_implementation != 'PyPy'" },
|
|
668
|
+
{ name = "mypy-extensions" },
|
|
669
|
+
{ name = "pathspec" },
|
|
670
|
+
{ name = "tomli", marker = "python_full_version < '3.11'" },
|
|
671
|
+
{ name = "typing-extensions" },
|
|
672
|
+
]
|
|
673
|
+
sdist = { url = "https://files.pythonhosted.org/packages/f5/db/4efed9504bc01309ab9c2da7e352cc223569f05478012b5d9ece38fd44d2/mypy-1.19.1.tar.gz", hash = "sha256:19d88bb05303fe63f71dd2c6270daca27cb9401c4ca8255fe50d1d920e0eb9ba", size = 3582404, upload-time = "2025-12-15T05:03:48.42Z" }
|
|
674
|
+
wheels = [
|
|
675
|
+
{ url = "https://files.pythonhosted.org/packages/2f/63/e499890d8e39b1ff2df4c0c6ce5d371b6844ee22b8250687a99fd2f657a8/mypy-1.19.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5f05aa3d375b385734388e844bc01733bd33c644ab48e9684faa54e5389775ec", size = 13101333, upload-time = "2025-12-15T05:03:03.28Z" },
|
|
676
|
+
{ url = "https://files.pythonhosted.org/packages/72/4b/095626fc136fba96effc4fd4a82b41d688ab92124f8c4f7564bffe5cf1b0/mypy-1.19.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:022ea7279374af1a5d78dfcab853fe6a536eebfda4b59deab53cd21f6cd9f00b", size = 12164102, upload-time = "2025-12-15T05:02:33.611Z" },
|
|
677
|
+
{ url = "https://files.pythonhosted.org/packages/0c/5b/952928dd081bf88a83a5ccd49aaecfcd18fd0d2710c7ff07b8fb6f7032b9/mypy-1.19.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee4c11e460685c3e0c64a4c5de82ae143622410950d6be863303a1c4ba0e36d6", size = 12765799, upload-time = "2025-12-15T05:03:28.44Z" },
|
|
678
|
+
{ url = "https://files.pythonhosted.org/packages/2a/0d/93c2e4a287f74ef11a66fb6d49c7a9f05e47b0a4399040e6719b57f500d2/mypy-1.19.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de759aafbae8763283b2ee5869c7255391fbc4de3ff171f8f030b5ec48381b74", size = 13522149, upload-time = "2025-12-15T05:02:36.011Z" },
|
|
679
|
+
{ url = "https://files.pythonhosted.org/packages/7b/0e/33a294b56aaad2b338d203e3a1d8b453637ac36cb278b45005e0901cf148/mypy-1.19.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ab43590f9cd5108f41aacf9fca31841142c786827a74ab7cc8a2eacb634e09a1", size = 13810105, upload-time = "2025-12-15T05:02:40.327Z" },
|
|
680
|
+
{ url = "https://files.pythonhosted.org/packages/0e/fd/3e82603a0cb66b67c5e7abababce6bf1a929ddf67bf445e652684af5c5a0/mypy-1.19.1-cp310-cp310-win_amd64.whl", hash = "sha256:2899753e2f61e571b3971747e302d5f420c3fd09650e1951e99f823bc3089dac", size = 10057200, upload-time = "2025-12-15T05:02:51.012Z" },
|
|
681
|
+
{ url = "https://files.pythonhosted.org/packages/ef/47/6b3ebabd5474d9cdc170d1342fbf9dddc1b0ec13ec90bf9004ee6f391c31/mypy-1.19.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d8dfc6ab58ca7dda47d9237349157500468e404b17213d44fc1cb77bce532288", size = 13028539, upload-time = "2025-12-15T05:03:44.129Z" },
|
|
682
|
+
{ url = "https://files.pythonhosted.org/packages/5c/a6/ac7c7a88a3c9c54334f53a941b765e6ec6c4ebd65d3fe8cdcfbe0d0fd7db/mypy-1.19.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e3f276d8493c3c97930e354b2595a44a21348b320d859fb4a2b9f66da9ed27ab", size = 12083163, upload-time = "2025-12-15T05:03:37.679Z" },
|
|
683
|
+
{ url = "https://files.pythonhosted.org/packages/67/af/3afa9cf880aa4a2c803798ac24f1d11ef72a0c8079689fac5cfd815e2830/mypy-1.19.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2abb24cf3f17864770d18d673c85235ba52456b36a06b6afc1e07c1fdcd3d0e6", size = 12687629, upload-time = "2025-12-15T05:02:31.526Z" },
|
|
684
|
+
{ url = "https://files.pythonhosted.org/packages/2d/46/20f8a7114a56484ab268b0ab372461cb3a8f7deed31ea96b83a4e4cfcfca/mypy-1.19.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a009ffa5a621762d0c926a078c2d639104becab69e79538a494bcccb62cc0331", size = 13436933, upload-time = "2025-12-15T05:03:15.606Z" },
|
|
685
|
+
{ url = "https://files.pythonhosted.org/packages/5b/f8/33b291ea85050a21f15da910002460f1f445f8007adb29230f0adea279cb/mypy-1.19.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f7cee03c9a2e2ee26ec07479f38ea9c884e301d42c6d43a19d20fb014e3ba925", size = 13661754, upload-time = "2025-12-15T05:02:26.731Z" },
|
|
686
|
+
{ url = "https://files.pythonhosted.org/packages/fd/a3/47cbd4e85bec4335a9cd80cf67dbc02be21b5d4c9c23ad6b95d6c5196bac/mypy-1.19.1-cp311-cp311-win_amd64.whl", hash = "sha256:4b84a7a18f41e167f7995200a1d07a4a6810e89d29859df936f1c3923d263042", size = 10055772, upload-time = "2025-12-15T05:03:26.179Z" },
|
|
687
|
+
{ url = "https://files.pythonhosted.org/packages/06/8a/19bfae96f6615aa8a0604915512e0289b1fad33d5909bf7244f02935d33a/mypy-1.19.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a8174a03289288c1f6c46d55cef02379b478bfbc8e358e02047487cad44c6ca1", size = 13206053, upload-time = "2025-12-15T05:03:46.622Z" },
|
|
688
|
+
{ url = "https://files.pythonhosted.org/packages/a5/34/3e63879ab041602154ba2a9f99817bb0c85c4df19a23a1443c8986e4d565/mypy-1.19.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ffcebe56eb09ff0c0885e750036a095e23793ba6c2e894e7e63f6d89ad51f22e", size = 12219134, upload-time = "2025-12-15T05:03:24.367Z" },
|
|
689
|
+
{ url = "https://files.pythonhosted.org/packages/89/cc/2db6f0e95366b630364e09845672dbee0cbf0bbe753a204b29a944967cd9/mypy-1.19.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b64d987153888790bcdb03a6473d321820597ab8dd9243b27a92153c4fa50fd2", size = 12731616, upload-time = "2025-12-15T05:02:44.725Z" },
|
|
690
|
+
{ url = "https://files.pythonhosted.org/packages/00/be/dd56c1fd4807bc1eba1cf18b2a850d0de7bacb55e158755eb79f77c41f8e/mypy-1.19.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c35d298c2c4bba75feb2195655dfea8124d855dfd7343bf8b8c055421eaf0cf8", size = 13620847, upload-time = "2025-12-15T05:03:39.633Z" },
|
|
691
|
+
{ url = "https://files.pythonhosted.org/packages/6d/42/332951aae42b79329f743bf1da088cd75d8d4d9acc18fbcbd84f26c1af4e/mypy-1.19.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:34c81968774648ab5ac09c29a375fdede03ba253f8f8287847bd480782f73a6a", size = 13834976, upload-time = "2025-12-15T05:03:08.786Z" },
|
|
692
|
+
{ url = "https://files.pythonhosted.org/packages/6f/63/e7493e5f90e1e085c562bb06e2eb32cae27c5057b9653348d38b47daaecc/mypy-1.19.1-cp312-cp312-win_amd64.whl", hash = "sha256:b10e7c2cd7870ba4ad9b2d8a6102eb5ffc1f16ca35e3de6bfa390c1113029d13", size = 10118104, upload-time = "2025-12-15T05:03:10.834Z" },
|
|
693
|
+
{ url = "https://files.pythonhosted.org/packages/de/9f/a6abae693f7a0c697dbb435aac52e958dc8da44e92e08ba88d2e42326176/mypy-1.19.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e3157c7594ff2ef1634ee058aafc56a82db665c9438fd41b390f3bde1ab12250", size = 13201927, upload-time = "2025-12-15T05:02:29.138Z" },
|
|
694
|
+
{ url = "https://files.pythonhosted.org/packages/9a/a4/45c35ccf6e1c65afc23a069f50e2c66f46bd3798cbe0d680c12d12935caa/mypy-1.19.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bdb12f69bcc02700c2b47e070238f42cb87f18c0bc1fc4cdb4fb2bc5fd7a3b8b", size = 12206730, upload-time = "2025-12-15T05:03:01.325Z" },
|
|
695
|
+
{ url = "https://files.pythonhosted.org/packages/05/bb/cdcf89678e26b187650512620eec8368fded4cfd99cfcb431e4cdfd19dec/mypy-1.19.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f859fb09d9583a985be9a493d5cfc5515b56b08f7447759a0c5deaf68d80506e", size = 12724581, upload-time = "2025-12-15T05:03:20.087Z" },
|
|
696
|
+
{ url = "https://files.pythonhosted.org/packages/d1/32/dd260d52babf67bad8e6770f8e1102021877ce0edea106e72df5626bb0ec/mypy-1.19.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c9a6538e0415310aad77cb94004ca6482330fece18036b5f360b62c45814c4ef", size = 13616252, upload-time = "2025-12-15T05:02:49.036Z" },
|
|
697
|
+
{ url = "https://files.pythonhosted.org/packages/71/d0/5e60a9d2e3bd48432ae2b454b7ef2b62a960ab51292b1eda2a95edd78198/mypy-1.19.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:da4869fc5e7f62a88f3fe0b5c919d1d9f7ea3cef92d3689de2823fd27e40aa75", size = 13840848, upload-time = "2025-12-15T05:02:55.95Z" },
|
|
698
|
+
{ url = "https://files.pythonhosted.org/packages/98/76/d32051fa65ecf6cc8c6610956473abdc9b4c43301107476ac03559507843/mypy-1.19.1-cp313-cp313-win_amd64.whl", hash = "sha256:016f2246209095e8eda7538944daa1d60e1e8134d98983b9fc1e92c1fc0cb8dd", size = 10135510, upload-time = "2025-12-15T05:02:58.438Z" },
|
|
699
|
+
{ url = "https://files.pythonhosted.org/packages/de/eb/b83e75f4c820c4247a58580ef86fcd35165028f191e7e1ba57128c52782d/mypy-1.19.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:06e6170bd5836770e8104c8fdd58e5e725cfeb309f0a6c681a811f557e97eac1", size = 13199744, upload-time = "2025-12-15T05:03:30.823Z" },
|
|
700
|
+
{ url = "https://files.pythonhosted.org/packages/94/28/52785ab7bfa165f87fcbb61547a93f98bb20e7f82f90f165a1f69bce7b3d/mypy-1.19.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:804bd67b8054a85447c8954215a906d6eff9cabeabe493fb6334b24f4bfff718", size = 12215815, upload-time = "2025-12-15T05:02:42.323Z" },
|
|
701
|
+
{ url = "https://files.pythonhosted.org/packages/0a/c6/bdd60774a0dbfb05122e3e925f2e9e846c009e479dcec4821dad881f5b52/mypy-1.19.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:21761006a7f497cb0d4de3d8ef4ca70532256688b0523eee02baf9eec895e27b", size = 12740047, upload-time = "2025-12-15T05:03:33.168Z" },
|
|
702
|
+
{ url = "https://files.pythonhosted.org/packages/32/2a/66ba933fe6c76bd40d1fe916a83f04fed253152f451a877520b3c4a5e41e/mypy-1.19.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:28902ee51f12e0f19e1e16fbe2f8f06b6637f482c459dd393efddd0ec7f82045", size = 13601998, upload-time = "2025-12-15T05:03:13.056Z" },
|
|
703
|
+
{ url = "https://files.pythonhosted.org/packages/e3/da/5055c63e377c5c2418760411fd6a63ee2b96cf95397259038756c042574f/mypy-1.19.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:481daf36a4c443332e2ae9c137dfee878fcea781a2e3f895d54bd3002a900957", size = 13807476, upload-time = "2025-12-15T05:03:17.977Z" },
|
|
704
|
+
{ url = "https://files.pythonhosted.org/packages/cd/09/4ebd873390a063176f06b0dbf1f7783dd87bd120eae7727fa4ae4179b685/mypy-1.19.1-cp314-cp314-win_amd64.whl", hash = "sha256:8bb5c6f6d043655e055be9b542aa5f3bdd30e4f3589163e85f93f3640060509f", size = 10281872, upload-time = "2025-12-15T05:03:05.549Z" },
|
|
705
|
+
{ url = "https://files.pythonhosted.org/packages/8d/f4/4ce9a05ce5ded1de3ec1c1d96cf9f9504a04e54ce0ed55cfa38619a32b8d/mypy-1.19.1-py3-none-any.whl", hash = "sha256:f1235f5ea01b7db5468d53ece6aaddf1ad0b88d9e7462b86ef96fe04995d7247", size = 2471239, upload-time = "2025-12-15T05:03:07.248Z" },
|
|
581
706
|
]
|
|
582
707
|
|
|
583
708
|
[[package]]
|
|
@@ -763,6 +888,18 @@ wheels = [
|
|
|
763
888
|
{ url = "https://files.pythonhosted.org/packages/ea/10/47caf89cbb52e5bb764696fd52a8c591a2f0e851a93270c05a17f36000b5/pymdown_extensions-10.20-py3-none-any.whl", hash = "sha256:ea9e62add865da80a271d00bfa1c0fa085b20d133fb3fc97afdc88e682f60b2f", size = 268733, upload-time = "2025-12-31T19:59:40.652Z" },
|
|
764
889
|
]
|
|
765
890
|
|
|
891
|
+
[[package]]
|
|
892
|
+
name = "pypdf"
|
|
893
|
+
version = "6.6.0"
|
|
894
|
+
source = { registry = "https://pypi.org/simple" }
|
|
895
|
+
dependencies = [
|
|
896
|
+
{ name = "typing-extensions", marker = "python_full_version < '3.11'" },
|
|
897
|
+
]
|
|
898
|
+
sdist = { url = "https://files.pythonhosted.org/packages/d8/f4/801632a8b62a805378b6af2b5a3fcbfd8923abf647e0ed1af846a83433b2/pypdf-6.6.0.tar.gz", hash = "sha256:4c887ef2ea38d86faded61141995a3c7d068c9d6ae8477be7ae5de8a8e16592f", size = 5281063, upload-time = "2026-01-09T11:20:11.786Z" }
|
|
899
|
+
wheels = [
|
|
900
|
+
{ url = "https://files.pythonhosted.org/packages/b2/ba/96f99276194f720e74ed99905a080f6e77810558874e8935e580331b46de/pypdf-6.6.0-py3-none-any.whl", hash = "sha256:bca9091ef6de36c7b1a81e09327c554b7ce51e88dad68f5890c2b4a4417f1fd7", size = 328963, upload-time = "2026-01-09T11:20:09.278Z" },
|
|
901
|
+
]
|
|
902
|
+
|
|
766
903
|
[[package]]
|
|
767
904
|
name = "pyphen"
|
|
768
905
|
version = "0.17.2"
|
|
@@ -988,6 +1125,15 @@ wheels = [
|
|
|
988
1125
|
{ url = "https://files.pythonhosted.org/packages/77/b8/0135fadc89e73be292b473cb820b4f5a08197779206b33191e801feeae40/tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b", size = 14408, upload-time = "2025-10-08T22:01:46.04Z" },
|
|
989
1126
|
]
|
|
990
1127
|
|
|
1128
|
+
[[package]]
|
|
1129
|
+
name = "types-markdown"
|
|
1130
|
+
version = "3.10.0.20251106"
|
|
1131
|
+
source = { registry = "https://pypi.org/simple" }
|
|
1132
|
+
sdist = { url = "https://files.pythonhosted.org/packages/de/e4/060f0dadd9b551cae77d6407f2bc84b168f918d90650454aff219c1b3ed2/types_markdown-3.10.0.20251106.tar.gz", hash = "sha256:12836f7fcbd7221db8baeb0d3a2f820b95050d0824bfa9665c67b4d144a1afa1", size = 19486, upload-time = "2025-11-06T03:06:44.317Z" }
|
|
1133
|
+
wheels = [
|
|
1134
|
+
{ url = "https://files.pythonhosted.org/packages/92/58/f666ca9391f2a8bd33bb0b0797cde6ac3e764866708d5f8aec6fab215320/types_markdown-3.10.0.20251106-py3-none-any.whl", hash = "sha256:2c39512a573899b59efae07e247ba088a75b70e3415e81277692718f430afd7e", size = 25862, upload-time = "2025-11-06T03:06:43.082Z" },
|
|
1135
|
+
]
|
|
1136
|
+
|
|
991
1137
|
[[package]]
|
|
992
1138
|
name = "typing-extensions"
|
|
993
1139
|
version = "4.15.0"
|
md2pdf-2.0.0/src/md2pdf/cli.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"""md2pdf CLI."""
|
|
2
|
-
|
|
3
|
-
import logging
|
|
4
|
-
from importlib.metadata import version
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
from typing import Optional
|
|
7
|
-
|
|
8
|
-
import click
|
|
9
|
-
|
|
10
|
-
from .core import md2pdf
|
|
11
|
-
|
|
12
|
-
logger = logging.getLogger(__name__)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@click.command(name="md2pdf")
|
|
16
|
-
@click.argument("md", type=click.Path(exists=True))
|
|
17
|
-
@click.argument("pdf", type=click.Path())
|
|
18
|
-
@click.option("--css", "css", type=click.Path(exists=True))
|
|
19
|
-
@click.option("--extras", "-e", "extras", multiple=True, type=str)
|
|
20
|
-
@click.version_option(version=version("md2pdf"))
|
|
21
|
-
def cli(md: Path, pdf: Path, css: Optional[Path], extras: list):
|
|
22
|
-
"""md2pdf command line tool."""
|
|
23
|
-
if css is not None:
|
|
24
|
-
css = Path(css)
|
|
25
|
-
|
|
26
|
-
md2pdf(Path(pdf), md=Path(md), css=css, base_url=Path.cwd(), extras=list(extras))
|
md2pdf-2.0.0/tests/test_cli.py
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"""md2pdf tests for the CLI."""
|
|
2
|
-
|
|
3
|
-
from os import remove
|
|
4
|
-
from os.path import exists
|
|
5
|
-
|
|
6
|
-
from click.testing import CliRunner
|
|
7
|
-
|
|
8
|
-
from md2pdf.cli import cli
|
|
9
|
-
|
|
10
|
-
from .defaults import INPUT_CSS, INPUT_MD, OUTPUT_PDF
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def setup_function(function):
|
|
14
|
-
"""Remove temporary PDF files."""
|
|
15
|
-
if exists(OUTPUT_PDF):
|
|
16
|
-
remove(OUTPUT_PDF)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def test_print_usage_when_no_args():
|
|
20
|
-
"""Print usage when no arguments are passed."""
|
|
21
|
-
runner = CliRunner()
|
|
22
|
-
result = runner.invoke(cli)
|
|
23
|
-
expected = "Usage: md2pdf [OPTIONS] MD PDF"
|
|
24
|
-
assert result.exit_code == 2
|
|
25
|
-
assert expected in result.output
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def test_print_usage_when_partial_args():
|
|
29
|
-
"""Print usage when required arguments are missing."""
|
|
30
|
-
runner = CliRunner()
|
|
31
|
-
result = runner.invoke(cli, ["input.md"])
|
|
32
|
-
expected = "Usage: md2pdf [OPTIONS] MD PDF"
|
|
33
|
-
assert result.exit_code == 2
|
|
34
|
-
assert expected in result.output
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def test_raise_IOError_when_markdown_input_file_does_not_exists():
|
|
38
|
-
"""Raise an I/O error when markdown input file does not exist."""
|
|
39
|
-
runner = CliRunner()
|
|
40
|
-
result = runner.invoke(cli, ["input.md", "output.pdf"])
|
|
41
|
-
expected = "Error: Invalid value for 'MD': Path 'input.md' does not exist."
|
|
42
|
-
assert result.exit_code == 2
|
|
43
|
-
assert expected in result.output
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def test_raise_IOError_when_stylesheet_does_not_exists():
|
|
47
|
-
"""Raise an I/O error when CSS input file does not exist."""
|
|
48
|
-
runner = CliRunner()
|
|
49
|
-
result = runner.invoke(cli, ["--css=styles.css", str(INPUT_MD), str(OUTPUT_PDF)])
|
|
50
|
-
expected = "Error: Invalid value for '--css': Path 'styles.css' does not exist."
|
|
51
|
-
assert result.exit_code == 2
|
|
52
|
-
assert expected in result.output
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def test_generate_pdf_from_markdown_source_file():
|
|
56
|
-
"""Generate a PDF from a markdown file."""
|
|
57
|
-
assert not OUTPUT_PDF.exists()
|
|
58
|
-
runner = CliRunner()
|
|
59
|
-
runner.invoke(cli, [str(INPUT_MD), str(OUTPUT_PDF)])
|
|
60
|
-
assert OUTPUT_PDF.exists()
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
def test_generate_pdf_from_markdown_source_file_and_stylesheet():
|
|
64
|
-
"""Generate a PDF from a markdown and a CSS file."""
|
|
65
|
-
assert not OUTPUT_PDF.exists()
|
|
66
|
-
runner = CliRunner()
|
|
67
|
-
runner.invoke(cli, [f"--css={INPUT_CSS}", str(INPUT_MD), str(OUTPUT_PDF)])
|
|
68
|
-
assert OUTPUT_PDF.exists()
|
md2pdf-2.0.0/tests/test_core.py
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"""md2pdf tests for the core module."""
|
|
2
|
-
|
|
3
|
-
from os import remove
|
|
4
|
-
from os.path import exists
|
|
5
|
-
|
|
6
|
-
import pytest
|
|
7
|
-
|
|
8
|
-
from md2pdf import md2pdf
|
|
9
|
-
from md2pdf.exceptions import ValidationError
|
|
10
|
-
|
|
11
|
-
from .defaults import INPUT_MD, OUTPUT_PDF
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def setup_function(function):
|
|
15
|
-
"""Remove temporary PDF files."""
|
|
16
|
-
if exists(OUTPUT_PDF):
|
|
17
|
-
remove(OUTPUT_PDF)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def test_generate_pdf_from_markdown_file():
|
|
21
|
-
"""Generate a PDF from markdown file content."""
|
|
22
|
-
assert not exists(OUTPUT_PDF)
|
|
23
|
-
|
|
24
|
-
md2pdf(pdf=OUTPUT_PDF, md=INPUT_MD)
|
|
25
|
-
assert exists(OUTPUT_PDF)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def test_generate_pdf_from_raw_markdown():
|
|
29
|
-
"""Generate a PDF from raw markdown content."""
|
|
30
|
-
assert not exists(OUTPUT_PDF)
|
|
31
|
-
|
|
32
|
-
md2pdf(OUTPUT_PDF, raw="# hi there!")
|
|
33
|
-
assert exists(OUTPUT_PDF)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def test_raises_a_validation_error_when_generated_html_is_empty():
|
|
37
|
-
"""Raise a ValidationError when generated HTML is empty."""
|
|
38
|
-
with pytest.raises(ValidationError):
|
|
39
|
-
md2pdf(OUTPUT_PDF)
|
|
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
|