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

Make use_pkgdown configurable #467

Merged
merged 9 commits into from Nov 29, 2018
Merged

Conversation

@jayhesselberth
Copy link
Contributor

@jayhesselberth jayhesselberth commented Sep 26, 2018

Closes #392

@jayhesselberth
Copy link
Contributor Author

@jayhesselberth jayhesselberth commented Sep 26, 2018

build_dir could also be dst_path, which is what pkgdown uses.

krlmlr
krlmlr approved these changes Sep 26, 2018
Copy link
Member

@krlmlr krlmlr left a comment

Thanks! Do you want to elaborate on cases when the user might wish to change the default, perhaps just point to the pkgdown documentation web site?

R/pkgdown.R Outdated
#'
#' @export
use_pkgdown <- function() {
use_pkgdown <- function(config_file = "_pkgdown.yml", dst_path = "docs") {
Copy link
Member

@hadley hadley Nov 24, 2018

If the user sets dst_path should it be reflected in the generated pkgdown.yml file?

Copy link
Contributor Author

@jayhesselberth jayhesselberth Nov 25, 2018

Do you mean that pkgdown.yml should define the output path?

dst_dir: docs

Would we need a corresponding change in pkgdown?

Copy link
Member

@hadley hadley Nov 25, 2018

Don't we already have that? Or am I misremembering?

Copy link
Contributor Author

@jayhesselberth jayhesselberth Nov 25, 2018

Yeah pkgdown takes:

destination: docs

So we'd need to write that line into the created _pkgdown.yml file.

Copy link
Contributor Author

@jayhesselberth jayhesselberth Nov 25, 2018

What's the recommended way to modify this file? Something like:

cat(paste("destination:", dst_dir), file = config_file)

Copy link
Member

@jennybc jennybc Nov 26, 2018

Although it means something different, other functions in usethis this have a destdir argument FWIW (create_*(), use_course()).

Copy link
Member

@hadley hadley Nov 26, 2018

@jayhesselberth I think we can assume that this function creates the file, so you can use write_over()

And make the argument either destination (to match pkgdown) or destdir (to match usethis). (I don't have strong feelings which)

R/pkgdown.R Outdated

use_directory("docs", ignore = TRUE)
use_directory(dst_path, ignore = TRUE)
Copy link
Member

@hadley hadley Nov 24, 2018

I think we should probably build ignore the docs directory, but not create it. That would also fix #495

Copy link
Contributor Author

@jayhesselberth jayhesselberth Nov 25, 2018

Fixed.

@hadley
Copy link
Member

@hadley hadley commented Nov 28, 2018

Can you please add a bullet to NEWS? It should briefly describe the change and end with (@yourname, #issuenumber).

(And looks like the docs need an update)

@hadley hadley merged commit d48f8e2 into r-lib:master Nov 29, 2018
0 of 2 checks passed
@hadley
Copy link
Member

@hadley hadley commented Nov 29, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants