Skip to content

Drop SVG attribute counts#5148

Merged
wbamberg merged 11 commits intomdn:mainfrom
ddbeck:consistent-svg-attr-counts
Jun 18, 2021
Merged

Drop SVG attribute counts#5148
wbamberg merged 11 commits intomdn:mainfrom
ddbeck:consistent-svg-attr-counts

Conversation

@ddbeck
Copy link
Contributor

@ddbeck ddbeck commented May 20, 2021

Never count attributes again! This is a follow up to #5147. It changes all the remaining cases of:

X elements are using this attribute: [long list of attribute refs]

to

These elements use this attribute: [long list of attribute refs].

@github-actions

This comment has been minimized.

Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

Yup yup! Nice work.

@chrisdavidmills
Copy link
Contributor

oop, little conflict to fix.

@wbamberg
Copy link
Collaborator

SpanishInquisitionCantCount

I hate to be picky, but to me:

These elements use this attribute:

... doesn't read as well as:

The following elements use this attribute:

Something about "these/this". Is that just me?

@ddbeck
Copy link
Contributor Author

ddbeck commented May 20, 2021

@wbamberg

Something about "these/this". Is that just me?

No, not just you. I thought it was slightly awkward when I wrote it, but it was a solution (to my problem of not wanting to count more things than I have fingers) that could be achieved through an uncomplicated regular expression.

The right way to do this is probably to make a section for this, like the permitted property lists we came up for the CSS recipe:

Applicable elements

You can use this attribute with the following SVG elements:

  • elem1
  • elem2
  • elemN

Or for cases where all elements are supported:

Applicable elements

You can use this attribute with any SVG element.

@wbamberg
Copy link
Collaborator

The right way to do this is probably to make a section for this, like the permitted property lists we came up for the CSS recipe:

Yes, I agree (and had the same thought, after commenting of course).

@ddbeck
Copy link
Contributor Author

ddbeck commented May 20, 2021

I could do that with this PR, unless you think we ought to put it up for discussion more widely first.

@wbamberg
Copy link
Collaborator

@Rumyra , @Elchi3 , are you +1 on Daniel making the change described in #5148 (comment) ? Are there other people we should ask here?

@Elchi3
Copy link
Member

Elchi3 commented May 21, 2021

Sounds good to me!

(I will say here that I'm not a big fan of attribute reference pages. I think if I would write SVG docs from scratch, attribute pages would sit inline or under their element page. Yes, this might mean some duplication, but at least I could then document the attribute in context of its element. I could be convinced if readers would search for attributes on their own specifically, but right now I'm not. I think readers will want to use attributes in the context of an element, so 🤷 )

@Rumyra
Copy link
Collaborator

Rumyra commented May 21, 2021

Yeh looks good to me :)

@sideshowbarker
Copy link
Member

@ddbeck This status of this PR seems to be that it’s waiting for the change described in #5148 (comment) to be made, right?

@ddbeck
Copy link
Contributor Author

ddbeck commented Jun 14, 2021

@sideshowbarker Yes, that's correct and this PR slipped my mind. I'll try to finish this today (but definitely by the end of my day tomorrow).

@ddbeck
Copy link
Contributor Author

ddbeck commented Jun 15, 2021

OK, I kinda regret that I spent as much time on this as I have today, but I've now turned these very long sentences into actual lists or a paragraph saying, "You can use this attribute with any SVG element." I tried to make this as regular as I could, across all of the SVG attribute pages. As you can see, it's a huge diff. I'm sorry.

There is something I haven't done: created a section for "Applicable elements", as previously discussed. That's kinda hard to do in a quick-and-dirty way, particularly because it's underspecified. I don't know where in the outline the section should go and I don't think the page type is sufficiently well-defined trust that I could insert the section in the right spot.

Honestly, I don't think it's a good use of my time to sort this out page-by-page, so I propose leaving it at this. Like @Elchi3 says, these pages might not be that interesting to readers anyway. If y'all think this is good enough, let's merge this (barring any immediate brokenness to deal with) and move on.

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

@ddbeck
Copy link
Contributor Author

ddbeck commented Jun 18, 2021

@wbamberg Thanks for the review! Fixes applied and marked resolved, where it was obvious. One outstanding question for you:

While most of these pages have this bit at the start, before the example, a few have placed it later. I found:

https://pr5148.content.dev.mdn.mozit.cloud/en-US/docs/Web/SVG/Attribute/mask
https://pr5148.content.dev.mdn.mozit.cloud/en-US/docs/Web/SVG/Attribute/viewBox
https://pr5148.content.dev.mdn.mozit.cloud/en-US/docs/Web/SVG/Attribute/pointer-events
https://pr5148.content.dev.mdn.mozit.cloud/en-US/docs/Web/SVG/Attribute/transform
https://pr5148.content.dev.mdn.mozit.cloud/en-US/docs/Web/SVG/Attribute/color-profile

It's a little weird how these pages plunge right from this into the example, but when we remove all the div id= from the live samples we will want to add "Example" H2 headings, and that should help these pages communicate their organization better.

I wasn't quite clear on what steps you thought I should take here. Should I make all of the pages like the links above? Or change the linked pages to be like the others? Or something else?

@wbamberg
Copy link
Collaborator

@wbamberg Thanks for the review! Fixes applied and marked resolved, where it was obvious. One outstanding question for you:

While most of these pages have this bit at the start, before the example, a few have placed it later. I found:
https://pr5148.content.dev.mdn.mozit.cloud/en-US/docs/Web/SVG/Attribute/mask
https://pr5148.content.dev.mdn.mozit.cloud/en-US/docs/Web/SVG/Attribute/viewBox
https://pr5148.content.dev.mdn.mozit.cloud/en-US/docs/Web/SVG/Attribute/pointer-events
https://pr5148.content.dev.mdn.mozit.cloud/en-US/docs/Web/SVG/Attribute/transform
https://pr5148.content.dev.mdn.mozit.cloud/en-US/docs/Web/SVG/Attribute/color-profile
It's a little weird how these pages plunge right from this into the example, but when we remove all the div id= from the live samples we will want to add "Example" H2 headings, and that should help these pages communicate their organization better.

I wasn't quite clear on what steps you thought I should take here. Should I make all of the pages like the links above? Or change the linked pages to be like the others? Or something else?

I think that those 5 cases should follow the pattern of the other pages, and include this "You can use this attribute" bit at the start, immediately after the introductory paragraph.

Sorry to be unclear, this bit of my comment:

It's a little weird how these pages plunge right from this into the example, but when we remove all the div id= from the live samples we will want to add "Example" H2 headings, and that should help these pages communicate their organization better.

...was more of a general comment about all these pages, and not a thing I expect you to do anything about in this PR.

@ddbeck
Copy link
Contributor Author

ddbeck commented Jun 18, 2021

I think that those 5 cases should follow the pattern of the other pages, and include this "You can use this attribute" bit at the start, immediately after the introductory paragraph.

Thank you for the clarification. Done! ✅

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

👍 Thanks Daniel!

@wbamberg wbamberg merged commit 4ea1872 into mdn:main Jun 18, 2021
@ddbeck ddbeck deleted the consistent-svg-attr-counts branch June 18, 2021 17:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants