-
-
Notifications
You must be signed in to change notification settings - Fork 783
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
Clarify when to mark up numeric literals #1312
Comments
Hey I would love to work on this, I see there a couple of discussions that have been going on with associated PRs, may be I could first look at those and for any other details I must know on this, @erlend-aasland kindly guide. |
Thanks! I believe we need to discuss this a little bit more before we can propose actual changes to the devguide. We need to agree what to put in the "good" section and what to put in the "bad" section. This implies more discussion needs to take place first. |
Thanks for this response, let me look at another issue. |
My rule of thumb is that numbers should be marked as literals if they refer to values in the code (either actually written as literals or assigned/calculated/returned), e.g.:
When the number doesn't directly refer to a value in the code, the literal markup can be omitted, e.g.:
Sometimes the difference is subtle though. For example, if you are suggesting the reader to multiply the result by In some ambiguous cases and especially with lists/tables, marking them as literals might also help the values stand out more (which might be desirable or not) or be easier to scan/compare. As always, use your best judgment in order to make the docs as clear and readable as possible. FWIW the same applies to strings or other literals. For example, you can talk about "version 1.2.3" in general but "version |
The current devguide recommendations reads:
Earlier, I've been corrected to use double backticks when marking up literals. Example PR remark:
Recently, I've seen other styles enforced:
Perhaps we need a clarification, possibly with good/bad examples?
The text was updated successfully, but these errors were encountered: