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

New Template in RStudio's New Project Wizard #128

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

Conversation

howardbaik
Copy link
Contributor

@howardbaik howardbaik commented May 10, 2024

Purpose/implementation Section

What changes are being implemented in this Pull Request?

Following this article on RStudio Project Templates, I added a Project Template to the RStudio "New Project" Wizard, as seen below:

Screenshot 2024-05-09 at 5 27 51 PM

What was your approach?

  • setup_project() is the "template function" that RStudio will invoke to instantiate a Quarto course template inside a freshly opened RStudio Session. It creates a directory in the path, copies all the boilerplate files into the path, and importantly, specifies the course title, course author, and repo URL in the _quarto.yml.
  • rstudio_project_template.dcf defines the user inputs in the RStudio "New Project Wizard".
  • All the other inst/style-sets/ files are boilerplate files included in Quarto-Based OTTR.

I've included 4 options for Style sets: FHDaSL, AnVIL, GDSCN, Custom. When user selects "Custom", they need to upload an image file of their logo.png, which will be placed in the left sidebar. All the other style sets include the respective logos and favicons.

What GitHub issue does your pull request address?

#127

Tell potential reviewers what kind of feedback you are soliciting.

What CSS elements am I missing in the 3 predefined style sets: FHDaSL, AnVIL, GDSCN?

@howardbaik howardbaik linked an issue May 10, 2024 that may be closed by this pull request
Copy link
Contributor

@cansavvy cansavvy left a comment

Choose a reason for hiding this comment

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

@howardbaek I'm really glad you pursued this idea of yours. This is gonna be great. I think there's a solid foundation of code here and now we just have to address some further development of how this should be implemented.

Take a look at these comments and questions and happy to chat about them more in a meeting if that would be helpful!

R/setup_project.R Outdated Show resolved Hide resolved
R/setup_project.R Outdated Show resolved Hide resolved
R/setup_project.R Show resolved Hide resolved
R/setup_project.R Outdated Show resolved Hide resolved
R/setup_project.R Show resolved Hide resolved
@@ -0,0 +1,25 @@
name: Delete Preview
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to create a bit of a maintenance problem for when these files are updated in the main template.

There's two solutions I can think of to help.

  1. Have the function download the files directly from the main OTTR repo: https://github.com/jhudsl/OTTR_Template/
  2. We can have it so the sync file syncs to this R package.

The only reason I find 2 slightly less good of a solution is that this means in order for people to get the updates we would have to update to CRAN and the user would have to update to the most recent ottrpal package version.

Whereas alternatively 1 will make sure people have the latest no matter the ottrpal package version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think there will be many updates to the main template and even if we do make any updates, users can fetch the updates by downloading the development version of ottrpal from GitHub.

The main template is https://github.com/fhdsl/ottr. It is not https://github.com/jhudsl/OTTR_Template/, since this function setups up the Quarto-based OTTR template, not the Rmd-based OTTR Template.

Copy link
Contributor

Choose a reason for hiding this comment

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

There will definitely be more updates to OTTR in the future. We should also probably have this try to work for both Rmds and Quarto if possible (but I know that's another lift).

Some of the files you are having it download are GHA which will definitely change because people's GHA that we are using deprecate overtime. I think downloading the files directly will be a more stable move but we can definitely brainstorm on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can do one step at a time. (no need to worry about this in this PR) But we will want to make maintenance a tad easier. Happy to talk more at length.

To reiterate I am VERY excited about the work you are doing here -- was not something even on my radar. So you should definitely give yourself a pat on the back for this work!

But we will have to figure out some details like maintenance, but I'm happy to help with this.

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 I'll setup a meeting with you to talk about this further.

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.

RStudio Project Template
2 participants