Skip to content

New function print_stan_file() for color formatted Stan code in quarto and R markdown - #1166

Merged
jgabry merged 4 commits into
masterfrom
print_stan_file
Mar 31, 2026
Merged

New function print_stan_file() for color formatted Stan code in quarto and R markdown#1166
jgabry merged 4 commits into
masterfrom
print_stan_file

Conversation

@avehtari

Copy link
Copy Markdown
Member

closes #1149

  • print_stan_file() is a helper function to make it easier to have color formatted Stan code in Quarto documents, especially when the Stan code is in a file.
  • In addition write_stan_file() was moved to file.R

Copyright and Licensing

Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):

Aki Vehtari

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

@avehtari
avehtari requested a review from jgabry March 29, 2026 11:07
Comment thread NAMESPACE Outdated
@codecov-commenter

codecov-commenter commented Mar 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.43590% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.87%. Comparing base (5809552) to head (ed63153).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
R/file.R 97.43% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1166      +/-   ##
==========================================
+ Coverage   90.85%   90.87%   +0.02%     
==========================================
  Files          14       15       +1     
  Lines        5924     5938      +14     
==========================================
+ Hits         5382     5396      +14     
  Misses        542      542              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jgabry

jgabry commented Mar 30, 2026

Copy link
Copy Markdown
Member

Thanks, looks like it's passing now. We can ignore the one Mac failure, there's an unrelated issue with r-devel right now.

@jgabry

jgabry commented Mar 30, 2026

Copy link
Copy Markdown
Member

Thanks, looks like it's passing now. We can ignore the one Mac failure, there's an unrelated issue with r-devel right now.

Actually there's a failure on windows when we use an older windows and R setup. I think it's because of the version of testthat that is used isn't compatible with some of the testthat code used in the new tests. I think I know how to fix it.

@jgabry jgabry changed the title add print_stan_file New function print_stan_file() for color formatted Stan code in quarto Mar 30, 2026
@jgabry jgabry changed the title New function print_stan_file() for color formatted Stan code in quarto New function print_stan_file() for color formatted Stan code in quarto and R markdown Mar 30, 2026

@jgabry jgabry 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.

Looks good. If my changes fixed the failing tests then we can merge this. If not then I'll look into it more.

@jgabry
jgabry merged commit 60c0dfa into master Mar 31, 2026
13 of 14 checks passed
@jgabry
jgabry deleted the print_stan_file branch March 31, 2026 01:14
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.

Function for printing color formatted Stan code in Quarto

3 participants