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() + } + );