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

Incorrect function links from homepage/changelog #2128

Closed
markfairbanks opened this issue Jun 14, 2022 · 11 comments
Closed

Incorrect function links from homepage/changelog #2128

markfairbanks opened this issue Jun 14, 2022 · 11 comments

Comments

@markfairbanks
Copy link

If you click a function link from my package homepage/changelog it has an incorrect link. If you go through the reference page the links work.

From homepage: https://markfairbanks.github.io/tidytable/reference/select..Rd.html
From reference: https://markfairbanks.github.io/tidytable/reference/select..html

I've tried rebuilding the site and the same issue occurs.

@hadley
Copy link
Member

hadley commented Jun 14, 2022

Probably something going wrong with extension stripping, given the topic name ends in .

@markfairbanks
Copy link
Author

markfairbanks commented Jun 16, 2022

FYI this is a semi-recent thing. I'm not sure exactly the timeline, but it was working just fine for a couple years. I think this popped up sometime in the past few months.

@hadley
Copy link
Member

hadley commented Jun 16, 2022

Hmmm, the topic index looks ok:

 > pkgdown::as_pkgdown()$topics[1:5]
# A tibble: 72 × 5
   name            file_in            file_out             alias        funs        
   <chr>           <chr>              <chr>                <named list> <named list>
 1 across.         across..Rd         across..html         <chr [1]>    <chr [1]>   
 2 add_count.      add_count..Rd      add_count..html      <chr [1]>    <chr [1]>   
 3 arrange.        arrange..Rd        arrange..html        <chr [1]>    <chr [1]>   
 4 arrange_across. arrange_across..Rd arrange_across..html <chr [1]>    <chr [1]>   
 5 as_tidytable    as_tidytable.Rd    as_tidytable.html    <chr [1]>    <chr [1]>   
 6 between.        between..Rd        between..html        <chr [1]>    <chr [1]>   
 7 bind_cols.      bind_cols..Rd      bind_cols..html      <chr [2]>    <chr [2]>   
 8 c_across.       c_across..Rd       c_across..html       <chr [1]>    <chr [1]>   
 9 case.           case..Rd           case..html           <chr [1]>    <chr [1]>   
10 case_when.      case_when..Rd      case_when..html      <chr [1]>    <chr [1]>   

So it must be something downstream.

@hadley
Copy link
Member

hadley commented Jun 16, 2022

But I can't reproduce if I pkgdown::build_home() on tidytable locally.

@markfairbanks
Copy link
Author

Hmm that's odd. It still doesn't work correctly if I use build_home().

@hadley
Copy link
Member

hadley commented Jun 16, 2022

@markfairbanks does the topic index (see my code above) have the correct file_out names?

@markfairbanks
Copy link
Author

Looks like it does.

# A tibble: 72 × 5
   name            file_in            file_out             alias        funs        
   <chr>           <chr>              <chr>                <named list> <named list>
 1 across.         across..Rd         across..html         <chr [1]>    <chr [1]>   
 2 add_count.      add_count..Rd      add_count..html      <chr [1]>    <chr [1]>   
 3 arrange.        arrange..Rd        arrange..html        <chr [1]>    <chr [1]>   
 4 arrange_across. arrange_across..Rd arrange_across..html <chr [1]>    <chr [1]>   
 5 as_tidytable    as_tidytable.Rd    as_tidytable.html    <chr [1]>    <chr [1]>   
 6 between.        between..Rd        between..html        <chr [1]>    <chr [1]>   
 7 bind_cols.      bind_cols..Rd      bind_cols..html      <chr [2]>    <chr [2]>   
 8 c_across.       c_across..Rd       c_across..html       <chr [1]>    <chr [1]>   
 9 case.           case..Rd           case..html           <chr [1]>    <chr [1]>   
10 case_when.      case_when..Rd      case_when..html      <chr [1]>    <chr [1]>   
# … with 62 more rows

@hadley
Copy link
Member

hadley commented Jun 16, 2022

Ok, I'm now starting to remember how all this works and I can reprex the problem with:

pkgdown:::local_options_link(pkgdown::as_pkgdown("."), 0)
downlit::autolink_url("tidytable::across.()")

@hadley
Copy link
Member

hadley commented Jun 16, 2022

@hadley
Copy link
Member

hadley commented Jun 16, 2022

@hadley
Copy link
Member

hadley commented Jun 16, 2022

The root cause is this:

fs::path_ext_remove("across..Rd")
#> [1] "across..Rd"

Created on 2022-06-16 by the reprex package (v2.0.1)

Can probably just replace with gsub("\\.Rd$", "", topics$file_in).

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

2 participants