-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Libraries APIs are fully documented using efficient workflows #44969
Comments
Which source is the documentation going to live for APIs that have separate implementations per OS, per runtime or per architecture? |
@carlossanlop and I are still discussing this. I will write up a proposal design for that and discuss it with other people to make sure we have a good convention and the right features for people to specify the source of truth that makes it's way to the final ref pack. Once I have that I can loop you as well in the conversations, or just include it in this issue, but it feels like the description is quite large already. |
We also need to come up with a plan for APIs that live in |
Edit: Seems the original comment I'm replying to got deleted? |
One proposal we are considering (and it would be nice to hear some opinions on this) is to add documentation to one file, based on a pre-defined priority. The first file we would try to find is the Then, once documentation is added to one file, the rest of them should also have triple slash comments to prevent the build warning, but the text would just be a boilerplate message indicating that is not the main documentation file. |
It does not feel right to define priority ordering of OSes. Also, it would lead to odd situations like Unix specific behaviors having to be documented in .Windows.cs file, etc. Maybe would should have a dummy "AnyOS" or similar file for these cases that would have a throwing implementation and contain the documentation? |
Sure, just keep in mind that's how we currently have our documentation in the dotnet-api-docs xmls: We do not have multiple We need to keep in mind that we can only send to the Docs build system one build-generated intellisense xml file per ref assembly, from which all the documentation (for all OS/architectures/versions) will be copied and pasted into the ECMAxml files in dotnet-api-docs. @safern also suggested we could indicate in the csproj an MSBuild property that would indicate which file is the source of truth. But your idea @jkotas of always having an |
Wouldn't this be the equivalent of having a super long file with the APIs? Something like a ref assembly? |
I meant that we would follow the existing factoring - one file per type. For example, we would have |
How many of such OS/Arch specific APIs there are? Would it be possible to manually handle that? Also should APIs have generic description without implementation detail? If there are many of such perhaps we could combine the summaries into a single:
maybe that wouldn't be perfect but it would temporarily solve the problem, list of such APIs could be gathered into an issue and later those could be improved by hand. (and not sure how would that work for arguments but still I'm curious about the numbers first, possibly this problem is very small) |
I see. There are 2 things that make me wonder if that's the best approach:
I still need to do an analysis on how many OS specific files we have and the patterns we use on the csproj to think on a better solution, but so far it seems like the "most" reasonable approach yet. cc: @ericstj any thougths? |
Another idea that comes to mind, would be injecting a |
@krwq I haven't yet seen a Having a Bringing documentation from dotnet-api-docs into triple slash would mean bringing a single text description for each tag ( |
Could it be even easier for the general public to submit documentation improvements? Contributing to the GitHub repos is already quite a time investment. People need an account, and maybe they have never done anything like this. Nobody will casually do this. I sometimes read the documentation on the Microsoft website and think "this really should be explained differently". If there was a button that I could use to submit a documentation fix right there, and that would make it into the documentation eventually, I think a lot of people would do that. This might even become a bit of an addiction to power users such as contributing to Stack Overflow is addictive. |
Some complain: For certain simple APIs (namely |
@huoyaoyuan Whether the documentation is meaningless or not, is not the issue we are trying to solve. This issue is about making it easier for contributors to add documentation. People are more familiarized with triple slash comments in C# than with ECMAxmls from dotnet-api-docs.
Why? You can always press some key combinations collapse the comments sections. For example, in Visual Studio, you can press |
Thanks for pointing out this. But, sometimes I need to read the code in GitHub or source.dot.net. |
@huoyaoyuan you should file a separate issue on that on https://github.com/dotnet/dotnet-api-docs or https://github.com/dotnet/docs (not sure which is the correct one but they will likely redirect you). |
Update: I've moved this to Future and we are going to close all of the issues for backporting api docs to triple-slash comments for now. As we concluded early in the .NET 7.0 release cycle, we need to invest more into the DocsPortingTool to set this effort up for success. When we're able to revisit this, we will open new issues per area again. |
Today, some of our source code repos like Runtime, WPF, WinForms and WCF, consider the dotnet-api-docs repo the source of truth for their documentation. This poses some challenges:
We would like to propose a series of changes in our documentation process that will simplify the developer's role and automate some of the steps. During .NET 6, we piloted this new documentation process with a subset of the .NET Libraries. That pilot produced the following outputs:
We will continue this plan in .NET 8.
Bring documentation from Docs to triple slash
Substitute all the triple slash comments in source code with the language-reviewed documentation that exists in dotnet-api-docs. We will do this on an assembly by assembly basis, and will enable the MSBuild property
<GenerateDocumentationFile>
to ensure new public APIs cause a build warning when they don't have documentation.We will be using the dotnet/api-docs-sync PortToTripleSlash tool for this effort, for which I added the feature to port dotnet-api-docs to triple slash comments: https://github.com/dotnet/api-docs-sync/tree/main/src/PortToTripleSlash
Remarks
We won't backport remarks for the following reasons:
.NET Framework-only APIs
APIs that only exist in .NET Framework will continue having dotnet-api-docs as its source of truth.
APIs that are shared by both .NET Core and .NET Framework will have their source of truth in triple slash comments in .NET Core, making sure we preserve the differences in behavior between versions.
Tasks
Here we will list the assemblies that got their documentation backported.
To do - Add one item per assembly and link to PRs as they are created.
Merge blocking label and docs reviewers
We already have a bot task that automatically adds the
new-api-needs-documentation
label to PRs that are introducing new public APIs, but we want to make sure it also becomes a merge blocker, like the* NO MERGE *
label does.Once the PR has been reviewed by a maintainer, and they confirmed the new APIs have proper documentation, the label can be manually removed to unblock merging.
We also want the bot to automatically add the @dotnet/docs members as PR reviewers for language review.
Tasks
new-api-needs-documentation
label mandatory.Automatic Docs build
Note: We can only begin this work if we finished backporting the documentation from all assemblies.
Currently, whenever new APIs are added to the source code repos, we send the updated ref assemblies to the Docs team so they feed them to the Docs build system, which causes the regeneration of the dotnet-api-docs xml files, showing the new APIs. After this point, we can then manually port the documentation from triple slash, using https://github.com/dotnet/api-docs-sync/tree/main/src/PortToTripleSlash
From now on, we want to automate the process by automatically merging the ref assembly drop (it's just a commit in an internal repo). This drop will also contain the build-generated IntelliSense xmls, which would now contain the documentation source of truth, removing the step of manual porting.
Tasks
Debt prevention and docs fixes
At the time of writing this document, we have 900+ issues open in the dotnet-api-docs repo. We would like to consider these as part of the regular work planning for our dev teams, and we want to make it easier to filter issues by area by automatically adding labels using a bot, and area owners should be notified (on a subscription basis, like in runtime).
Contributors will still be able to report documentation issues in dotnet-api-docs, but fixes will now be done directly in triple slash comments in source. PRs will be disabled in dotnet-api-docs except for maintainers.
Documentation for APIs that only exist .NET Framework will continue to be done directly in dotnet-api-docs (that will be its source of truth).
Tasks
Low pri / Nice to have
The following are tasks that are out of scope for this effort, but we would like to consider in the near future:
needs doc update
that would also become merge blocking, to ensure documentation gets updated when behavior is changed. Here is a good argument in favor of that.Questions and suggestions are welcome.
The text was updated successfully, but these errors were encountered: