dotnet / dotnet/docfx

[Question] How can I change the API Documentation to sort by access modifier and then alphabetical

Open
#7,872 1 comment 0 reactions 0 assignees View on GitHub
dotnet dotnet: api-filter
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

I spent yesterday and today reading and experimenting with the system. I have been able to figure out how to get all the fields, properties, methods, etc. to appear, even if the access modifier is not public.

Since this documentation is only going to be used by a geographically dispersed team, there is no concerns with exposing everything.

I am trying to understand how to change the generated API documentation to do the following:

1. Within each section list the items in a specific order of access modifier: public, internal, protected, protected internal, and private.
2. Then have the items alphabetical.

I exported the default template and attempted to read the class.header.tmpl.partial and class.tmpl.partial files. I am having trouble figuring out where each section (properties, methods, etc.) are being generated. I have found specific data points (uid, summary, type, etc.).

I don't know where to start to present everything in the order I need. Is it a template change? Do I need a preprocessor, to reorder the items before they are rendered.

The goal is to be able to render the "In This Article" section similar to the below:

Constructors
static
public
protected
private

Fields
static
public
protected
private

...

Then I also want to change the left nav so that it is similar to the API format on docs.microsoft.com Where the classes are listed under the namespaces and the classes can be expanded to show the constructors, properties, methods, etc.

Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.