Adds :displaysize
as chunk option and chunks now correctly respect displaysize
#433
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
AFAIK there's not a good way of setting the
displaysize
forIO
instances in Weave.jl. In particular this leads to issues when outputting tables, e.g. #200. The issue is made more confusing by the fact that we have a:line_width
chunk option which specifies the number of columns before we wrap the lines, not truncate, and so even if you try to dowithin a notebook, you still end up with wrapped output even though now the truncation is okay.
So, this PR makes the following changes:
displaysize
. This is equivalent to the current behavior since as of right now we simply set:limit => true
and thus implicitly:displaysize => displaysize()
introduced in limit display: #311.displaysize
as a chunk option. This addresses all the annoyances with truncated tables, etc. + naturally follows the same behavior as you'd expect fromIO
.wrap
by default since it's utility is somewhat limited due to the limit display: #311 + the default value of:line_width
is actually lower than the defaultdisplaysize()[2]
(which is80
), hence we end up wrapping lines that "shouldn't" be wrapped according to default settings in Julia (most other packages will display according todisplaysize
so most outputs will take advantage of 80 cols if need be).I'll add docs too once I get the thumbs up that this is a good idea from ya'll :)EDIT: Added tests.