-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Remove extra backslashes from code snippets #3139
Conversation
See generated changes |
@@ -11,8 +11,6 @@ module AsymmetricCredentials | |||
|
|||
N_MINUS_2 = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551 - 2 | |||
|
|||
# @param [String] :access_key_id |
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.
Why remove these? They are still the correct paramters here?
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.
The module is API private and these were wrong. These are positional parameters but they were symbolized name, so it produced a warning. I just deleted them because it's clear what they are (and API private).
nil | ||
end | ||
end | ||
|
||
def generated_examples(operation, api) |
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.
Was this just not used?
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 don't think so...
@@ -118,10 +118,6 @@ def html_to_markdown(html, options = {}) | |||
if html | |||
html = "<p>#{html}</p>" unless html.match(/<\w+>/) | |||
|
|||
# unescaped curly braces cause YARD errors, they are interpreted | |||
# as code links. | |||
html = html.gsub('{', "\\{").gsub('}', "\\}") |
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.
could we take an escape_curly_braces
option and pass it only when this is called for code docs?
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.
That doesn't fix inline code snippets in the documentation. This applies on the whole block of documentation text.
Closes #3132
We were addressing Yard warnings by escaping backslashes, but this also applied to code snippets. I tried a solution where we only escaped when not in a code section but this approach failed. This is because we have a multi-tier doc system with html -> markdown (rdiscount) -> yard, each handling escaping differently. This approach fixes the docs visibly but we will have warning outputs when curly braces are used outside of code blocks. This doesn't happen often, a majority of docs use code blocks.