Skip to content

Conversation

@msimberg
Copy link
Collaborator

This adds a basic STYLE.md in the root of the repo as a basic style guide (the filename and location is not a convention as far as I know, I just thought it fits). I've tried to capture most of the current style. That doesn't mean we have to keep it this way. Bikeshed away with review comments!

It'd be nice to have this in the actual docs as well, but I wasn't sure where to put it yet so it's currently outside the main docs tree.

@msimberg msimberg requested review from RMeli and bcumming as code owners March 21, 2025 12:47
@github-actions
Copy link

preview available: https://docs.tds.cscs.ch/53

STYLE.md Outdated
- Format paragraphs with one sentence per line for easier diffs.
- Leave a space before and after headings.

## Headings are Written in Title Case
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This seems to be the case for most headings, but is not completely consistent. My purely subjective opinion is sentence case for headings as well, but don't care too much as long as we stick to one style.

Copy link
Member

Choose a reason for hiding this comment

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

I've been doing and suggesting the opposite... But I also do not care as long as we are consistent.

Copy link
Member

Choose a reason for hiding this comment

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

Personally I am more comfortable with lower case if I had to choose (except for the first word in the heading).

Of course, I am almost certainly wildly inconsistent in practice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since we all seem to actually agree that sentence case is nicer, let's make it that in the style guide and gradually try to stick to it/update titles as we bump into title case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

STYLE.md Outdated
Aim to include examples, notes, warnings using [admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) whenever appropriate.
They stand out better from the main text, and can be collapsed by default if needed.

!!! example "Example one"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Some admonition titles use all lower case, some sentence case. Preference?

Copy link
Member

Choose a reason for hiding this comment

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

Honestly, I don't really care too much.
If the admonitions inside a page are are consistent, it probably isn't a big deal?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Of course not a big deal. This is just aiming to bring a bit of consistency, but we'll break the rules anyway, intentionally or unintentionally.

@RMeli
Copy link
Member

RMeli commented Mar 21, 2025

It'd be nice to have this in the actual docs as well, but I wasn't sure where to put it yet so it's currently outside the main docs tree.

I'll review later, but we already have a "Contributing" section, therefore it could go there, or as a subsection of that?

@msimberg
Copy link
Collaborator Author

we already have a "Contributing" section, therefore it could go there, or as a subsection of that?

I'm not sure how I missed that, thanks for pointing it out! Seems like a great place to put it.

@github-actions
Copy link

preview available: https://docs.tds.cscs.ch/53

@msimberg
Copy link
Collaborator Author

I moved the style guide to a subsection in contributing.md. Could also be a sub-page. Let me know what you prefer.

@bcumming
Copy link
Member

This overlaps with another PR made at about the same time, that discusses "how to link" and provides justification for why we don't break sentences.

#54


1. The first item can look like this,
2. The second like this, and
3. The third item like this.
Copy link
Member

Choose a reason for hiding this comment

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

I would put the and at the start of the third line, and star each line with a lower case letter (the whole list is a sentence, no?)

I agree that care should be taken with formating lists, but it is tricky to canonicalize without being too strict. For example, I would format your list as follows:

contain multiple sentences:

  1. the first item can look like this;
  2. the second like this;
  3. and the third like this.

Copy link
Collaborator Author

@msimberg msimberg Mar 21, 2025

Choose a reason for hiding this comment

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

but it is tricky to canonicalize without being too strict

This is probably key, so in the end these are just guidelines.

Agree on capitalization (see #53 (comment)). I feel like it's more common to have the "and" or "or" trailing on the second-to-last item though?

Copy link
Member

Choose a reason for hiding this comment

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

Honestly, I don't know.
It feels wrong to me, because if we use the oxford comma (as we should), the and comes after the comma.

I think if people go to enough effort to punctuate their lists with care, that's enough?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If it's all the same to you, I'd leave it with the trailing and/or on the second-to-last item, but indeed, let's not actually bikeshed this too much.

I think if people go to enough effort to punctuate their lists with care, that's enough?

Yes, of course.

@github-actions
Copy link

preview available: https://docs.tds.cscs.ch/53

Co-authored-by: Rocco Meli <r.meli@bluemail.ch>
@github-actions
Copy link

preview available: https://docs.tds.cscs.ch/53

@github-actions
Copy link

preview available: https://docs.tds.cscs.ch/53

@github-actions
Copy link

preview available: https://docs.tds.cscs.ch/53

@bcumming bcumming merged commit d064365 into main Mar 23, 2025
1 check passed
@bcumming bcumming deleted the style-guide branch March 23, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants