AlexsLemonade / refinebio-examples

Example workflows for refine.bio data

Home Page:https://www.refine.bio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Control the width of output blocks

jashapiro opened this issue · comments

Sometimes we end up rendering output chunks that are wider than ideal. We should look into whether we can change that, perhaps setting the width for rendering at 60-70 characters. This is too narrow for most usage, but is more generally compatible with display on an html page.

Commenting on this change because it reminded me of something that we should look at, which is whether we can make the text output width a bit narrower. When rendered, these lines often end up wrapped, which is not ideal. We could partially solve this by making sure output blocks do not wrap in the html, but a better solution would be to actually control the width, if possible.

Originally posted by @jashapiro in #395 (comment)

Turns out, this is a bit uglier to deal with than we might like:

The main solution is to set options(width=60) or another value, but this has to be done in the document, which, ugh.

The main points are discussed here:
https://bookdown.org/yihui/rmarkdown-cookbook/text-width.html
from a tweet by Yihue Xie https://twitter.com/xieyihui/status/1334158473102307331?s=20

Some extra hacks for display are here:
https://github.com/hadley/adv-r/blob/master/common.R
via Hadley Wickham: https://twitter.com/hadleywickham/status/1334163848753000449?s=20

Closed (mostly?) by #402

There may be some blocks/functions that do not respect the width parameter but we may have to find those as part of #289