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

Why use the h1 heder for each version of the NEWS.md? #1930

Closed
eitsupi opened this issue Dec 28, 2023 · 4 comments
Closed

Why use the h1 heder for each version of the NEWS.md? #1930

eitsupi opened this issue Dec 28, 2023 · 4 comments

Comments

@eitsupi
Copy link

eitsupi commented Dec 28, 2023

Currently when NEWS files are updated by usethis uses h1 # for the heading of each version.

usethis/R/news.R

Lines 36 to 59 in 709f825

use_news_heading <- function(version) {
news_path <- proj_path("NEWS.md")
if (!file_exists(news_path)) {
return(invisible())
}
news <- read_utf8(news_path)
title <- glue("# {project_name()} {version}")
if (title == news[[1]]) {
return(invisible())
}
development_title <- glue("# {project_name()} (development version)")
if (development_title == news[[1]]) {
news[[1]] <- title
ui_done("Replacing development heading in NEWS.md")
return(write_utf8(news_path, news))
}
ui_done("Adding new heading to NEWS.md")
write_utf8(news_path, c(title, "", news))
}

But normally h1 is supposed to be used one for each page, wouldn't it be more natural to use h2?
Do you think it is worth having such an option to at least use h2 ##?

@jennybc
Copy link
Member

jennybc commented Jan 4, 2024

I don't really know why h1 was chosen here, but I think it would be pretty painful to do anything else at this point. There is code in usethis and pkgdown, just for starters, I imagine, that is built around this assumption.

@hadley do you have any observations?

@hadley
Copy link
Member

hadley commented Jan 9, 2024

Yeah h2 is arguably more correct, but it’s too late to change now.

@hadley hadley closed this as completed Jan 9, 2024
@eitsupi
Copy link
Author

eitsupi commented Jan 9, 2024

Would you add an opt-in option to use h2 headers, as having multiple h1 headers may cause various tools to not work well.

@hadley
Copy link
Member

hadley commented Jan 9, 2024

This is going to be a bunch of work for us, so you'd need to provide compelling evidence that this is worth it.

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

No branches or pull requests

3 participants