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

Amend vignette-name rule for "Get Started"? #1166

Closed
ijlyttle opened this issue Oct 17, 2019 · 8 comments
Closed

Amend vignette-name rule for "Get Started"? #1166

ijlyttle opened this issue Oct 17, 2019 · 8 comments
Labels
articles ✍️ feature a feature request or enhancement navbar 🗺️

Comments

@ijlyttle
Copy link
Contributor

ijlyttle commented Oct 17, 2019

This question was spurred by this vignette naming discussion at r-lib/usethis#830 - the gist was:

If a package name has a dot, e.g. acme.data, we cannot have a vignette with the same name because vignette names cannot contain dots. The motivation was to have a "Get Started" article on a pkgdown site.

As far as I know, the dot is the only legal delimiter character (non alphanumeric) in a package name.

To get around this, could the pkgdown rule be amended to "strip" any dots from package names?

This way, a package acme.data could have a pkgdown "Get Started" vignette named acmedata.Rmd.

Here's (what I think is) the operative line:

pkg_intro <- vignettes$name == pkg$package

Could something like this be useful?

# strip dots to allow matching for packages with dots in the name
pkg_intro <- vignettes$name == gsub("[.]", "", pkg$package) 

If so, happy to make a PR. Thanks!

@hadley
Copy link
Member

hadley commented Mar 10, 2020

Yes, that sounds reasonable, and a PR would be helpful, thanks!

@hadley hadley added articles ✍️ feature a feature request or enhancement navbar 🗺️ labels Mar 10, 2020
@maelle
Copy link
Collaborator

maelle commented Mar 21, 2020

A related question/feature request (hence my asking here): could the "Get started" rule also apply to article names i.e. if there's a non-vignette article called pkg.Rmd, could it be detected?

@hadley
Copy link
Member

hadley commented Mar 21, 2020

@maelle from a quick look at the code, I think should already be the case? Specifically, how is your article not a vignette?

@maelle
Copy link
Collaborator

maelle commented Mar 21, 2020

Sorry if I'm missing something. It's under vignettes/articles (website)

@maelle
Copy link
Collaborator

maelle commented Mar 21, 2020

I'm now also wondering whether it'd make sense to have these live under articles/filename.html instead of articles/articles/filename.html. 🤔 but this is getting off topic for this issue. For info I used usethis::use_article().

@hadley
Copy link
Member

hadley commented Mar 22, 2020

Oh now I remembered; the vignette "name" includes the path, so you get article/packagename which doesn't match.

@hadley hadley closed this as completed in d58ec20 Mar 22, 2020
@maelle
Copy link
Collaborator

maelle commented Mar 22, 2020

Thank you 😺

@k-tatgenhorst
Copy link

As I am researching another naming issue for vignettes I stumbled on this. I can see how this solution could lead to naming collisions: acme.data could some perhaps later create an acmedata package?
Just a thought, I see this is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
articles ✍️ feature a feature request or enhancement navbar 🗺️
Projects
None yet
Development

No branches or pull requests

4 participants