docs(thesis): resolve review findings and verify examples

This commit is contained in:
lda
2026-09-14 13:40:11 +07:00 Verified
parent 5495dc5656
commit 396caa63d6
8 changed files with 273 additions and 45 deletions
+43
View File
@@ -58,3 +58,46 @@ def test_abbreviations_compile_without_a_dummy_float(tmp_path: Path) -> None:
assert "API" in rendered
assert "Application Programming Interface" in rendered
assert "None 1" not in rendered
@pytest.mark.skipif(
any(shutil.which(tool) is None for tool in ("pandoc", "xelatex", "pdftotext")),
reason="Pandoc, XeLaTeX, and pdftotext are needed for the inline-code build",
)
def test_inline_identifier_moves_to_next_line_intact(tmp_path: Path) -> None:
"""A prose line ending must not split a callable's name into fragments."""
output = tmp_path / "inline.pdf"
identifier = "local.report.render_markdown_report"
result = subprocess.run(
[
"pandoc",
"--standalone",
"--pdf-engine=xelatex",
"--variable=geometry:textwidth=10cm",
"--variable=monofont:Libertinus Mono",
"--include-in-header",
str(THESIS / "header-includes.tex"),
"--output",
str(output),
],
# Shift the identifier along the line to expose both forced splitting
# and font-dependent automatic hyphenation near the right margin.
input="\n\n".join(
f"{'word ' * count}`{identifier}`." for count in range(1, 16)
),
text=True,
encoding="utf-8",
capture_output=True,
check=False,
timeout=90,
)
assert result.returncode == 0, result.stderr
rendered = subprocess.run(
["pdftotext", "-layout", str(output), "-"],
capture_output=True,
text=True,
encoding="utf-8",
check=True,
timeout=15,
).stdout
assert rendered.count(identifier) == 15