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

Allow topics from other packages in reference index #1664

Merged
merged 44 commits into from
Sep 1, 2021
Merged

Conversation

maelle
Copy link
Collaborator

@maelle maelle commented May 4, 2021

Fix #1251
Fix #1351

@maelle
Copy link
Collaborator Author

maelle commented May 4, 2021

Notes: simplify, no need to rebuild topics.

R/topics.R Outdated Show resolved Hide resolved
R/topics.R Outdated Show resolved Hide resolved
pkgdown/_pkgdown.yml Outdated Show resolved Hide resolved
@maelle maelle marked this pull request as ready for review May 14, 2021 08:50
@maelle maelle requested a review from hadley May 14, 2021 08:50
R/topics.R Outdated Show resolved Hide resolved
R/topics.R Show resolved Hide resolved
R/topics.R Outdated Show resolved Hide resolved
@maelle maelle requested a review from hadley May 24, 2021 10:10
R/build-reference-index.R Outdated Show resolved Hide resolved
R/topics.R Outdated Show resolved Hide resolved
R/topics.R Outdated Show resolved Hide resolved
R/topics.R Outdated
Comment on lines 209 to 214
db <- tools::Rd_db(names[1])
Rd <- db[[rd_name]]
# adapted from printr
# https://github.com/yihui/printr/blob/0267c36f49e92bd99e5434f695f80b417d14e090/R/help.R#L69
sections <- sub('^\\\\', '', unlist(lapply(Rd, attr, 'Rd_tag')))
title <- as.character(Rd[sections == "title"][[1]])
Copy link
Member

Choose a reason for hiding this comment

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

Pull this out into a separate named function just to clarify the purpose.

@yihui can you please confirm that it's ok for us to use your GPL licensed code in our MIT licensed package?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you!

However I am now extremely embarrassed to have at last remembered where else code for parsing Rd files lives... in pkgdown itself! 🤦‍♀️ 🙈

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Still using a bit of printr logic though, for finding the Rd.

R/topics.R Show resolved Hide resolved
pkgdown/_pkgdown.yml Outdated Show resolved Hide resolved
R/topics.R Outdated Show resolved Hide resolved
R/topics.R Outdated Show resolved Hide resolved
R/topics.R Show resolved Hide resolved
@maelle maelle requested a review from hadley June 3, 2021 11:21
R/build-reference-index.R Outdated Show resolved Hide resolved
R/build-reference-index.R Outdated Show resolved Hide resolved
R/build-reference-index.R Outdated Show resolved Hide resolved
R/build-reference-index.R Outdated Show resolved Hide resolved
R/topics.R Outdated Show resolved Hide resolved
R/topics.R Outdated Show resolved Hide resolved
R/topics.R Show resolved Hide resolved
tests/testthat/_snaps/build-reference-index.md Outdated Show resolved Hide resolved
@maelle maelle requested a review from hadley June 18, 2021 13:48
NEWS.md Outdated
@@ -1,5 +1,9 @@
# pkgdown (development version)

* `build_reference()` now allows linking to topics from other packages (either function names e.g. `rlang::is_installed` or topic names e.g. `sass::font_face`). (#1664)

* New template option `trailing_slash_redirect` that allows adding a script to redirect `your-package-url.com` to `your-package-url.com/`. (#1439, @cderv, @apreshill)
Copy link
Member

Choose a reason for hiding this comment

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

Is this supposed to be in here?

@maelle maelle changed the title Topics from other packages Allow topics from other packages in reference index Sep 1, 2021
@maelle maelle merged commit 705ff7c into master Sep 1, 2021
@maelle maelle deleted the topics-other-pkgs branch September 1, 2021 13:49
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 this pull request may close these issues.

build_reference will fail if a function is named N Allow topics from another R package
3 participants