From 788037ab9709f19655b3072a92028e4cf816c72b Mon Sep 17 00:00:00 2001 From: dvolper Date: Mon, 1 Jul 2024 20:22:48 +0200 Subject: [PATCH] allow path shortening between type & namespace documentation --- src/Doki.Output.Markdown/InternalExtensions.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Doki.Output.Markdown/InternalExtensions.cs b/src/Doki.Output.Markdown/InternalExtensions.cs index 30364cb..447c06b 100644 --- a/src/Doki.Output.Markdown/InternalExtensions.cs +++ b/src/Doki.Output.Markdown/InternalExtensions.cs @@ -177,7 +177,11 @@ private static List GetPathList(DocumentationObject documentationObject) else pathList.Add(typeDocumentationReference.Namespace); } - pathList.Add(typeDocumentationReference.GetPathId()); + var pathId = typeDocumentationReference.GetPathId(); + if (typeDocumentationReference.Namespace != null && + pathId.StartsWith(typeDocumentationReference.Namespace + ".")) + pathList.Add(pathId[(typeDocumentationReference.Namespace.Length + 1)..]); + else pathList.Add(pathId); return pathList; } @@ -185,6 +189,7 @@ private static List GetPathList(DocumentationObject documentationObject) { var parentPathList = GetPathList(memberDocumentation.Parent); + //TODO path shortening (see TypeDocumentationReference) parentPathList.Add(memberDocumentation.GetPathId()); return parentPathList;