kbodwin / demoR

(this package has been replaced by "flair")
https://kbodwin.github.io/flair/index.html
Other
47 stars 7 forks source link

Demo for chunks or inline expressions #9

Open emitanaka opened 5 years ago

emitanaka commented 5 years ago

It feels like this package will be a good place to have a function to have demo for chunks or inline expressions.

E.g. if I want to write

```{r}
summary(cars)
```'

(removing ' at the end) then it would render as:

summary(cars)

Similar with inline expression r mean(cars$dist) where there is a bit of an effort needed to show "`".

I've implemented some work around before but I always forget. I would feel that it would sit nicely with this package if you are interested!

kbodwin commented 5 years ago

Hi @emitanaka,

I'm not 100% sure I understand. Do you mean shortcuts for showing the chunk source code itself? For purposes of teaching how to use markdown and chunks?

For example, something like:

```{r plot, echo = TRUE, eval = FALSE}
plot(1:10)
demo_markdown("plot")
would render as
plot(1:10)


If this is what you mean, I think it would fit very nicely with `demoR`.  Thank you for the idea!  I'll see what I can do.
emitanaka commented 5 years ago

Yes that's what I mean! Thanks for considering it :)