Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[FR] clean_duplicates with more control? #628

Closed
apreshill opened this issue May 26, 2021 · 1 comment · Fixed by #629
Closed

[FR] clean_duplicates with more control? #628

apreshill opened this issue May 26, 2021 · 1 comment · Fixed by #629

Comments

@apreshill
Copy link
Contributor

I love this function, but just noticed that in "full markdown mode"

options(
  # build .Rmd to .html (via Pandoc); to build to Markdown, set this option to 'markdown'
  blogdown.method = 'markdown'
)

When I use clean_duplicates, it is deleting all the md files in favor of html (as documented) because my source files are not .Rmarkdown. Would it be possible to add an argument here to keep = markdown or keep = html? Or perhaps it could read whether this option is present in the .Rprofile?

@cderv
Copy link
Collaborator

cderv commented May 26, 2021

Yes I think this function should be aware of blogdown.method to know what to do. So I would classify this has a bug from something we did not adapt when introducing markdown method.

blogdown/R/check.R

Lines 467 to 474 in 0cde6d6

clean_duplicates = function(preview = TRUE) in_root({
x = list_duplicates()
x1 = with_ext(x, 'Rmd'); i1 = file_exists(x1)
x2 = with_ext(x, 'Rmarkdown'); i2 = file_exists(x2)
# if .Rmd exists, delete .md; if .Rmd does not exist or .Rmarkdown exists,
# delete .html
x = c(with_ext(x[i1], 'md'), x[i2 | !i1])
x = x[file_exists(x)]

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants