{"action":"closed","issue":{"url":"https://api.github.com/repos/dotnet/docfx/issues/375","repository_url":"https://api.github.com/repos/dotnet/docfx","labels_url":"https://api.github.com/repos/dotnet/docfx/issues/375/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/docfx/issues/375/comments","events_url":"https://api.github.com/repos/dotnet/docfx/issues/375/events","html_url":"https://github.com/dotnet/docfx/issues/375","id":159766641,"number":375,"title":"Question: Is it possible to extract code for use in the examples in API documentation","user":{"login":"pvandervelde","id":96201,"avatar_url":"https://avatars0.githubusercontent.com/u/96201?v=3","gravatar_id":"","url":"https://api.github.com/users/pvandervelde","html_url":"https://github.com/pvandervelde","followers_url":"https://api.github.com/users/pvandervelde/followers","following_url":"https://api.github.com/users/pvandervelde/following{/other_user}","gists_url":"https://api.github.com/users/pvandervelde/gists{/gist_id}","starred_url":"https://api.github.com/users/pvandervelde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvandervelde/subscriptions","organizations_url":"https://api.github.com/users/pvandervelde/orgs","repos_url":"https://api.github.com/users/pvandervelde/repos","events_url":"https://api.github.com/users/pvandervelde/events{/privacy}","received_events_url":"https://api.github.com/users/pvandervelde/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-11T10:13:47Z","updated_at":"2017-05-09T07:45:14Z","closed_at":"2017-05-09T07:45:14Z","body":"I have seen that it is possible to extract code snippets from code files for use in the general documentation. What I would really like is to be able to do this in API documentation as well. I know I can add examples in the xml documentation sections but those examples are encoded in the XML so they cannot automatically be compiled and tested as part of the solution.\nWhat I'm after is to:\n- Have a project that contains all the example code. This code can be compiled and tested so that I know the examples work.\n- Have some way of indicating to DocFX that it should extract a given part of a specific file as an example for the documentation of a class, method, property etc.. Essentially the same as what DocFX can do with [code snippets](https://dotnet.github.io/docfx/spec/docfx_flavored_markdown.html#code-snippet) but in API documentation.\n\nSo the question is what is the best way of achieving this with the current version of DocFX.\n"}}
{"actor":{"display_login":"superyyrrzz"}}