-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: Generate inline snippets in yardoc #627
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
# | ||
<%= render partial: "service/client/method/docs/error", locals: { method: method } -%> | ||
# | ||
<%= render partial: "service/client/method/docs/snippets", locals: { method: method } -%> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my personal pref would be to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there are trade-offs. Putting the "if"s here would tend to obfuscate the structure a bit, and the question of the missing |
||
<%= render partial: "service/client/method/docs/samples", locals: { method: method } -%> | ||
def <%= method.name %> request, options = nil | ||
<%= indent render(partial: "service/client/method/def/request", locals: { method: method }), 2 %> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<%- assert_locals method -%> | ||
<%- if method.generate_yardoc_snippets? -%> | ||
# @example Basic example | ||
<%= indent render(partial: "snippets/snippet/structure", locals: { snippet: method.snippet }), "# " %> | ||
# | ||
<%- end -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try to add all new parameters into the
shared/test_resources/api_test_resources.rb
and the corresponding test cases because it then becomes easy to look at the whole tree of all the parameters filled.Don't know if you want to do it or not, I can definitely do it myself later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Let's do that in a separate PR. I think it could get kinda large.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #630 to remind us of this.