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

Add more code examples into the XML documentation #388

Open
OlegRa opened this issue Oct 11, 2021 · 3 comments
Open

Add more code examples into the XML documentation #388

OlegRa opened this issue Oct 11, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@OlegRa
Copy link
Collaborator

OlegRa commented Oct 11, 2021

The built-in C# XML documentation allows developers to provide code examples that will be visible to the SDK users in VS IntelliSense tips. Right now SDK doesn't provide any code samples even for hard-to-use features. I'm open to accepting pull requests with such code samples. Let's make SDK better for new users together!

@OlegRa OlegRa added enhancement New feature or request help wanted Extra attention is needed Hacktoberfest labels Oct 11, 2021
@OlegRa OlegRa added this to the SDK 6.0.x Experimental milestone Oct 11, 2021
@OlegRa OlegRa pinned this issue Oct 11, 2021
@OlegRa OlegRa removed this from the SDK 6.0.x Experimental milestone Oct 18, 2021
@OlegRa OlegRa added this to the SDK 6.0.x Experimental milestone Nov 29, 2021
@OlegRa OlegRa self-assigned this Mar 7, 2022
@natehitze
Copy link
Contributor

@OlegRa Do you have any areas in mind to focus on for these examples?

@OlegRa
Copy link
Collaborator Author

OlegRa commented Apr 16, 2022

@natehitze Old version of Alpaca documentation contains a lot of short examples for performing some basic tasks using different SDKs/languages. If you want, I can send you the latest version of such C# code snippets. I'm not sure how we can make them part of the documentation generated by DocFX but it would be nice if it will be possible.

Ideally, this code should be compilable because instead, we will have problems with outdated samples. AFAIR, code samples in the XML comments are not compiled and therefore we should find another way to keep these code samples up-to-date. I've used the hand-made script that runs against the old Alpaca documentation repo, get all C# code snippets, and compile them. But this script have to be run manually and it was part of my "official release" process. If we can automate it or verify documentation code correctness on each build it would be much better.

@OlegRa OlegRa assigned natehitze and unassigned OlegRa Apr 16, 2022
@drew887
Copy link

drew887 commented Apr 21, 2022

Ideally, this code should be compilable because instead, we will have problems with outdated samples. AFAIR, code samples in the XML comments are not compiled and therefore we should find another way to keep these code samples up-to-date. [...] If we can automate it or verify documentation code correctness on each build it would be much better.

@OlegRa not sure if you solved this elsewhere but in terms of validating tests/examples in docs, we're investigating using doctest for the other SDKs for this exact purpose. It looks like there's a community version of this for C# here; I haven't validated it myself yet but hopefully it will work here for a similar manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants