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

Write examples directly to asciidoc #4043

Merged
merged 2 commits into from Aug 22, 2019
Merged

Write examples directly to asciidoc #4043

merged 2 commits into from Aug 22, 2019

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Aug 21, 2019

This commit replaces the AsciiDoc include in generated examples with the C# source code.
Doing so also allows any examples to include callouts, similar to doc generation e.g.

var deleteResponse = client.Delete<Tweet>(1, d => d
    .Index("twitter")
    .Routing("kimchy") // <1> Use a routing parameter
);

will emit

[source,csharp]
----
var deleteResponse = client.Delete<Tweet>(1, d => d
    .Index("twitter")
    .Routing("kimchy") //<1>
);
----
<1>  Use a routing parameter

This commit replaces the AsciiDoc include in generated examples with the C# source code.
Doing so also allows any examples to include callouts, similar to doc generation e.g.

var deleteResponse = client.Delete<Tweet>(1, d => d
    .Index("twitter")
    .Routing("kimchy") // <1> Use a routing parameter
);

will emit

[source,csharp]
----
var deleteResponse = client.Delete<Tweet>(1, d => d
    .Index("twitter")
    .Routing("kimchy") //<1>
);
----
<1>  Use a routing parameter
@Mpdreamz
Copy link
Member

It might be good to add a notice/comment to the files now that these are generated and should not be edited directly.

@russcam
Copy link
Contributor Author

russcam commented Aug 21, 2019

It might be good to add a notice/comment to the files now that these are generated and should not be edited directly.

++

@nik9000, If these examples had a multine asciidoc comment in them, would that be an issue for the docs example build process, similar to what we do in the current .NET docs e.g.

////
IMPORTANT NOTE
==============
This file has been generated from <path to file>. 
If you wish to submit a PR for any spelling mistakes, typos or grammatical errors for this file,
please modify the original csharp file found at the link and submit the PR with that change. Thanks!
////

@russcam
Copy link
Contributor Author

russcam commented Aug 22, 2019

@Mpdreamz I've added multiline comments that point back to the original file with line numbers, on GitHub. Would you mind taking another look, please?

@Mpdreamz
Copy link
Member

Awesome, lgtm 👍

@russcam russcam merged commit c5effab into master Aug 22, 2019
@russcam russcam deleted the docs/example-callouts branch September 1, 2019 22:41
russcam added a commit to elastic/docs that referenced this pull request Sep 5, 2019
With the change in elastic/elasticsearch-net#4043 to write C# examples directly to asciidoc, rather than use an include:: element, the src/Examples directory in elastic/elasticsearch-net no longer needs to be referenced. This commit removes the reference.
russcam added a commit to elastic/docs that referenced this pull request Sep 6, 2019
With the change in elastic/elasticsearch-net#4043 to write C# examples directly to asciidoc, rather than use an include:: element, the src/Examples directory in elastic/elasticsearch-net no longer needs to be referenced. This commit removes the reference.
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

Successfully merging this pull request may close these issues.

None yet

2 participants