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

Run html-validate on docs/ to find problems to fix? #2369

Closed
maelle opened this issue Nov 6, 2023 · 10 comments · Fixed by #2523
Closed

Run html-validate on docs/ to find problems to fix? #2369

maelle opened this issue Nov 6, 2023 · 10 comments · Fixed by #2523

Comments

@maelle
Copy link
Collaborator

maelle commented Nov 6, 2023

Examples of things I see

  • Prefer to use the native element (for the navbar dropdown, there are elements with role="button")
  • Trailing whitespaces
  • Use of conditional comments are deprecated (in the head, something about IE)

Maybe some of those are worth fixing.

https://www.npmjs.com/package/html-validate

@hadley
Copy link
Member

hadley commented Apr 11, 2024

IMO this is only worth doing if we can automate, preferably with an R package.

@maelle
Copy link
Collaborator Author

maelle commented Apr 19, 2024

From quarto-dev/quarto-cli#7489 (reply in thread) I found https://github.com/validator/validator/releases/tag/latest which could be used in a GHA workflow. Not an R package 😅

@hadley
Copy link
Member

hadley commented Apr 19, 2024

Maybe we could just make it part of the release process? i.e. run vnu on pkgdown's own site?

@maelle
Copy link
Collaborator Author

maelle commented Apr 19, 2024

yes! I'd need to run it on the current website, to see what it returns. 😅

@hadley
Copy link
Member

hadley commented Apr 19, 2024

A lot of repeated warnings like this:

"file:/Users/hadleywickham/Documents/devtools/pkgdown/docs/dev/reference/build_site.html":2.140-2.161: error: A document must not include both a “meta” element with an “http-equiv” attribute whose value is “content-type”, and a “meta” element with a “charset” attribute.
"file:/Users/hadleywickham/Documents/devtools/pkgdown/docs/dev/reference/build_site.html":270.1-270.17: error: Duplicate ID “cb1-3”.

I can't figure out where either of those is generated 😭

@hadley
Copy link
Member

hadley commented Apr 19, 2024

Looks like libxml2 automatically adds the http-equiv meta tag 😬 — oh but looks like I can strip it off after the fact. Oh but then libxml2 just adds it again

@maelle
Copy link
Collaborator Author

maelle commented Apr 23, 2024

Reading the docs for read_html() reminded me of r-lib/xml2#432 (I nearly opened a duplicate issue 😅)

@maelle
Copy link
Collaborator Author

maelle commented Apr 23, 2024

@maelle
Copy link
Collaborator Author

maelle commented Apr 23, 2024

@hadley
Copy link
Member

hadley commented May 9, 2024

Having tried html-validate, it produces vastly superior output to vnu. I've fixed the most obvious low-hanging fruit and I think that's probably sufficient. I don't think running it regularly is going to be terribly useful as there a few false positives or things that just aren't going to be worth fixing given the potential gain.

hadley added a commit that referenced this issue May 14, 2024
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this issue Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants