Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add epoxy_mustache() #103

Merged
merged 18 commits into from
Aug 5, 2023
Merged

Add epoxy_mustache() #103

merged 18 commits into from
Aug 5, 2023

Conversation

gadenbuie
Copy link
Owner

@gadenbuie gadenbuie commented Aug 5, 2023

Closes #91
Closes #92

# The canonical mustache example
epoxy_mustache(
  "Hello {{name}}!",
  "You have just won {{value}} dollars!",
  "{{#in_ca}}",
  "Well, {{taxed_value}} dollars, after taxes.",
  "{{/in_ca}}",
  .data = list(
    name = "Chris",
    value = 10000,
    taxed_value = 10000 - (10000 * 0.4),
    in_ca = TRUE
  )
)
#> Hello Chris!
#> You have just won 10000 dollars!
#> Well, 6000 dollars, after taxes.

# Vectorized over the rows of .data
epoxy_mustache(
    "mpg: {{ mpg }}",
    "hp: {{ hp }}",
    "wt: {{ wt }}\n",
    .data = mtcars[1:2, ]
)
#> mpg: 21
#> hp: 110
#> wt: 2.62
#> 
#> mpg: 21
#> hp: 110
#> wt: 2.875

@codecov-commenter
Copy link

codecov-commenter commented Aug 5, 2023

Codecov Report

Merging #103 (a4f820c) into main (985a74a) will increase coverage by 0.27%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
+ Coverage   95.43%   95.71%   +0.27%     
==========================================
  Files           8        9       +1     
  Lines         855      886      +31     
==========================================
+ Hits          816      848      +32     
+ Misses         39       38       -1     
Files Changed Coverage Δ
R/epoxy.R 94.25% <ø> (ø)
R/shiny.R 90.47% <ø> (ø)
R/engines.R 94.11% <100.00%> (+1.31%) ⬆️
R/epoxy_mustache.R 100.00% <100.00%> (ø)
R/utils.R 100.00% <100.00%> (ø)

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2023

📕 Preview documentation for this PR has been cleaned up.

@gadenbuie gadenbuie marked this pull request as ready for review August 5, 2023 13:09
@gadenbuie gadenbuie merged commit 089e6d8 into main Aug 5, 2023
@gadenbuie gadenbuie deleted the feat/epoxy_mustache branch August 5, 2023 18:30
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
2 participants