Giter Club home page Giter Club logo

Comments (23)

alrra avatar alrra commented on May 12, 2024

CONTRIBUTING.md or STYLE.md

Note: Having a file named CONTRIBUTING.md brings a minor benefit: "whenever someone opens a pull request or creates an issue, they will see a link to that file".

from html.

foolip avatar foolip commented on May 12, 2024

This would be great, but if anyone would write a format.py that just enforces all the style that we care about, we could save a lot of time pointing at the style guideline. At least I love it when code projects do this, as it takes away focus from something fundamentally uninteresting.

from html.

domenic avatar domenic commented on May 12, 2024

Let's try to write things down that we know of so far:

  • 100 chars, 1 character indent
  • Citations generally reference the specification by name in the sentence, then use the ref syntax at the end, after the period at the end of the paragraph. Example: The File API uses this to release <code data-x="blob protocol">blob:</code> URLs. <ref spec=FILEAPI>
    • Do we use cite around spec names? Only sometimes... I guess we should try to do so in general though going forward.
  • Wrap sections that are not relevant to developers in elements marked with w-nodev. A <div w-nodev> ... </div> will do for multiple elements in a row.
  • To add new references, follow the pattern at the end of the file, and be sure to place them in the alphabetized position. Prefer living documents or editor's drafts to dead specs, and prefer HTTPS to HTTP URLs.
  • Add some guidance about Bikeshed and Shepherd and data-noexport and such?

What else has caught people out?

from html.

foolip avatar foolip commented on May 12, 2024
  • When wrapping lines, no effort is made to keep elements or attributes on the same line, i.e. one should break between attributes and in the middle of an attribute value if that is what maximizes the line length. (Anything more clever is harder to write a script for, too.)

from html.

foolip avatar foolip commented on May 12, 2024
  • When an opening tag is not followed by whitespace, all of its children are wrapped together and not indented further even if on multiple lines. (Relevant because Emacs will want to indent the lines more.)

from html.

annevk avatar annevk commented on May 12, 2024
  • 's for possessive (always, even when it looks unnatural to you)
  • bitrate (not bit-rate)
  • whitespace (not white-space or white space)

from html.

tabatkins avatar tabatkins commented on May 12, 2024

Ugh, the W3C style guide is apparently clear that the preferred spelling is "white space". Would be cool if HTML's styleguide was consistent.

from html.

domenic avatar domenic commented on May 12, 2024

Pending resolution of #654, stick with en-GB-hixie.

from html.

zcorpan avatar zcorpan commented on May 12, 2024

@tabatkins it seems that's not really followed, though, e.g. css-syntax has 46 "whitespace" and 2 "white space"...

from html.

tabatkins avatar tabatkins commented on May 12, 2024

I knew you'd bring up Syntax. ^_^ Yes, I'm not following it very well in that spec, but @fantasai can point you to the style-guide requiring "white space".

from html.

foolip avatar foolip commented on May 12, 2024

HTML currently uses "whitespace" a lot and "white space" only in a few examples. Encoding uses "whitespace" and DOM imports that.

So I'd prefer to stick with whitespace, of course mostly because it happens to match what I'm used to.

from html.

annevk avatar annevk commented on May 12, 2024

Yeah, English removes spaces and hyphens over time. Wherever that's likely to happen, we should stick with the term English likely ends up with, thus, "whitespace", not "white space" or "white-space". And ideally we do this before implementations ship something (see "fullscreen").

from html.

tabatkins avatar tabatkins commented on May 12, 2024

I'm quite familiar with the evolution of English terms, and am fine with either ab initio. I was just pointing out that the W3C styleguide recommends one particular form.

from html.

fantasai avatar fantasai commented on May 12, 2024

Pointing at style guide, as requested: https://www.w3.org/2001/06/manual/#Terms
(I don't have an opinion on this. But consistency seems like a nice goal.)

from html.

domenic avatar domenic commented on May 12, 2024

I don't really see a need for consistency between standards orgs.

from html.

domenic avatar domenic commented on May 12, 2024

Other things that have come up recently:

  • colorspace (not color space)
  • metadata (not meta data)

from html.

fantasai avatar fantasai commented on May 12, 2024

It will affect auto-cross-linking in some cases, so that might be something worth considering.

from html.

annevk avatar annevk commented on May 12, 2024

Created https://wiki.whatwg.org/wiki/Style as a start.

from html.

foolip avatar foolip commented on May 12, 2024

In https://codereview.chromium.org/2492733003/ web vs. Web came up and I notice DOM and HTML disagree.

from html.

annevk avatar annevk commented on May 12, 2024

https://en.wikipedia.org/wiki/World_Wide_Web is very confused on when to capitalize it and when not. Seems easier to me to just lowercase it, but some people really care about the distinction between "web" and "Web", and "internet" and "Internet".

from html.

foolip avatar foolip commented on May 12, 2024

FWIW, I also like to lowercase it, but then I'm Swedish and we capitalize less than many languages.

from html.

zcorpan avatar zcorpan commented on May 12, 2024

from html.

annevk avatar annevk commented on May 12, 2024

Added web to https://wiki.whatwg.org/wiki/Style. Going to close this since we have a style guide now. We might move it to whatwg.org at some point in the future I suppose.

from html.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.