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

Make API documentation more version aware #226

Closed
pkulikov opened this issue Mar 12, 2018 · 12 comments
Closed

Make API documentation more version aware #226

pkulikov opened this issue Mar 12, 2018 · 12 comments
Assignees
Labels
enhancement Make the docs.microsoft.com experience better logged-request An internal request was opened to track this work. wont-fix Will not be fixed.

Comments

@pkulikov
Copy link

Is it possible to make API documentation more version aware (.NET Core 1.0, .NET Core 2.0, etc)?

For example, look at MethodImplOptions enum for .NET Core 1.0. The note in Remarks looks a little bit alien as there is no Synchronized flag in .NET Core 1.0. That value appears only in .NET Core 2.0. So, remarks also might differ from version to version.

@mairaw
Copy link
Collaborator

mairaw commented Mar 13, 2018

I think there are two parts to this:

  1. Having a way to do conditional content dependent on platform and version
  2. Identify where those differences are and change the content appropriately

I think for item 1, we have a plan to add that capability in the future. For 2, we try to mindful of that for new or updated content in the text, but there's a lot of content that was simply migrated from MSDN as-is. It's a tricky issue to solve.

@Powerhelmsman Powerhelmsman added triaged content Issue with content on docs.microsoft.com labels Mar 13, 2018
@Powerhelmsman
Copy link
Collaborator

@dend Can decide if we will resolve the issue?

@svick
Copy link

svick commented Mar 13, 2018

@mairaw I think identifying the differences could be automated. I imagine it would work like this:

  • Step 1: For each member, find on which frameworks it is present. I think <AssemblyInfo> should help with that. Though is there a mapping between assembly name+version and framework somewhere? _moniker2Assembly.json does not contain versions, so it's not enough.
  • Step 2: Look for references (both xref and plaintext) to those members in text that is shown for frameworks that don't contain them.

This approach is likely going to have both false positives and false negatives, but I think it could still be helpful.

@dend
Copy link
Contributor

dend commented Mar 13, 2018

@svick for the most part, I think the versioning infrastructure is in place - we use monikers when we reflect the assemblies, so we know which APIs are coming from where. Assemblies are not as helpful here, because they are not reflective of the version of the product all the time (e.g. older assembly used in both the new and the old release of a SDK).

Given that the content is for the most part hand-written for the .NET platform, this is something that @mairaw can implement directly in the XML files, with conditionals, where sections of the content are only available for certain monikers.

@Powerhelmsman let's keep this open until a resolution is in place!

@svick
Copy link

svick commented Mar 13, 2018

@dend

for the most part, I think the versioning infrastructure is in place - we use monikers when we reflect the assemblies, so we know which APIs are coming from where.

I understand that you know that. But how can I, as someone who might be interested in analyzing the API reference, learn that? <AssemblyInfo> is all I can see in the XML files.

@dend
Copy link
Contributor

dend commented Mar 13, 2018

@svick good point - I have it on the radar to document mdoc (the tool that we use for our documentation) that outlines how we pull in different monikers in XML files. We should also document how versioning works inside Markdown content (since that is what you can use inside remarks).

@ermau
Copy link

ermau commented Apr 19, 2018

Another example of this can be seen in the docs for HashSet. If you scroll down you'll find there's a note in the remarks how IReadOnlyCollection<T> was only added in 4.6. However, despite the selection of 4.5.2, it's still listed in the list of interfaces right at the top.

@dend dend self-assigned this Apr 29, 2018
@Powerhelmsman
Copy link
Collaborator

#log-suggestion @dend

@supernova-eng
Copy link
Contributor

🚀 ATTENTION: Internal request logged.

@supernova-eng supernova-eng added the logged-request An internal request was opened to track this work. label May 25, 2018
@mairaw
Copy link
Collaborator

mairaw commented May 30, 2018

@dend do you have something already logged to control which interfaces are shown for which version?

@Powerhelmsman Powerhelmsman added enhancement Make the docs.microsoft.com experience better and removed content Issue with content on docs.microsoft.com triaged labels Jun 20, 2018
@dend
Copy link
Contributor

dend commented Aug 21, 2018

@mairaw that is the work that @joelmartinez has done for FrameworkAlternate. That said, the suggestion above is a content ask, as we do not control how remarks are managed between different frameworks. I am closing this particular item, as it's not related to docs infrastructure work, and will defer to you to determine the path forward for .NET conditional content (e.g. using moniker zones).

@dend dend closed this as completed Aug 21, 2018
@mairaw
Copy link
Collaborator

mairaw commented Aug 21, 2018

Just FYI to @pkulikov, we don't have this moniker zones capability yet.

@dend I still think there's some basic version awareness that needs to happen as well, which is related to the docs infrastructure. Showing the right attributes, the right signature, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Make the docs.microsoft.com experience better logged-request An internal request was opened to track this work. wont-fix Will not be fixed.
Projects
None yet
Development

No branches or pull requests

7 participants