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

added documentation for Kernel#sprintf method (fixes #3124) #5914

Merged
merged 21 commits into from Apr 13, 2018
Merged

added documentation for Kernel#sprintf method (fixes #3124) #5914

merged 21 commits into from Apr 13, 2018

Conversation

CaDs
Copy link
Contributor

@CaDs CaDs commented Apr 4, 2018

Issue: #3124

As suggested per @asterite on this previous PR I have used Ruby's sprintf documentation as a template.

src/kernel.cr Outdated
# modify that interpretation.
#
# The field type characters are:
# ```pre
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's pre?

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to text

@straight-shoota
Copy link
Member

@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.
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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.

@CaDs
Copy link
Contributor Author

CaDs commented Apr 13, 2018

hmm build is failing, I guess I need to rebase master again?

@sdogruyol
Copy link
Member

@CaDs please run crystal tool format and update

@CaDs
Copy link
Contributor Author

CaDs commented Apr 13, 2018

Thanks @sdogruyol 🙇

@sdogruyol sdogruyol requested a review from RX14 April 13, 2018 12:38
@sdogruyol
Copy link
Member

Thanks @CaDs 👍 Can you squash this?

@straight-shoota
Copy link
Member

@sdogruyol it can be squashed when merged

@sdogruyol
Copy link
Member

@straight-shoota yup 😄

@bcardiff bcardiff merged commit 24c5330 into crystal-lang:master Apr 13, 2018
@bcardiff bcardiff added this to the Next milestone Apr 13, 2018
@bcardiff
Copy link
Member

Thanks @CaDs !

@CaDs CaDs deleted the fix/added_documentation_for_printf_method branch April 14, 2018 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants