-
-
Notifications
You must be signed in to change notification settings - Fork 878
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
Include travis folding markers #1654
Comments
There is in fact some helper function in another package from @yihui called crandalf. There is |
There is now a PR where this is working but folding is very slow when travis rendered it. I was wondering if it could not be better to deactivate some logging, to show only what it is interesting. There is the quiet argument that completely deactivate printing. not sure if warning or error are passed. knitr's option Does the slow JS rendering is an issue ? I find it very annoying when loading the page. I also found out that travis a 10000 max lines policy and if above it will not print more and one should use raw log. Folding does not reduce this count. So, for a big book with bookdown, with all the printing, 10000 could be reached. Right now it is 9000+. Reducing the log output could be interesting. |
Yeah, it looks like the travis folding is now where near as useful as I'd hoped — it's better with the folding than without, but it's not a terribly big improvement. I agree that we'll need greater changes to the logging to make it more effective. In an ideal world, I think we'd only log when something goes wrong, but that's likely to require much greater changes to knitr. |
I recalled that knitr can write ouput message, error and warning to R console instead of the document, with the correct options set. In addition of Is there something else you would like to consult in bookdown rendering log ouput ? I tried to deactivate only the progress bar, but I did not manage that. Seems like |
That looks like a big improvement! Is it possible to get the warnings inside the folds too? |
I am looking into that. I think the folding should not be included in knitr but in rmarkdown or even bookdown for that. |
I think @cderv is correct: to fold all messages, this has to be implemented in the higher-level packages such as bookdown. |
Ok. So this is what we can get if we put the folding feature in bookdown: I think it is a pretty good result. Here, book is rendered with The only thing indicating if a fold is empty or not, in the line numbers on the left. @hadley is that closer to what you had in mind ? |
@cderv given the massive reduction in output, folding no longer seems necessary. However if I use |
There is a few things I did in my previous example in addition of
Currently, style guide is in "Merge and Knit" approach (the default), so one file only in rendered. With For the example, I added a dummy chunk with a warning in
If the fold are not required, we could forget about the travis folding markers and just
If we want another behavior about how things are logged, this may need more changes in knitr, rmarkdown or bookdown. There is an option |
Closing this issue for now (happy to revisit if still needed). |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
When building large or many rmarkdown files on travis (e.g. https://travis-ci.org/hadley/adv-r/jobs/476364254), it is hard to find problems because the log file is thousands of lines long. Travis provides a way to handle this through folding markers (these are undocumented but used by all build systems so can not change).
I think it would be very useful if knitr detected that it was being called in travis (by checking the TRAVIS env var), and inserting the folding comments at the start and end of each document.
The text was updated successfully, but these errors were encountered: