mdn / data

This repository contains general data for Web technologies
https://developer.mozilla.org
Creative Commons Zero v1.0 Universal
727 stars 192 forks source link

Create and test sample short descriptions #261

Closed wbamberg closed 6 years ago

wbamberg commented 6 years ago

Write short descriptions for a small number (10) of CSS properties, and test how they would work in the different contexts they might appear in (an MDN page, an editor popup, a devtools widget).

On the basis of these samples:

1) draft some guidelines about how the short descriptions should be written 2) refine the estimates of how long it will take to update all of them.

ddbeck commented 6 years ago

Making a note here that the text will also need to serve as the seoSummary text on MDN, so it'll show up on search engine result pages too. Planning to consider that too

ddbeck commented 6 years ago

Thanks for your patience while I got back to you on this, @wbamberg.

Prior art

Before I actually did anything, I read up on how the existing page summary is meant to be used and searched kinda randomly for guidance on page summaries SEO purposes. I also took a look at search engine results pages (SERPs) for existing MDN pages, on Google, Bing, and DuckDuckGo. Then I started work on some mockups.

Mockups

To make the mockups, I started by picking out the 10 CSS properties. I tried to select properties that would cover CSS's full range, with a mix of new and old properties, well-supported and obsolete properties, shorthand and longhand properties, and so on. Here are the ten that I selected:

Starting with the last one, I made a very low-fidelity mockup of the first paragraph of an MDN page, a SERP, and a VS Code-style tooltip. You can see a gist of my mockups here (download the HTML file and open it in a browser—I promise it is extremely rudimentary). Then I proceeded to add and update the summaries for each, resulting in the full file.

Guidelines

After editing the properties, looking at them in the mockups (and sometimes editing some more), and the prior art, I came up with a handful of guidelines.

Note: I use the phrase "displayed characters" to mean the number of characters rendered by a browser, after parsing HTML tags like <strong> and <a>. The summaries as written in HTML will be longer, but this doesn't seem to have any impact on our use cases.

Constraints

Content

Additional findings

It's very good news that most of these summaries didn't require major changes to get into shape. Most of the changes I made were to get the summaries' first sentence to fit into 150 displayed characters or to use less complex language (e.g., replacing "specifies" with "sets"). A few of the summaries required no changes. All of the pages had some kind of summary.

I expect that, with overheads like editing the wiki page or submitting a pull request, our previous estimate of up to 10 minutes per summary is right. Only one summary took more than 5 minutes to revise, but I also didn't really have any of the overheads (since I was just copying the inner HTML from the MDN pages' first paragraph into a file).


I think that's everything. Let me know if you have any questions. Thanks!

wbamberg commented 6 years ago

Thanks @ddbeck , this is really helpful. I'd love various people including @octref , @chrisdavidmills and @atopal to see this, and I also pinged the Discourse thread in case anyone watching that has any comments.

I think it's especially helpful to see the descriptions in context, and would encourage anyone reading your analysis to try out your mockups.

I think your recommendations are very sensible. Some topics for discussion:

The float CSS property places an element along the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the web page, though still remaining a part of the flow (in contrast to absolute positioning).

chrisdavidmills commented 6 years ago

This looks pretty darn good to me, thanks @ddbeck ! I think most questions I may have had are answered by your write up. I did have some points to make about the actual content of the summaries, but I don't think these are relevant right now as well, so I'll leave those for later.

I agree with all of Will's comments.

I did have a point about title attributes being included with full summaries of properties linked to. They are shown to be problematic for accessibility in many ways, see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title#Accessibility_concerns. Do we need to include them?

atopal commented 6 years ago

Thank you Daniel, this is great! With Will's comments this sound really good to me. In particular, I'd leave out the non-standard/deprecated waring considering the space constraints. We already have that in mdn/data as part of the status field (although it's missing "deprecated" as an enum value).

a2sheppy commented 6 years ago

The <em> tag should be allowed in short descriptions as well, since we use it for certain types of emphasis.

octref commented 6 years ago

@ddbeck Thanks a lot for your work! Here are some of my input.

The float CSS property places an element along the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the web page, though still remaining a part of the flow (in contrast to absolute positioning).

Same as @wbamberg suggested, the first sentence describes what float is, and that alone would be a good summary. The second sentence is useful, but a bit too specific as summary text.

Include support status (experimental / deprecated / obsolete)

I feel it's better to provide the metadata and leave this to the tool to decide. For example, I was playing around with this idea of showing emoji for experimental and deprecated properties:

https://twitter.com/octref/status/994649272309051392 image

the point about shorthand is interesting, and makes me wonder if instead we should represent this in the data for the item: shorthandFor: ["text-decoration-line", "text-decoration-color", "text-decoration-style"]. Then an application could query that and display it in a consistent way.

That would be great and could reduce the length of the summary too.

wbamberg commented 6 years ago

I did have a point about title attributes being included with full summaries of properties linked to. They are shown to be problematic for accessibility in many ways, see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title#Accessibility_concerns. Do we need to include them?

I'd be happy to exclude them (and there are some interesting resources linked from that section).

ddbeck commented 6 years ago

Thanks everyone for all of your feedback. I really appreciate the thought you've put into this. A few points to follow up on:

@wbamberg and I are going to have a discussion about next steps for this project. Stayed tuned!

ddbeck commented 6 years ago

OK, @wbamberg and I had a chat today about what needs to happen next. Here's what we talked about doing next

I'll begin work on all this as soon as possible (though I'll be away for much of next week, so there's going to be a brief lull).

octref commented 6 years ago

I opened an issue to track integration in VS Code: https://github.com/Microsoft/vscode/issues/58391. Thanks again for making the data available!

wbamberg commented 6 years ago

Daniel's updated the main proposal (https://github.com/mdn/data/wiki/CSS-property-short-descriptions) with these guidelines and has provided some refined estimates in this issue, so let's close this piece.