posit-dev / posit-dev/positron
RMarkdown: Rendering should not depend on the Terminal width
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 206
Description
Related to https://github.com/posit-dev/positron/issues/1421
For some currently unknown reason, Render Document with R Markdown relies on the current Terminal width
This is extremely unexpected, and is different from RStudio where clicking the Knit button works the same no matter what in terms of width.
When rendering, the width should be a fixed constant for reproducibility purposes. I consider the fact that it currently is not to be a bug rather than a feature request.
We should try to figure out what RStudio does here, possibly it fixes the width that the R session sees?
See also https://github.com/r-lib/cli/blob/cbb3424f296f58822629487a729d5d987a91104b/R/width.R#L104
https://github.com/user-attachments/assets/d641df52-5986-4057-9cfd-bcbcf32dfbba
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce Render Document with R Markdown at different Terminal widths and inspect the rendering path and the width seen by the R session. Compare the behavior with RStudio and review the referenced cli width.R implementation. Done means rendering uses a fixed width and produces the same output regardless of Terminal width.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, r, typescript
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100