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

Reinstate macro loading #2782

Closed
jayhesselberth opened this issue Sep 18, 2024 · 2 comments · Fixed by #2783
Closed

Reinstate macro loading #2782

jayhesselberth opened this issue Sep 18, 2024 · 2 comments · Fixed by #2783

Comments

@jayhesselberth
Copy link
Collaborator

jayhesselberth commented Sep 18, 2024

This code was accidentally removed from rd_file() in #2759 :

macros <- tools::loadPkgRdMacros(pkg_path)
set_classes(tools::parse_Rd(path, macros = macros, encoding = "UTF-8"))

Should create a dummy macro for testing purposes?

 rd_file <- function(path, pkg_path = NULL) {
-  if (getRversion() >= "3.4.0") {
-    macros <- tools::loadPkgRdMacros(pkg_path)
-    set_classes(tools::parse_Rd(path, macros = macros, encoding = "UTF-8"))
-  } else if (getRversion() >= "3.2.0") {
-    macros <- tools::loadPkgRdMacros(pkg_path, TRUE)
-    set_classes(tools::parse_Rd(path, macros = macros, encoding = "UTF-8"))
-  } else {
-    set_classes(tools::parse_Rd(path, encoding = "UTF-8"))
-  }
+  set_classes(tools::parse_Rd(path, encoding = "UTF-8"))
 }

Originally posted by @bastistician in #2759 (comment)

@jayhesselberth
Copy link
Collaborator Author

@bastistician can you install dev pkgdown and confirm that macros work? Thanks.

@bastistician
Copy link
Contributor

I had already tried a patched version locally where I simply restored just the original >= "3.4.0" branch and that worked as expected. You seem to have done the same so it should be ok.

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