From 147a34c573496748ea242b7c085e644d3dc2331c Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 17 May 2025 17:50:34 +0200 Subject: [PATCH] doc: Render verbatim @docroot@ on contributing page In rendered form: ```diff -Add references to the manual using .. +Add references to the manual using [links like this](@docroot@/example.md) ``` --- doc/manual/source/development/contributing.md | 3 ++- doc/manual/substitute.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/manual/source/development/contributing.md b/doc/manual/source/development/contributing.md index 7de7489dc..5c32aeb71 100644 --- a/doc/manual/source/development/contributing.md +++ b/doc/manual/source/development/contributing.md @@ -20,8 +20,9 @@ prs: 1238 Here's one or more paragraphs that describe the change. - It's markdown -- Add references to the manual using @docroot@ +- Add references to the manual using [links like this](@_at_docroot@/example.md) ``` + Significant changes should add the following header, which moves them to the top. diff --git a/doc/manual/substitute.py b/doc/manual/substitute.py index a8b11d932..6e27c3388 100644 --- a/doc/manual/substitute.py +++ b/doc/manual/substitute.py @@ -57,6 +57,9 @@ def recursive_replace(data: dict[str, t.Any], book_root: Path, search_path: Path ).replace( '@docroot@', ("../" * len(path_to_chapter.parent.parts) or "./")[:-1] + ).replace( + '@_at_', + '@' ), sub_items = [ recursive_replace(sub_item, book_root, search_path)