diff --git a/contrib/book.py b/contrib/book.py index 3c199b8..1cf9b79 100644 --- a/contrib/book.py +++ b/contrib/book.py @@ -117,7 +117,7 @@ def assemble(root): if clash := sorted(name for name in pages if name.casefold() in reserved): raise ValueError(f"generated by book.py: {', '.join(clash)}") generated = { - "README.md": (root / "README.md").read_text(), + "README.md": re.sub(r"(?<=\]\()docs/", "", (root / "README.md").read_text()), "SUMMARY.md": summary(index, pages), CONTENTS: contents(index), } diff --git a/contrib/test_book.py b/contrib/test_book.py index 0454251..25f5c09 100644 --- a/contrib/test_book.py +++ b/contrib/test_book.py @@ -167,7 +167,7 @@ def test_assembly_covers_every_chapter(tmp_path): "one.md", "sub/two.md", ] - assert (out / "README.md").read_text() == "# Intro\n\nSee [one](docs/one.md).\n" + assert (out / "README.md").read_text() == "# Intro\n\nSee [one](one.md).\n" contents = (out / "contents.md").read_text() assert "* [Two](sub/two.md) - The second chapter." in contents assert (out / "one.md").read_text() == "# One\n"