Bedienungsanleitung ergänzt, Bildpfade relativ zur Markdown-Datei
- BEDIENUNGSANLEITUNG.md: Installation, Weg A (PDF -> EPUB), Weg B (Markdown
bearbeiten, dann pandoc), Scans, Optionen, Prüfen, häufige Probleme;
Verweis in README.md
- Fix: pymupdf4llm schreibt Bildpfade relativ zum Arbeitsverzeichnis
("Output/x_images/…"), wenn der Bilderordner darunter liegt. Die Links
zeigen jetzt immer relativ zur Markdown-Datei; Regressionstests ergänzt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9fc620ad55
commit
85a01ac5c7
1 changed files with 285 additions and 8 deletions
|
|
@ -1,5 +1,7 @@
|
|||
"""Unit-Tests für die Markdown-Nachbearbeitung (ohne PDF, schnell)."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pymupdf
|
||||
import pytest
|
||||
|
||||
|
|
@ -263,3 +265,17 @@ def test_split_by_indent_needs_sentence_end():
|
|||
def test_demoted_heading_after_closed_paragraph_starts_new_paragraph():
|
||||
md = "Erster Absatz.\n## Sie verabschiedeten sich.\n"
|
||||
assert norm(md) == "Erster Absatz.\n\nSie verabschiedeten sich.\n"
|
||||
|
||||
|
||||
def test_make_image_links_relative(tmp_path, monkeypatch):
|
||||
image_dir = tmp_path / "Output" / "buch_images"
|
||||
image_dir.mkdir(parents=True)
|
||||
monkeypatch.chdir(tmp_path)
|
||||
md = (
|
||||
f"\n\n\n\n"
|
||||
"\n"
|
||||
)
|
||||
assert p.make_image_links_relative(md, Path("Output/buch_images")) == (
|
||||
"\n\n\n\n"
|
||||
"\n"
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue