Skip to content

Commit

Permalink
allow path shortening between type & namespace documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidVollmers committed Jul 1, 2024
1 parent 8677c14 commit 788037a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Doki.Output.Markdown/InternalExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,19 @@ private static List<string> 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;
}
case MemberDocumentation { Parent: not null } memberDocumentation:
{
var parentPathList = GetPathList(memberDocumentation.Parent);

Check warning on line 190 in src/Doki.Output.Markdown/InternalExtensions.cs

View workflow job for this annotation

GitHub Actions / Test

Possible null reference argument for parameter 'documentationObject' in 'List<string> InternalExtensions.GetPathList(DocumentationObject documentationObject)'.

Check warning on line 190 in src/Doki.Output.Markdown/InternalExtensions.cs

View workflow job for this annotation

GitHub Actions / Test

Possible null reference argument for parameter 'documentationObject' in 'List<string> InternalExtensions.GetPathList(DocumentationObject documentationObject)'.

//TODO path shortening (see TypeDocumentationReference)
parentPathList.Add(memberDocumentation.GetPathId());

return parentPathList;
Expand Down

0 comments on commit 788037a

Please sign in to comment.