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

Code Snippets to Accompany Class Member Documentation #5765

Closed
mitevpi opened this issue Jun 2, 2018 · 11 comments
Closed

Code Snippets to Accompany Class Member Documentation #5765

mitevpi opened this issue Jun 2, 2018 · 11 comments

Comments

@mitevpi
Copy link

mitevpi commented Jun 2, 2018

Would it be possible to add brief code snippets underneath key methods/properties in order to quickly communicate usage/use cases?

I'd love to contribute if that's something that would be useful to others as well.

ex: In the case of the ColumnAttribute.Ordinal Property, if there was a "Code Sample" section right above/below the "Applies To" header, I think that would be very clear and helpful. The sample could be something as simple as what already exists in some of the tutorials/intros:

// Brief explanation, ex:
// Data is loaded without headers/labels, and the ColumnAttribute.Ordinal Property
// is used to define the identity of different data elements (columns) based on index.
public class TaxiTrip
{
    [Column(ordinal: "0")]
    public string vendor_id;
    [Column(ordinal: "1")]
    public string rate_code;
}

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@mairaw
Copy link
Contributor

mairaw commented Jun 4, 2018

@asthana86 @aditidugar @JRAlexander FYI on samples request for ML.NET API docs

@dend for content that is auto-generated from /// comments, is it possible to add remarks and examples without losing them when docs get regenerated?

@mitevpi
Copy link
Author

mitevpi commented Jun 4, 2018

Would something like the example tag work?

image

@mairaw
Copy link
Contributor

mairaw commented Jun 4, 2018

Yes, this works @mitevpi but I'm wondering if we really wanna embed examples to APIs like that.

@pkulikov
Copy link
Contributor

pkulikov commented Jun 4, 2018

@mairaw can it be done the similar way as it's done now for .NET API?

@mairaw
Copy link
Contributor

mairaw commented Jun 4, 2018

@pkulikov .NET is kind of a special case because we can't auto-generate docs from source as other products can for a variety of reasons. So, for ML.NET we'd be following the same pattern that all others teams are using for reference docs including ASP.NET Core. I just need to learn now how to handle those (I think other teams are not really adding samples at the moment to the reference docs) considering some of the changes that the engineering team is planning for reference docs.

@pkulikov
Copy link
Contributor

pkulikov commented Jun 4, 2018

@mairaw thank you very much for the reply as that makes things clearer to me. Then I have two follow-up questions:

Given that, the Edit buttons on the pages with ML.NET API look to be not useful, because clicking them results in a PR to dotnet/ml-api-docs repository

@mairaw
Copy link
Contributor

mairaw commented Jun 4, 2018

@pkulikov

As the docs are auto-generated, there is no reason (for contributors not from the docs and engineering teams) to make PRs to the dotnet/ml-api-docs repository?

Correct! @dend are we working on enabling folks to go directly to source when API docs are auto-generated?

If I want to fix a typo (dotnet/ml-api-docs#21), then I should fix it by PR in the dotnet/machinelearning repository?

Correct. (Sorry I missed that PR)

Let me learn how this works and I'll remove the Edit button from those docs if they're not useful.

@mairaw mairaw self-assigned this Jul 9, 2018
@mairaw
Copy link
Contributor

mairaw commented Jul 9, 2018

Assigning this issue to myself to investigate next sprint.

@mairaw
Copy link
Contributor

mairaw commented Aug 13, 2018

Moving this to the backlog. We need to sit down with @dend and understand how this works for auto-generated content.

@mairaw
Copy link
Contributor

mairaw commented Oct 12, 2018

FYI @sfilipi. I believe you're already working on adding code samples, correct?

@mairaw
Copy link
Contributor

mairaw commented Sep 4, 2019

Closing since this API no longer exists. /cc @natke

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

No branches or pull requests

4 participants