Skip to content

Fix #2232: Trace chunk location in progress bar #2250

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

Merged
merged 4 commits into from
Apr 25, 2023
Merged

Conversation

zeehio
Copy link
Contributor

@zeehio zeehio commented Apr 20, 2023

On #2232 we discussed a minor inconsistency in chunk names between RStudio and knitr. @yihui suggested to change the progress bar when knitting, so it shows the chunk name and the line number.

Here I do that and I add as well the file name, so we know precisely the location of the chunk even when having child documents. This is how the progress bar now looks with this pull request. Notice that the label in the progress bar includes chunk name @ file name : line -range.

imatge

Download if you like the parent and child Rmd used to create the screenshot: test-rmd-with-child.zip

  • We avoid breaking cache because it's just a display change (not a change in chunk labels or counting)
  • It handles child documents correctly
  • Most compilers use the colon (:) to separate file name from the line number when reporting errors, I thought that would be a good design pattern to copy.

Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

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

Are you okay with making this feature optional? e.g., show the line numbers only when options(knitr.progress.linenums = TRUE). Thanks!

@zeehio
Copy link
Contributor Author

zeehio commented Apr 20, 2023

Are you okay with making this feature optional? e.g., show the line numbers only when options(knitr.progress.linenums = TRUE). Thanks!

Sure, I guess you would like the default to be FALSE, right?

@yihui
Copy link
Owner

yihui commented Apr 20, 2023

Right (getOption('knitr.progress.linenums', FALSE)).

@zeehio
Copy link
Contributor Author

zeehio commented Apr 25, 2023

Hi :-)

options(knitr.progress.linenums = TRUE) is implemented and all conflicts due to NEWS entries have been resolved

Feel free to tell me if there is any other suggestion.

Thanks!

Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

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

Great. Thank you!

@yihui yihui merged commit a0dfe2b into yihui:master Apr 25, 2023
@zeehio zeehio deleted the fix-2232 branch April 25, 2023 18:06
yihui added a commit to yihui/yihui.org that referenced this pull request May 16, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants