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

docs(meta): Add See also section guidelines to writing style guide #25191

Merged
merged 13 commits into from
Mar 23, 2023

Conversation

dipikabh
Copy link
Contributor

@dipikabh dipikabh commented Mar 9, 2023

Motivation

This discussion describes the existing inconsistencies across the See also sections and the proposed set of guidelines to follow from here on.

Details of changes

  • In the Writing style guide:
  1. With the non-implementation of exposing H3 headings in the page TOC on the right, added a mini TOC in each of the three H2 sections "General writing guidelines", "Writing style", and "Page components".
  2. Upgraded "Shortened URLs (shortlinks)" from H4 to H3 and also edited the section a bit.
  3. Added the "See also section" section per the proposal in the discussion.
  4. Updated the "See also" section of the Writing style guide to comply with the new guidelines.
  • In the template files:
    Updated the "See also" section to refer to the guidelines in the writing style guide.

TO DO

@github-actions github-actions bot added the Content:Other Any docs not covered by another "Content:" label label Mar 9, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2023

Preview URLs (15 pages)
Flaws (43)

Note! 3 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/MDN/Writing_guidelines/Writing_style_guide
Title: Writing style guide
Flaw count: 1

  • broken_links:
    • Can't resolve /en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/API_event_subpage_template
Title: API event subpage template
Flaw count: 3

  • macros:
    • /en-us/docs/web/api/mdn (url: /en-US/docs/Web/API/MDN) does not exist
  • broken_links:
    • Can't resolve /en-US/docs/Web/API/Window/animationcancel_event
  • bad_bcd_queries:
    • No BCD data for query: path.to.feature.NameOfTheEvent_event

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/API_method_subpage_template
Title: API method subpage template
Flaw count: 2

  • macros:
    • /en-us/docs/web/api/mdn (url: /en-US/docs/Web/API/MDN) does not exist
  • bad_bcd_queries:
    • No BCD data for query: path.to.feature.NameOfTheMethod

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/HTML_element_page_template
Title: HTML element page template
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: path.to.feature.NameOfTheElement

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/ARIA_Page_Template
Title: ARIA page template
Flaw count: 1

  • macros:
    • `/home/runner/work/content/content/node_modules/@mdn/yari/kumascript/macros/Specifications.ejs:1

1| <%
2| /*
3| Placeholder to render a specification section with spec_urls from BCD
4|

No first query argument or 'browser-compat' or 'spec-urls' front-matter value passed`


URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/HTTP_header_page_template
Title: HTTP header page template
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: path.to.feature.NameOfTheHeader

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/API_landing_page_template
Title: API landing page template
Flaw count: 10

  • macros:
    • /en-us/docs/web/api/mdn (url: /en-US/docs/Web/API/MDN) does not exist
    • /en-US/docs/Web/API/NameOfTheInterface does not exist
    • /en-US/docs/Web/API/Addition1 does not exist
    • /en-US/docs/Web/API/Addition1 does not exist
    • Calling the Specifications macro with any arguments is deprecated; instead use either the 'browser-compat' or 'spec-urls' front-matter key.
    • and 3 more flaws omitted
  • bad_bcd_queries:
    • No BCD data for query: path.to.feature.Interface_1
    • No BCD data for query: path.to.feature.Interface_2

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/CSS_selector_page_template
Title: CSS selector page template
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: css.selectors.NameOfTheSelector

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/API_constructor_subpage_template
Title: API constructor subpage template
Flaw count: 3

  • macros:
    • /en-us/docs/web/api/mdn (url: /en-US/docs/Web/API/MDN) does not exist
    • /en-US/docs/Web/API/NameOfTheParentInterface does not exist
  • bad_bcd_queries:
    • No BCD data for query: path.to.feature.NameOfTheConstructor

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/API_reference_page_template
Title: API reference page template
Flaw count: 16

  • macros:
    • /en-us/docs/web/api/mdn (url: /en-US/docs/Web/API/MDN) does not exist
    • /en-US/docs/Web/API/NameOfTheInterface/NameOfTheInterface does not exist
    • /en-US/docs/Web/API/NameOfTheInterface does not exist
    • /en-US/docs/Web/API/NameOfParentInterface does not exist
    • /en-US/docs/Web/API/NameOfTheInterface/staticProperty1 does not exist
    • and 10 more flaws omitted
  • bad_bcd_queries:
    • No BCD data for query: path.to.feature.NameOfTheInterface

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/SVG_element_page_template
Title: SVG element page template
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/NameOfSVGDOMElement does not exist
  • bad_bcd_queries:
    • No BCD data for query: path.to.feature.NameOfTheElement

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/API_property_subpage_template
Title: API property subpage template
Flaw count: 2

  • macros:
    • /en-us/docs/web/api/mdn (url: /en-US/docs/Web/API/MDN) does not exist
  • bad_bcd_queries:
    • No BCD data for query: path.to.feature.NameOfTheProperty
External URLs (11)

URL: /en-US/docs/MDN/Writing_guidelines/Writing_style_guide
Title: Writing style guide


URL: /en-US/docs/Web/CSS/@layer
Title: @layer

(comment last updated: 2023-03-22 19:46:36)

@dipikabh dipikabh marked this pull request as ready for review March 9, 2023 03:13
@dipikabh dipikabh requested a review from a team as a code owner March 9, 2023 03:13
@dipikabh dipikabh requested review from captainbrosset, bsmth, estelle, Rumyra, teoli2003 and Josh-Cena and removed request for a team March 9, 2023 03:13
- [English Grammar FAQ](https://www-personal.umich.edu/~jlawler/aue.html) (alt.usage.english)
- [Merriam-Webster's Concise Dictionary of English Usage](https://www.amazon.com/Merriam-Websters-Concise-Dictionary-English-Usage/dp/B004L2KNI2) (Amazon link): Scholarly but user-friendly, evidence-based advice; very good for non-native speakers, especially for preposition usage.
- [English Language and Usage StackExchange](https://english.stackexchange.com/): Question and answer site for English language usage.
- Preferred style guides: If you have questions about usage and style not covered here, we recommend referring to the [Microsoft Writing Style Guide](https://docs.microsoft.com/style-guide/welcome/) or [The Chicago Manual of Style](https://www.amazon.com/Chicago-Manual-Style-16th/dp/0226104206).
Copy link
Member

Choose a reason for hiding this comment

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

This list still doesn't follow the new See also guide (which says titles-only), does it? ^^ I slightly prefer the original style (without a list), and I would rather change the title to "Further reading" if "See also" implies some kind of structure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, you're right. This "See also" section in the writing style guide is still description-heavy and kinda non-compliant with the proposed guidelines. So, good catch! I guess I missed to make it titles-only in trying to first convert the subsections into a bulleted list. But before I fix that now, I would need clarifications about your other comments:

I slightly prefer the original style (without a list)

Did you mean in this particular case or in general for the "See also" sections elsewhere?

I would rather change the title to "Further reading" if "See also" implies some kind of structure.

Is this specific to content in this section or in general?

Are you saying that you'd like to keep the See also section in the writing style guide as is but rename the heading to "Further reading"?

The "See also" section in the style guide should be able to exemplify the guidelines recommended in the style guide. So it would be nice to make it a bulleted list of links and retain the title.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, my comment specifically refers to this page's See also—I agree with the guideline. I think the previous prose-like content is easy to read and also contains useful information, so making it a bulleted list seems like a net loss, apart from exemplification purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I see your point. I've updated the section title in this case to "Further reading".

Retaining the existing descriptive info for links and not getting rid of all of it is, in general, good advice. So now there is a guideline on how to retain that info, wherever it may already exist. Please see comment below.

Copy link
Contributor

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

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

Approving = expression of my agreement on the new rules (But we want to wait for other reviewers' expression of approval before merging)

@dipikabh
Copy link
Contributor Author

Thank you, @teoli2003!


Most of the guides, reference pages, and even glossary pages on MDN Web Docs contain a _See also_ section at the end of the article. This is a reference section containing cross-references to related topics within MDN and sometimes links to related external articles. For example, this is the [See also section](/en-US/docs/Web/CSS/@layer#see_also) for the `@layer` page.

In general, present the links in a See also section in a [bulleted list](#lists) format with each item in the list as a phrase. In the [Learn web development](/en-US/docs/Learn) area on MDN, however, the See also section follows the [definition list](/en-US/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN#definition_lists) format.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm going to be the minority, but I prefer "succinct where possible". Consider @layer linked here - as a reader and a writer, import tells me enough, while to me the fact that !important is a flag seems a little unnecessary. I mean if I know what it is then I know its a flag, and if I don't then having that information won't change my desire to click or not click it.

image

Phrases where they tell you something useful are excellent, but fewer words is better.

Copy link
Collaborator

Choose a reason for hiding this comment

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

PS, and this does not match the guide. The see also section here says use bulleted list, but bulleted list says that we use bulleted list with phrase and punctuation. Here we have no punctuation.

Upshot, we should fix the example of "how to do it right" so that it does it right :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback, Hamish.

  • I've actually incorporated this now (I agree). I've removed the guideline about adding a descriptor for the keyword. :)

  • I've added an updated version of this @layer example to clarify what it would look like (though I've yet to update all other examples demo'ed in the discussion.). It is also the example we're linking to in the style guide in the "See also" guideline section.

  • Also, I've updated the "bulleted list" guideline in the style guide. Only complete sentences end in period. If the list item is a phrase, it will not end in a period, which is what the above @layer "See also" is following (6af59ab)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@dipikabh I like what you've done in #25191 (comment)

I'm a little concerned with the use of the term "phrase" -it has many definitions, and a phrase can be a sentence.
Consider using the terms "single word", "incomplete sentence" and/or "topic title" or similar (i.e. a topic title might be a complete sentence, but normally we won't want to put a full stop after it - though it does not harm.

FWIW My preference (when I control the rules an open source doc set):

  1. If it is a sentence, capitalize the first letter
  2. No full stops by default - for either a sentence or a partial sentence.
  3. Try avoid multiple sentences in bullet points. But if there are multiple sentences, these should be fully punctuated, including the final sentence.

This ensures that in the majority of cases there are no full stops, which is more consistent, and looks better in cases when you have lists with mixed sentences and partial sentences. The purist in me says use full punctuation everywhere, but this does not look as good, and is annoying to enforce when no one does so any more. Just my two bits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A phrase is never a complete sentence. Nevertheless, I've added a clarification for the term in "Bulleted lists" in the "Lists" section.

I agree with point 3. Some of this is already documented in "Bulleted lists". I've additionally added the following (borrowed from microsoft's guideline):

If one or more list items are complete sentences, use a period after every list item, even if a list item contains three or fewer words.

Point 2 - A sentence would always need to end in a period. The above rule will help if there is a mix of complete and incomplete sentences. And we're also emphasizing to follow the same sentence structure across all list items.

Updates are in b178e10. Let me know what you think @hamishwillee.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks @dipikabh - I've noted the only "annoyance" here b178e10#r104453682

But looks fine to me! Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for sharing, @hamishwillee. I hope the response answers your concern.

I'll be opening another PR to address some of the examples I had brought up in the original discussion. We can tweak/clarify the guidelines further, if needed, as we go along.

Copy link
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

Despite my comment https://github.com/mdn/content/pull/25191/files#r1133465543 , this is a heap better and more consistent. Approving.

@dipikabh dipikabh requested a review from a team as a code owner March 14, 2023 00:06
@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label Mar 14, 2023
@dipikabh
Copy link
Contributor Author

After feedback from @Josh-Cena and @hamishwillee (I agree with both the comments), here's a slight tweak to the original proposal:
/cc @teoli2003

  • In case of links to reference pages, let's drop the descriptor such as keyword or property (commit)
  • In cases where there is already descriptive text, let's not remove it all. Some of it is good information. Instead, added a guideline on how to present that descriptive info:
    • <link text>: description phrase(no punctuation)
  • Keep the descriptive text surrounding the link minimal. In case of a description, add it after the link text and a colon. Word the description as a phrase with no ending punctuation. Keep all linked text at the beginning to aid in scanning the list of links.
  • Correct: :checked", :indeterminate: CSS selectors for styling checkboxes

@dipikabh
Copy link
Contributor Author

Thanks. @bsmth. I've incorporated your feedback (9120313)

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Mar 15, 2023
@github-actions
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Mar 15, 2023
Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

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

Thanks, @dipikabh - no other comments for me after you resolved the outdated ones. Thanks for the lift! 🎉

Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

The text looks alright to me, but its implications as manifested in the examples (#25380 (comment)) worry me. So I'd like to discuss over the examples and get them merged before approving this one. In particular, any non-structured description text is going to make the list much harder to maintain and keep consistent across related pages.

@dipikabh
Copy link
Contributor Author

Thank you all for your feedback and the brainstorming to iron out the guidelines for "See also". The main points in the style guide can be viewed here: See also guidelines. @hamishwillee rightly pointed out what we say in the bulleted lists section should be in sync with the lists in "See also" and that's been clarified as well, hopefully.

It would be good to land this soon so we can start using the guidelines 🙂.
cc: @Josh-Cena @hamishwillee @teoli2003

Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the work!


- Keep the descriptive text surrounding the link minimal. In case of a description, add it after the link text and a colon. Word the description as a phrase with no ending punctuation. Keep all linked text at the beginning to aid in scanning the list of links.
- **Correct**: {{cssxref(":checked")}}, {{cssxref(":indeterminate")}}: CSS selectors for styling checkboxes
- If the links can be grouped by a theme, add a lead-in sentence to describe the list of links. End the lead-in sentence with a colon.
Copy link
Member

Choose a reason for hiding this comment

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

Is there an example for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needed to be removed because of the updated guideline just before it. (1e8d353)

@dipikabh
Copy link
Contributor Author

Thanks for the approvals and support, everyone. Merging this now.

As always, if there are still any points we want to clarify further or feel the need to add to guidelines, especially after we start complying with the guidelines (there might be more varied instances in the existing "See also" sections), we can do so in subsequent follow-up PRs.

@dipikabh dipikabh merged commit 77eea2b into mdn:main Mar 23, 2023
@dipikabh dipikabh deleted the see-also-guidelines branch March 23, 2023 15:52
@Josh-Cena
Copy link
Member

Josh-Cena commented Mar 23, 2023

@dipikabh I was trying to apply the guideline on external see also links. I have several questions:

  • Should we consistently include the author and source of the article?
  • If we are quoting a chapter from a book or a section from a post, should the link text be the chapter/section title itself or something like "Section X from XYZ, by Aaaa (January 1, 1970)"?
  • Should a live-updated book in a GitHub repo get a date?

It may help to give a few more examples on external links. For example, here are a few I attempted:

@hamishwillee
Copy link
Collaborator

...

  • Should we consistently include the author and source of the article?

These are all good questions, for which I believe we have no rules yet.

FWIW I would normally do a list like the one above as follows:

Why?

  • For blogs dev sites, the site url tells you the "value" if you know the site - the author does not usually tell me anything extra to help me know if the link is likely to be useful.
  • For a book, I think it is good manners to do the book name and author - for a well know book the author matters.
  • Naming the spec is sufficient, but generally on MDN we try avoid direct linking to spec sections for documentation.
  • Not so sure on dates. In theory they are useful for noting that content is "old", but it depresses me to see a whole set of links with old dates, but still doesn't tell me that they are good or not.

All that said, I do not feel strongly about this. It just appeals to my minimalist tendencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs Content:Other Any docs not covered by another "Content:" label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants