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

Closes #392

@jayhesselberth
Copy link
Contributor Author

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

Copy link
Member

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah pkgdown takes:

destination: docs

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

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

Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

@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

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@hadley
Copy link
Member

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
@hadley
Copy link
Member

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
Development

Successfully merging this pull request may close these issues.

None yet

4 participants