Skip to content

Update tidy eval template - #1445

Merged
jennybc merged 9 commits into
masterfrom
fix-tidy-eval-template
Sep 29, 2021
Merged

jennybc merged 9 commits into
masterfrom
fix-tidy-eval-template

Conversation

@lionel-

@lionel- lionel- commented May 10, 2021 •

Copy link
Copy Markdown
Member

Fixes r-lib/rlang#1008.

  • Remove more advanced helpers.
  • Mention modern syntax.
  • Add examples.

@lionel-

lionel- commented May 10, 2021

Copy link
Copy Markdown
Member Author

The {{ syntax conflicts with whiskers. Not sure how to solve this. Should we add an argument to use_template() to bypass render_template()?

@malcolmbarrett

Copy link
Copy Markdown
Collaborator

A trick that I've used to get around that is to treat {{ and }} like data, e.g. use {{{ curly_open }}} in the template, then data = list(curly_open = "{{") in use_template().

@jennybc jennybc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'll think about how to handle the clash between the content of this template and whisker. This template does not actually use whisker, so it's sort of sad that they are in tension.

Since the new template uses markdown syntax, I think use_tidy_eval() also needs to gain some logic to make sure the host package is using markdown with roxygen2.

Comment thread inst/templates/tidy-eval.R Resolved
Comment thread inst/templates/tidy-eval.R Resolved
Comment thread inst/templates/tidy-eval.R Resolved
Co-authored-by: Jennifer (Jenny) Bryan <[email protected]>
@lionel-

lionel- commented May 11, 2021

Copy link
Copy Markdown
Member Author

I'll think about how to handle the clash between the content of this template and whisker. This template does not actually use whisker, so it's sort of sad that they are in tension.

Thanks!

Since the new template uses markdown syntax, I think use_tidy_eval() also needs to gain some logic to make sure the host package is using markdown with roxygen2.

IIUC this is taken care of by the @md tag which enables markdown in single topic pages.

@jennybc

jennybc commented May 11, 2021

Copy link
Copy Markdown
Member

IIUC this is taken care of by the @md tag which enables markdown in single topic pages.

But I think the host package still needs to have Roxygen: list(markdown = TRUE) in DESCRIPTION, yeah?

@jennybc

jennybc commented Sep 29, 2021

Copy link
Copy Markdown
Member

Based on a small experiment, my concern about needing Roxygen: list(markdown = TRUE) doesn't seem to be warranted.

@jennybc
jennybc merged commit 8e21fdc into master Sep 29, 2021
@jennybc
jennybc deleted the fix-tidy-eval-template branch September 29, 2021 22:05
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.

Update use_tidy_eval() template

3 participants