-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Writing Guidelines: quicklinks and surfacing content #31248
Conversation
…index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mdn/writing_guidelines/page_structures/page_types/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Hamish Willee <[email protected]>
files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
I think the changes to "quicklinks" here are quite confusing. In terms of our usage, we talk about "sidebar macros" and "xref macros", and it would be better to have two pages with those titles: they don't really have a lot in common. The term "quicklinks" is a very MDN-jargony term deriving from the id used for the sidebar structures - "sidebar" would be much better - and we never use "quicklinks" or "quick links" to talk about xrefs. |
files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md
Outdated
Show resolved
Hide resolved
I updated the page; I provided the origin of the term and divided the content into sidebars and content links, then subdivided into quicklink sidebar macros, otherwise creating sidebars, and quicklinks in content, and xref links. the original page is not useful, so was hoping to replace it with useful content addressing what the page originally addressed, which made sense when we were wiki-based. |
After this PR is merged, I will move the file so the slug better matches the title. At that time, i will also edit the in-page example to reflect the new slug. |
Hi @estelle, The main reason is that sidebars are important, and there is much more than this to say about them. Having all this information about other link types here makes it difficult to expose that additional information. What I'm envisaging is first a flat list of the sidebar macros and an explanation of where you apply them. Then additional info on what you need to do to add things to the default API overview - i.e. the GroupData.json. Last of all the instructions on the quicklinks There's this post by @wbamberg That would need to be captured in some shape or form https://discourse.mozilla.org/t/defaultapisidebar-apiref-and-groupdata/40210 . Appreciate that this makes a relatively constrained job you started on much bigger. I'm happy to do this as follow on to your work, in which case I'd suggest you just rename this sidebar and I'll merge and take it forward. Up to you. @wbamberg is the MDN sidebar expert for any questions and would be a better reviewer than me. Particularly since I am away at the end of the month. I have added him. |
Basically I agree with everything Hamish says in #31248 (comment).
I think this would be better. But I also think what's in this PR as it stands is better than the current page, so would be OK to merge it as is and make a follow up. Also though, I wonder how much value we get out of these meta-docs. I have personally never read this page, and I doubt anyone really learns how to write for MDN using the meta-docs (page templates aside). So how much should we invest in improving them? I wish wish wish we could improve the platform so authors didn't have to do all this manual labour. Why do authors even have to add macro calls manually? Why can't Yari work this out? Would much rather put the time into that. |
slug: MDN/Writing_guidelines/Page_structures/Quicklinks | ||
page-type: mdn-writing-guide | ||
--- | ||
|
||
{{MDNSidebar}} | ||
|
||
MDN supports adding quicklinks to pages; these are boxes containing a potentially hierarchical list of links to other pages on MDN or to pages off-site. | ||
This article describes how to create quicklinks boxes. | ||
MDN supports adding links and lists of links in sidebars and within the main content of a page. You can and often **should** use macros to generate links. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"can and often should" is not helpful advice without explaining somewhere what "often" means. IMO you should use macros for sidebars, and for xrefs when you are linking to a reference page for a concrete web platform feature (and an xref for that feature exists).
|
||
```html | ||
Every page has a sidebar. These sidebars are created by Quicklinks. **Quicklinks** are MDN macros that create boxes containing a potentially hierarchical list of links to other pages on this site. They are mainly used in sidebars, though can also be used in the main content area. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like Hamish says, the term "quicklinks" doesn't add anything here.
### Sidebars: adding additional content | ||
|
||
Each of the Quicklink macros listed above creates a predefined sidebar structure. | ||
If you need to append links before or after the sidebar structure generated by the macro, you can do so by: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is bad advice. A given page in a given bit of the site should have a given sidebar - so e.g. a page in CSS should have CSSRef. All pages in that bit of the site should have the same sidebar.
If you want to add links to a page in CSS, you should want to add those links to all pages in CSS. So you should handle this by modifying the sidebar macro.
In general, if we want to document "manual quicklinks" at all, we should document them as an legacy pattern that people will sometimes find in parts of the site that don't yet have sidebar macros defined for them.
|
||
- `\{{CSSRef}}` | ||
|
||
- : Present on every CSS page, it generates different CSS sidebars depending on tags, like "properties", "selectors", "at-rules", "descriptors", etc., included in the page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it always generates the same sidebar.
|
||
- : Present on every CSS page, it generates different CSS sidebars depending on tags, like "properties", "selectors", "at-rules", "descriptors", etc., included in the page. | ||
|
||
- `\{{ListSubpagesForSidebar(<parameters>)}}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ListSubpagesForSidebar does not make a sidebar, it makes an ordered list of links, that can be included in a sidebar. (that is, it does not make a section with a quick_links
ID, which is the magic that makes a blob of HTML get treated as a sidebar by Yari).
- `\{{HTTPMethod("")}}` | ||
- `\{{HTTPStatus("")}}` | ||
|
||
All the macros accept additional parameters. The second parameter, if present, provides the link text. By default, these links are displayed like code, in a monospace font. To prevent HTML code semantics and CSS code styling, the `"nocode"` parameter can be included as the third value in the macro call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the different xref macros don't all have the same API, so it's hard to make general statements about them. For example, CSSXref doesn't support "nocode" at all, while for those that do, like DOMXref, it is more often the fourth parameter than the third. I think it would be better either to document the parameters completely, or just to refer to the source files, which should always include documentation: https://github.com/mdn/yari/blob/bda844f7dd745f7e3ac15736c3c884fc26507464/kumascript/macros/DOMxRef.ejs#L1-L15.
|
||
All the macros accept additional parameters. The second parameter, if present, provides the link text. By default, these links are displayed like code, in a monospace font. To prevent HTML code semantics and CSS code styling, the `"nocode"` parameter can be included as the third value in the macro call. | ||
|
||
For example, `\{{CSSxRef("background-color")}}` creates the code link "{{CSSxRef("background-color")}}" and `\{{CSSxRef("At-rules", "CSS at-rule", "nocode")}}` creates the plain text link "{{CSSxRef("At-rules", "CSS at-rule", "nocode")}}". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://developer.mozilla.org/en-US/docs/Web/CSS/At-rules doesn't exist. Also I think it is an anti-pattern to use xefs to link to guide pages, although we are not very clear about this.
I addressed @wbamberg and @hamishwillee's comments. I'll merge this now, and start working on breaking guidelines into two pages, and rename quicklinks to sidebars. (see |
* Writing guidelines: structure the page templates sectionfor ease of navigation. * alt for images * update links from wiki to github * see also to quicklinks page and list of macros * page types: added templates and see also sections * Added see also to page structure (which was just a list of subpages) * Explanation of quicklinks * Update files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * twaks * Update files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * twaks * page components desc. * Update files/en-us/mdn/writing_guidelines/page_structures/index.md * Update files/en-us/mdn/writing_guidelines/page_structures/page_types/index.md * move macros to see also section * move macros to see also section * Update files/en-us/mdn/writing_guidelines/page_structures/macros/commonly_used_macros/index.md * Update files/en-us/mdn/writing_guidelines/page_structures/macros/commonly_used_macros/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * the bot and this PR hate me * Update files/en-us/mdn/writing_guidelines/page_structures/macros/commonly_used_macros/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * happiness * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update files/en-us/mdn/writing_guidelines/page_structures/quicklinks/index.md * header levels * make it clearer * grammar * Apply suggestions from code review Co-authored-by: Hamish Willee <[email protected]> * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Change to sidebars and other link macros * escape macro * escape macro * addressed will's comments * typo --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hamish Willee <[email protected]>
Added a lot of links between pages within the guidelines to improve searchability.
Removed some wiki-related content
Rewrote quicklinks (not 100% perfect, but the old stuff was for the wiki)
"quicklinks" was an ID. It means something to wiki developers, but nothing to MDN maintainers. I am repurposing the work to mean "a quick link or group of links".
Why https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Page_structures/Quicklinks is not longer valid:
The example is no longer valid:
So the syntax section had to go.
The bottom section is not valid:
No, my article is not 100% perfect, but what is there is not helpful. I think this version improves a lot on that. My the content covered by my version can be improved, but is suffices and is better than the current content.