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

Files generated by Rmd not copied to outputs #74

Closed
2 of 4 tasks
thibautjombart opened this issue Mar 1, 2021 · 4 comments
Closed
2 of 4 tasks

Files generated by Rmd not copied to outputs #74

thibautjombart opened this issue Mar 1, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@thibautjombart
Copy link
Collaborator

Please place an "x" in all the boxes that apply

  • I have the most recent version of reportfactory and R
  • I have found a bug
  • I have a reproducible example
  • I want to request a new feature

Files generated by a Rmd are not currently copied to the output folder, except for the main output (html by default). For instance, if one sets the following option to produce figures in a figures/ folder:

```{r setup, include=FALSE}
knitr::opts_chunk$set(
                      fig.path = "figures/")

Figures will be produced in report_sources/figures/ but not copied over.

@thibautjombart thibautjombart added the bug Something isn't working label Mar 1, 2021
@TimTaylor
Copy link
Contributor

Cheers. So I think we resolve this by snapshotting the sources folder before compiling reports and then again afterwards. The different files then get copied over. This does then render the current setup a little redundant so want to think about what the benefit is of combining the two approaches as opposed to just using the solution to this bug for everything.

@thibautjombart
Copy link
Collaborator Author

This was the old solution, aye, but it does pose the problem that if (spurious) files do exist prior to compilation, but are re-generated by the compilation, they will be overlooked when copying things over. Hence the cleaning procedure which removed non-Rmd files from report_sources/ in the old version, but this is a bit aggressive an option.

Maybe worth considering using file.info(...) or file.mtime(...) to get the list of files modified after compilation started, and define these as files to move? This means compile_reports() will not be parallelizable, but not a major hindrance I would think.

Thoughts?

@TimTaylor
Copy link
Contributor

Maybe but I'd be wary of using any file meta information in case something funny happens if people used synced folders etc etc. We could just copy the reports to the outputs folder and then compile in there. This would only be problematic if people referred to other data within report_sources but we can advise them not to do this. Relative links would work as outputs is at the same folder level as report_sources

TimTaylor added a commit that referenced this issue Mar 1, 2021
thibautjombart added a commit that referenced this issue Mar 3, 2021
@TimTaylor
Copy link
Contributor

closed by #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants