From 2c68539a4af7dae1cc2000366649735cdac00ae4 Mon Sep 17 00:00:00 2001 From: Rafael Vuijk Date: Mon, 26 Oct 2026 23:52:37 +0000 Subject: [PATCH] A cross-reference on a member's page leads to its target Yadg.NET writes a member's page at Namespace/Type/Member.html, two folders below the root of the docs, and wrote each cross-reference in its description with one "../" in front, as on a type's page one folder up. So every link from a member's page to another type or member led into the member's own namespace folder, where there is no such page: from MultivariatePolynomial.DivideExact, MaxDegree was docs/AngouriMath.Functions/AngouriMath.Functions/MultivariatePolynomial/MaxDegree.html. That was 930 of the 1,174 broken links a check of a local build finds. Yadg.NET has not changed since July 2022 and this repository cannot push to it, so the fix is a patch the site carries, Yadg.NET.patch, which init applies to the commit it was written against. The clone keeps LF line endings, and .gitattributes keeps the patch's, so it applies on Windows too. A clone made before this keeps the old generator; uninit and init again to pick up the patch. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura --- .gitattributes | 1 + amsite.fsx | 7 ++++++- src/Yadg.NET.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 src/Yadg.NET.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..3d1a2d2b6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +src/Yadg.NET.patch text eol=lf diff --git a/amsite.fsx b/amsite.fsx index 30ea050c3..9a1311c26 100644 --- a/amsite.fsx +++ b/amsite.fsx @@ -68,7 +68,12 @@ let init () = if dirExists("." / generatorP / "Yadg.NET") then log "Skipping Yadg.NET cloning..." else - git ("." / generatorP) "clone https://github.com/WhiteBlackGoose/Yadg.NET Yadg.NET" + git ("." / generatorP) "clone -c core.autocrlf=false https://github.com/WhiteBlackGoose/Yadg.NET Yadg.NET" + // Yadg.NET has not changed since 2022 and this repository cannot push to it, so the + // site carries its fixes in Yadg.NET.patch, at the commit the patch was written against. + // The clone keeps LF line endings on Windows too, as the patch has them. + git ("." / generatorP / "Yadg.NET") "checkout --quiet a79a053df06a2a87d4fc6fac84dd5e81cecc11f6" + git ("." / generatorP / "Yadg.NET") "apply ../Yadg.NET.patch" if dirExists("." / generatorP / contentP / "_wiki") then log "Skipping wiki cloning..." diff --git a/src/Yadg.NET.patch b/src/Yadg.NET.patch new file mode 100644 index 000000000..89f4c5172 --- /dev/null +++ b/src/Yadg.NET.patch @@ -0,0 +1,50 @@ +diff --git a/Yadg.NET/WebsiteBuilder/MemberPageBuilder.cs b/Yadg.NET/WebsiteBuilder/MemberPageBuilder.cs +index 3caa5da..36ed5fe 100644 +--- a/Yadg.NET/WebsiteBuilder/MemberPageBuilder.cs ++++ b/Yadg.NET/WebsiteBuilder/MemberPageBuilder.cs +@@ -10,6 +10,10 @@ public sealed record MemberPageBuilder(INamedDocMember Member) + " "; + + public string BackToMembersButtonText { get; init; } ++ ++ // A member's page is Namespace/Type/Member.html, two folders below the root of the docs, as ++ // the link back to its type allows for. A cross-reference is written from that root, so it ++ // climbs both; climbing one led into the type's own namespace, where nothing is. + public string Build(string back) + => + p(a($"../../{back}", $"{BackToMembersButtonText}")) + +@@ -26,7 +30,7 @@ public sealed record MemberPageBuilder(INamedDocMember Member) + h1(MemberListBuilder.SplitWrapWordsMethod(method.Name + method.Overloads.First().Parameters)) + + p($"{IconNextToMemberInfo}Method (no overloads)") + ) + +- p(new DescriptionFromXmlBuilder(method.Overloads.First().Description, "../").Build()) ++ p(new DescriptionFromXmlBuilder(method.Overloads.First().Description, "../../").Build()) + + : + +@@ -39,7 +43,7 @@ public sealed record MemberPageBuilder(INamedDocMember Member) + method.Overloads.Select( + overload => + h3(MemberListBuilder.SplitWrapWordsMethod(method.Name + overload.Parameters)) + +- p(new DescriptionFromXmlBuilder(overload.Description, "../").Build()) ++ p(new DescriptionFromXmlBuilder(overload.Description, "../../").Build()) + ) + ) + ) +@@ -50,14 +54,14 @@ public sealed record MemberPageBuilder(INamedDocMember Member) + p($"{IconNextToMemberInfo}Property") + ) + + +- p(new DescriptionFromXmlBuilder(property.Description, "../").Build()), ++ p(new DescriptionFromXmlBuilder(property.Description, "../../").Build()), + DocField field => + p( + h1(field.Name) + + p($"{IconNextToMemberInfo}Field") + ) + + +- p(new DescriptionFromXmlBuilder(field.Description, "../").Build()), ++ p(new DescriptionFromXmlBuilder(field.Description, "../../").Build()), + _ => throw new Exception() + } + );