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

Write "represents" guideline for HTML elements #1521

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ddbeck
Copy link
Collaborator

@ddbeck ddbeck commented Jul 29, 2024

Also, discourage "indicates" to describe things that are not indicators.

This is inspired by several reviews of HTML elements. Sometimes an element does something (the <br> element breaks lines), but sometimes they're abstract containers "represents" is a reasonable default.

Also, discourage "indicates" to describe things that are not
indicators.
@ddbeck ddbeck added the documentation Improvements or additions to documentation label Jul 29, 2024
@ddbeck ddbeck mentioned this pull request Jul 29, 2024
@@ -180,9 +185,13 @@ Avoid, especially with gerunds.
For example, prefer the "The feature writes to…" over "The feature provides writing to…."
([#727](https://github.com/web-platform-dx/web-features/pull/727#discussion_r1537635491))

##### represents

If an HTML element or other type doesn't obviously do anything, then it probably _represents_ something.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd really like to see a Good/Bad example here. I'm still struggling with this one a bunch, and having a couple of examples would help a lot.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's hard to think of bad examples, rather I'd treat "represents" as a default for HTML elements which we diverge from when we think some other verb is clearer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, @foolip captured my meaning here, as using it as a default. That said, I was able to come up with some examples, so I added them. This necessitated some edits to actual descriptions, of course.

docs/README.md Outdated
@@ -162,6 +162,11 @@ Don't use it as a coordinating conjunction; start a new sentence instead.
For example, this is an example.
([#738](https://github.com/web-platform-dx/web-features/pull/738#discussion_r1537762579), [#742](https://github.com/web-platform-dx/web-features/pull/742))

##### indicates
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like this was motivated by #1436. If it's only popped up once I don't think we need to document it.

Note that it's used in a way allowed by this guideline here:

description: The `rel="modulepreload"` attribute for the `<link>` HTML element indicates that a module script should be fetched, parsed, and compiled preemptively, and stored for later execution.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, I've removed "indicates" from this PR.

@@ -180,9 +185,13 @@ Avoid, especially with gerunds.
For example, prefer the "The feature writes to…" over "The feature provides writing to…."
([#727](https://github.com/web-platform-dx/web-features/pull/727#discussion_r1537635491))

##### represents

If an HTML element or other type doesn't obviously do anything, then it probably _represents_ something.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's hard to think of bad examples, rather I'd treat "represents" as a default for HTML elements which we diverge from when we think some other verb is clearer.

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Aug 7, 2024
Comment on lines +186 to +191
Use _represents_ as a default for describing the behavior of HTML elements when no more specific verb makes sense.

- 👍 Recommended: The `<html>` element represents the top level of an HTML document…
- 👍 Recommended: The `<br>` element breaks lines in text.
- 👎 Not recommended: The `<br>` element represents a line break in text.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New elaboration on the "represents" guidance

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure I would have used "represents" for the <html> example either...

Thinking how it would compare to <math> and <svg>. Maybe something like:

  • The <html> element is the top level container for documents and iFrames and is referred to as the root element.
  • The <math> element is the top level MathML container, used to write a single mathematical formula.
  • The <svg> element is the top level SVG container, used in SVG files or for SVG fragments inside an SVG or HTML document.

@ddbeck ddbeck mentioned this pull request Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature definition Creating or defining new features or groups of features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants