-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
added documentation for Kernel#sprintf method (fixes #3124) #5914
added documentation for Kernel#sprintf method (fixes #3124) #5914
Conversation
…m:CaDs/crystal into fix/added_documentation_for_printf_method
src/kernel.cr
Outdated
# modify that interpretation. | ||
# | ||
# The field type characters are: | ||
# ```pre |
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.
What's pre
?
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.
text
would probably be better.
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.
changed to text
@r00ster91 I don't think that'd be very useful. Using regular pipe and dash are totally fine. This way there will probably be less changes required once we can use Markdown table syntax. |
src/kernel.cr
Outdated
# | will be copied. | ||
# % | A percent sign itself will be displayed. No argument taken. | ||
# ``` | ||
# The flags modifies the behavior of the formats. |
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.
modify
.
And please add newlines between code fences and paragraphs and between two paragraphs.
src/kernel.cr
Outdated
# ```text | ||
# Flag | Applies to | Meaning | ||
# ---------+---------------+----------------------------------------- | ||
# space | bdiouxX | Leave a space at the start of |
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.
Leave a space...
-> Add a leading space character to non-negative numbers.
(use same wording as next entry)
src/kernel.cr
Outdated
# ``` | ||
# | ||
# The field width is an optional integer, followed optionally by a | ||
# period and a precision. The width specifies the minimum number of |
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.
two spaces (ditto in the following paragraph)
src/kernel.cr
Outdated
# | ||
# Examples of precisions: | ||
# | ||
# precision for `d`, `o`, `x` and `b` is |
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.
This sentence should be properly formatted (start with capital letter, period at the end). Ditto for the following.
hmm build is failing, I guess I need to rebase master again? |
@CaDs please run |
Thanks @sdogruyol 🙇 |
Thanks @CaDs 👍 Can you squash this? |
@sdogruyol it can be squashed when merged |
@straight-shoota yup 😄 |
Thanks @CaDs ! |
Issue: #3124
As suggested per @asterite on this previous PR I have used Ruby's sprintf documentation as a template.