Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Generate API documentation for documented symbols in a package #9952

Open
JonDouglas opened this issue May 21, 2024 · 9 comments
Open
Labels
feature-request Customer feature request Triaged

Comments

@JonDouglas
Copy link
Contributor

JonDouglas commented May 21, 2024

Related Problem

No response

The Elevator Pitch

NuGet.org should provide public API documentation for every NuGet package it ingests similar to other package ecosystems:

image
image
image

That's it. That's the pitch!

Future opportunities could be helping empower developers comment their public API surface further and providing API knowledge / docs to our AI overlords.

For more context, the Learn team at Microsoft currently has an API generation docfx/mdoc-type of solution that can take in a NuGet package and generate a API documentation page similar to https://learn.microsoft.com/en-us/dotnet/api/microsoft.csharp.csharpcodeprovider?view=net-8.0

Additional Context and Details

No response

@JonDouglas JonDouglas added the feature-request Customer feature request label May 21, 2024
@Aaronontheweb
Copy link

So currently on our documentation, we filter out some namespaces and other parts of our "public" API that really aren't meant for public consumption (i.e. internals that other contributors + plugin authors can access, but not something end-users should be using regularly). How would I express that same idea on NuGet.org?

@Aaronontheweb
Copy link

Also, just generally - would I be able to opt my packages out of this feature?

@JonDouglas
Copy link
Contributor Author

Also, just generally - would I be able to opt my packages out of this feature?

I haven't seen this as a pattern, but I'm sure it is possible. What scenarios would you not want to have public API docs generated for people to look through when browsing your packages?

@Tarmil
Copy link

Tarmil commented May 21, 2024

So currently on our documentation, we filter out some namespaces and other parts of our "public" API that really aren't meant for public consumption (i.e. internals that other contributors + plugin authors can access, but not something end-users should be using regularly). How would I express that same idea on NuGet.org?

The xmldoc tag <exclude /> is recognized by tools like Sandcastle and FSharp.Formatting, it would make sense to use it here too.

@SimonCropp
Copy link
Contributor

@Aaronontheweb perhaps u could use ExperimentalAttribute. then any rendered docs could exclude APIs with ExperimentalAttribute. and potentially have a toggle to show them

@Aaronontheweb
Copy link

@SimonCropp we have an 'InternalAttribute' tag we use

@SimonCropp
Copy link
Contributor

SimonCropp commented May 22, 2024

@Aaronontheweb note that ExperimentalAttribute has compiler level support. so for someone to use it they explicitly need to opt in to that allow Experimental API use. if they dont it will be a compiler error. so in a similar way to how the ObsoleteAttribute works

@SimonCropp
Copy link
Contributor

IMO ExperimentalAttribute should have been named a bit more generically. something like HereBeDragonsAttribute

@baronfel
Copy link

baronfel commented May 22, 2024

It's important to consider API docs as just a first step. There are other important docs concepts like conceptual, guided walkthroughs, etc - and eventually (not necessarily for v1) it would be great to have a good base-level centralized hosting for those as well. For prior art I'd consider looking at the split between the docs on crates.io and docs.rs for Rust. Let's take the bitvec package for example:

The crates.io page is just the README (but it's very lovingly rendered!), but it links to the generated documentation. The docs.rs page has the deeper docs. Takeaways from my point of view:

  • Packages should link to documentation, and have documentation focused on the nuget.org view.
  • The linked documentation should be 'pluggable' - nuget.org rendered docs might be a good default or baseline, but package authors should be able to provide a way to disable/skip documentation generation and point to their own docs.
  • Package authors are going to have opinions/needs for customizing docs generation - the docs generation system IMO should be open source and extensible (even if it runs on Microsoft- or .NET Foundation-managed hardware) to provide transparency and enable community contributions/enhancements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Customer feature request Triaged
Projects
None yet
Development

No branches or pull requests

6 participants