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

Web API titles: some sample interfaces #21810

Closed
wants to merge 1 commit into from

Conversation

wbamberg
Copy link
Collaborator

@wbamberg wbamberg commented Oct 25, 2022

This draft PR is to show what page titles based on https://github.com/orgs/mdn/discussions/248#discussioncomment-3797416 would look like. It updates the title and adds short-title for three interfaces:

https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement
https://developer.mozilla.org/en-US/docs/Web/API/Response
https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLBinding

I chose Response because it's very commonly referenced and has some statics, the other two because they contain some quite long titles.

Note that the sidebars will look a bit silly unless you run this with the Yari from https://github.com/wbamberg/yari/tree/apiref-short-title, which contains the update to make APIRef use short-title if it's available.

@github-actions github-actions bot added the Content:WebAPI Web API docs label Oct 25, 2022
@github-actions
Copy link
Contributor

Preview URLs (50 pages)
Flaws (12)

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

URL: /en-US/docs/Web/API/HTMLVideoElement/videoHeight
Title: HTMLVideoElement: videoHeight property
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/HTMLMediaElement/resize does not exist
    • /en-US/docs/Web/API/HTMLVideoElement/resize does not exist

URL: /en-US/docs/Web/API/XRWebGLBinding/createCylinderLayer
Title: XRWebGLBinding: createCylinderLayer() method
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/GLenum redirects to /en-US/docs/Web/API/WebGL_API/Types
    • /en-US/docs/Web/API/GLenum redirects to /en-US/docs/Web/API/WebGL_API/Types

URL: /en-US/docs/Web/API/XRWebGLBinding/createEquirectLayer
Title: XRWebGLBinding: createEquirectLayer() method
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/GLenum redirects to /en-US/docs/Web/API/WebGL_API/Types
    • /en-US/docs/Web/API/GLenum redirects to /en-US/docs/Web/API/WebGL_API/Types

URL: /en-US/docs/Web/API/XRWebGLBinding/createProjectionLayer
Title: XRWebGLBinding: createProjectionLayer() method
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/GLenum redirects to /en-US/docs/Web/API/WebGL_API/Types
    • /en-US/docs/Web/API/GLenum redirects to /en-US/docs/Web/API/WebGL_API/Types

URL: /en-US/docs/Web/API/XRWebGLBinding/createCubeLayer
Title: XRWebGLBinding: createCubeLayer() method
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/GLenum redirects to /en-US/docs/Web/API/WebGL_API/Types
    • /en-US/docs/Web/API/GLenum redirects to /en-US/docs/Web/API/WebGL_API/Types

URL: /en-US/docs/Web/API/XRWebGLBinding/createQuadLayer
Title: XRWebGLBinding: createQuadLayer() method
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/GLenum redirects to /en-US/docs/Web/API/WebGL_API/Types
    • /en-US/docs/Web/API/GLenum redirects to /en-US/docs/Web/API/WebGL_API/Types

@wbamberg wbamberg changed the title Update title and add short-title for selected interfaces Web API titles: some sample interfaces Oct 25, 2022
@@ -1,5 +1,6 @@
---
title: XRWebGLBinding()
title: "XRWebGLBinding: XRWebGLBinding() constructor"
Copy link
Member

Choose a reason for hiding this comment

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

Currently, we special case constructors to avoid having the same word twice. I wonder if it would be nicer to continue to do that, like so:

Suggested change
title: "XRWebGLBinding: XRWebGLBinding() constructor"
title: "XRWebGLBinding() constructor"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm weakly -1 on this, because I like the consistency of always having the InterfaceName: prefix for everything associated with that interface (and maybe because of some vague folk memory of working with C++ a long time ago!). But I do take your point about repetition and am happy to accept this change if it's the consensus and unblocks this work.

Copy link
Member

Choose a reason for hiding this comment

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

I'm happy either way. Unless @Rumyra has a strong opinion we should decide and go ahead :)

@estelle
Copy link
Member

estelle commented Nov 2, 2022

With the sidebar, i prefer a shorter title. The header says the API and that the are instance properties, so I think we can leave the API and the word property off.

My favorite:
only the instance property name

With the word property:
Instance + propertyword

As is:
API name + instance + property word

We do need to align the icon. With the short version, it would look better after the term.

@wbamberg
Copy link
Collaborator Author

wbamberg commented Nov 2, 2022

Thanks for looking!

With the sidebar, i prefer a shorter title. The header says the API and that the are instance properties, so I think we can leave the API and the word property off.

Yes. This PR also adds a short-title key that can be used in contexts where things like "property" are clear. This needs an update in the sidebar code, to make use of the short-title. I've made a separate Yari PR that contains this update, at https://github.com/wbamberg/yari/tree/apiref-short-title. So if you want to see what titles will look like you'll need to run this PR with that Yari PR:

We do need to align the icon. With the short version, it would look better after the term.

Yes, I agree about this. But I think it is a different issue.

@github-actions
Copy link
Contributor

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

@tomasz13nocon
Copy link

Some other issues caused by long titles on mobile screens are:

  • Featured articles on the homepage expand beyond the viewport:
    image
  • Breadcrumbs with long names overflow the page and make it horizontally scrollable:
    Screenshot from 2022-12-27 13-39-12
    After scrolling right:
    image

@wbamberg
Copy link
Collaborator Author

Some other issues caused by long titles on mobile screens are:

Thanks for highlighting these!

I think the "Featured articles" should be improved by this change, because it will give more line breaking opportunities, and as for breadcrumbs, the PR to use short titles in sidebars will also use them in breadcrumbs, so that should help there.

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

github-actions bot commented Mar 3, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants