Comments (1)
This is basically fixed now. I think it's "good enough" anyway.
The srcref approach to turning expression into a string was a big improvement. Remaining whitespace problems are handled by stripping it and letting formatR tidy the code. So to get the best result with code that comes via expression, make sure formatR is installed.
Demo of where things stand now. This call, with nutty leading whitespace:
reprex({
#' ## Hey I'm a heading
(x <- 1:4)
#' blah blah
y <- 2:5
#' The next chunk will not be evaluated.
#+ eval = FALSE
x + y
#' Let's add x and y after all.
#+
x + y
})
now gives markdown that renders like so now:
Hey I'm a heading
(x <- 1:4)
#> [1] 1 2 3 4
blah blah
y <- 2:5
The next chunk will not be evaluated.
x + y
Let's add x and y after all.
x + y
#> [1] 3 5 7 9
from reprex.
Related Issues (20)
- Error in xfun::normalize_path() : unused argument (resolve_symlink = FALSE) HOT 2
- reprex:::reprex_addin() on posit cloud does not show the preview HOT 1
- Take advantage of some backtrace improvements HOT 3
- Running in non-interactive mode using the `input` argument seems to use an existing `<input>_reprex.R` HOT 2
- Reprex v2.0.2 does not print all columns of bench::mark() HOT 1
- Upkeep for reprex
- Reprex skipping some statements (these should cause an error) HOT 2
- Add wd panel to Rstudio Addins Menu HOT 1
- Error in `reprex_render_impl()` HOT 3
- Unable to generate a reprex due to possibly clipboard or file connection issue HOT 2
- Question: Does `{reprex}` support MS Teams? HOT 4
- Error in reprex_render_impl() HOT 1
- Don't show the full backtrace HOT 1
- Output when following documentation instructions does not match expected result HOT 2
- Release reprex 2.1.0
- Enhance `would_clobber()` with more help getting rid of the offending file
- Error in read_xml.raw(res) : Start tag expected, '<' not found [4] HOT 4
- Warning exists when `reprex(... style = FALSE)` HOT 3
- `reprex()` no longer working after updating to R 4.4.0? HOT 3
- Code/output blocks are split HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reprex.