Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rstudio's code_folding: hide #11

Closed
RCura opened this issue Mar 29, 2016 · 12 comments
Closed

Add rstudio's code_folding: hide #11

RCura opened this issue Mar 29, 2016 · 12 comments
Assignees

Comments

@RCura
Copy link

RCura commented Mar 29, 2016

Would be very usefulo to have code_folding as a generic argument (like here), be it with rstudio's templates or with yours.
In particular, I feel like it would really fit well with readthedown for a tutorial.

@juba
Copy link
Owner

juba commented Mar 29, 2016

You're right, that would definitely be useful. I'm a bit busy these days, but I think I could take a look at it next week.

Thanks for the suggestion.

@juba juba self-assigned this Mar 29, 2016
@juba
Copy link
Owner

juba commented Aug 29, 2016

This took far too long, but the all HTML templates should now support both code folding and tabsets in the same way RStudio's HTML template does.

Thanks for the suggestion, and sorry for the delay...

@juba juba closed this as completed Aug 29, 2016
@RCura
Copy link
Author

RCura commented Aug 29, 2016

Thanks for this enhancement :)
Just tried though, with code_folding: hide : I can see the Code button, but clicking on it does nothing.


> ---
> title: ""
> date: "`r Sys.Date()`"
> output:
>   rmdformats::readthedown:
>     highlight: kate
>     code_folding: hide
> ---
> 
> 
> ```{r knitr_init, echo=FALSE, cache=FALSE}
> library(knitr)
> library(rmdformats)
> 
> ## Global options
> options(max.print="75")
> opts_chunk$set(echo=FALSE,
>                cache=TRUE,
>                prompt=FALSE,
>                tidy=TRUE,
>                comment=NA,
>                message=FALSE,
>                warning=FALSE)
> opts_knit$set(width=75)
> ```
> 
> Test 123
> 
> ```{r blob}
> 1 + 1
> ```

Displays :
capture du 2016-08-29 15-21-54

@juba juba reopened this Aug 29, 2016
@juba
Copy link
Owner

juba commented Aug 29, 2016

I think it' because there's the global echo = FALSE option, so R code is not generated at all. If you switch it to TRUE in the knitr_init chunk, does it work ?

@RCura
Copy link
Author

RCura commented Aug 29, 2016

Same problem I had in my real document : each code button appears (not only the general one with a down arrow), but clicking on these still does nothing.

@RCura
Copy link
Author

RCura commented Aug 29, 2016

(Note that I tried this with opening the resulting html in a browser (Chromium & Firefox), but also using an http-server to make sure it's not a "static" problem.)

@juba
Copy link
Owner

juba commented Aug 29, 2016

An do you get the Bootstrap's JavaScript requires JQuery error each time ? Could you copy/paste somewhere the resulting HTML file from your first minimal example ?

@juba
Copy link
Owner

juba commented Aug 29, 2016

Ah, and what version of rmarkdown do you use ?

@RCura
Copy link
Author

RCura commented Aug 29, 2016

@juba
Copy link
Owner

juba commented Aug 29, 2016

Ok, it seems rmarkdown doesn't include jQuery in your file, so I added back the explicit dependency declaration in e551158. Does it solve the problem ?

@RCura
Copy link
Author

RCura commented Aug 29, 2016

Yes, working perfectly now, a big thanks ;)

@juba
Copy link
Owner

juba commented Aug 29, 2016

Thanks to you for your time and your feedback !

@juba juba closed this as completed Aug 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants