Skip to content

Add create_quarto_project() #2045

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

focardozom
Copy link

@focardozom focardozom commented Aug 15, 2024

Closes #1891

quarto::quarto_create_project() does not set a new directory; it only creates a folder containing the _qmd and .qmd files. I’m not sure if usethis should be used to set the new directory and restar the session as in create_project(). This PR evolved into making this more like the other create_*() functions.

#' * `create_project()` creates a non-package project, i.e. a data analysis
#' project
#' project.
#' * `r lifecycle::badge("experimental")` `create_quarto_project()` creates a
Copy link
Member

@jennybc jennybc Jul 23, 2025

Choose a reason for hiding this comment

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

I'm marking this as experimental because, e.g., the behaviour when called inside an existing project is not so nice (mostly a limitation rooted in the quarto cli when called like this). I've also exposed the bare minimum of arguments. I want to make it clear that this might very well need some refinement.

Comment on lines +28 to +31
#' If `FALSE`, the goal is to ensure that the directory can be recognized as
#' a project by, for example, the [here](https://here.r-lib.org) package. If
#' the project is neither an R package nor a Quarto project, a sentinel
#' `.here` file is placed to mark the project root.
Copy link
Member

Choose a reason for hiding this comment

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

This is mildly aspirational. I have only recently added rprojroot::is_quarto_project to usethis's project-finding criteria and I have a PR in flight to have the here package do the same: r-lib/here#130. But I think this will hopefully be true soon anough.

#' project.
#' * `r lifecycle::badge("experimental")` `create_quarto_project()` creates a
#' Quarto project. It is a simplified convenience wrapper around
#' `quarto::quarto_create_project()`, which you should call directly for
Copy link
Member

Choose a reason for hiding this comment

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

I can't actually link to quarto::quarto_create_project() because quarto is only in Suggests.

@jennybc jennybc requested a review from cderv July 23, 2025 21:18
@jennybc
Copy link
Member

jennybc commented Jul 23, 2025

@focardozom Will you take this for a test drive and see if it feels right?

- a `_quarto.yml` file, typical of a Quarto project
- an `renv.lock` file, which renv creates

* `create_quarto_project()` is a new experimental function that combines basic
usage of `quarto::quarto_create_project()` with some of the niceties of
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 putting quarto::quarto_create_project() inside the usethis::create_*() envelope is the main contribution here. E.g. challenging a project-within-a-project and opening / switching to the newly created Quarto project.

@jennybc jennybc changed the title Add quarto::quarto_create_project Add create_quarto_project() Jul 23, 2025
@jennybc jennybc requested a review from hadley July 23, 2025 21:27
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.

Add create_quarto_project or support Quarto-related parameters in create_project
2 participants