Skip to content

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Sep 23, 2020

This will close #1903

Once merged we could use it in other packages like bookdown and pagedown

@cderv cderv requested a review from yihui September 23, 2020 15:41
Copy link
Contributor

@yihui yihui left a comment

Choose a reason for hiding this comment

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

Looks good overall. Thanks!

cderv and others added 3 commits September 24, 2020 09:17
@cderv cderv requested a review from yihui September 24, 2020 13:06
@cderv
Copy link
Collaborator Author

cderv commented Sep 29, 2020

Review was taken into account and test is passing. I'll merge. You can modify if I missed anything.

I'll be porting this to other packages using lua filter

@cderv cderv merged commit 8824c26 into rstudio:master Sep 29, 2020
@cderv cderv deleted the export-lua-fun branch September 29, 2020 13:31
@yihui
Copy link
Contributor

yihui commented Sep 29, 2020

Sounds good. Thanks!

@cderv
Copy link
Collaborator Author

cderv commented Sep 29, 2020

So at the end, this is not as useful as I thought because it won't work as expected in another package development workflow.

  • It work well from inside rmarkdown package, because devtools::load_all will add a shim for system.files
  • but this shim does not apply when system.files is used in another function from a package. That means using rmarkdown::pkg_file_lua inside bookdown will not allow to use the system.file shim. That means, when doing load_all on bookdown, it won't find the lua files. You need to install the development package first!

It is a bit annoying while developping and you are used to devtools workflow. testthat is using load_all also. So test won't work with this function.

However, if you use last version of testit no issue... because it install the package before testing 😉

Anyway, I note this here so that we don't forget what happens. I don't know if the shims in pkgload could work differently - I'll may open an issue there.

yihui added a commit that referenced this pull request Sep 29, 2020
yihui added a commit to cderv/bookdown that referenced this pull request Oct 12, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export pkg_file_lua and promote common organisation of lua filters in packages

2 participants