-
Notifications
You must be signed in to change notification settings - Fork 1.3k
correcly get source files when rmd_files and rmd_subdir are provided #886
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
Conversation
so that rmd_files and rmd_subdir can be used together correcly
yihui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
rmd_filesANDrmd_subdirare provided, the files starting with_inside sub directories will not be ignored anymore
I think we should always ignore files starting with _, otherwise the logic sounds too complicated to explain to users and also complicates the implementation. Thank you!
…mes in `files` instead of hardcoding them later
Hello, This unfortunately breaks the recommendation of Thanks, |
|
@rickhelmus I don't see how it breaks the recommendation of pkgdown. The help page says:
So pkgdown also ignores files that start with |
|
Hi yihui, Thanks for your answer. I wasn't being really clear, sorry. I am actually already using one 'master' Rmd that includes several child documents. The problem is that I want to exclude this master document from Thanks, |
|
@rickhelmus Okay, now I see. Sorry about the trouble! Let me think more about it. |
|
Hi @rickhelmus , Just chiming in as I am trying to understand the interaction between pkgdown and bookdown in your usage.
As you are using pkgdown, I understand your working on a package. Then, I understand that you have a bookdown project inside your package that you store in the vignette folder but you don't want to get it rendered as article in your package doc website. Correct ? If you can provide a complete use case (maybe in a new issue) I am willing to dig into it to see what could be done on pkgdown or/and bookdown about this usage. However, @yihui seems to have a more clearer picture than mine though, so maybe this won't be necessary 😄 |
This fixes #885 and follows a series of features addition for
source_files(#561, #601) in the past.There was still an issue when
rmd_filesis provided withrmd_subdirdue to the following behavior:when
rmd_subdirwas provided, all the files from root dir and subdirs were selected.rmd_fileswas not able to filter out the desired root files.This PR will identify subdir files apart from root files if
rmd_subdiris provided, then ifrmd_filesis provided also, it will concatenatermd_fileswithrmd_subdircontent only, discarding any other root files content.This PR also add tests so that all the desired behavior are checked:
_)rmd_filesallows to select the root files and change default behaviorrmd_subdirallows to add some subdirs content - by default root filesrmd_subdir = TRUEwill get all the subdirs Rmd content.rmd_filesis not provided, the files starting with an underscore in subdirectories will also be ignored.rmd_filesallows to select the root files selected, in addition tormd_subdir, adding those with the subdir content.However, in this last case, there is one behavior which is currently happening and not sure it is desired: if
rmd_filesANDrmd_subdirare provided, the files starting with_inside sub directories will not be ignored anymore. Is this the desired behavior?I wonder if
_*.Rmdfiles should be always ignored in bookdown. Would be a change in default, but you just need to remove the_and usermd_filesif you want to include it in some casesWhat do you think ?