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

generalize code_folding of html_document #1835

Merged
merged 11 commits into from
Jun 18, 2020

Conversation

atusy
Copy link
Collaborator

@atusy atusy commented Jun 2, 2020

This PR generalize code_folding by allowing any engines.
A downside is that turning on and off the code_folding invalidates chunk cache.
However, I think it is affordable because users do not change this option frequently.

@atusy
Copy link
Collaborator Author

atusy commented Jun 14, 2020

Note that this will also fix #1603

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart idea!

I'm not concerned about the cache issue. My main concern is the intermediate Markdown output. This will change the previous

```r

to

```{.r .foldable}

I'm not sure if people would like this change.

That said, I'm totally happy if we add pre.foldable to the existing list (instead of replacing it) in codefolding.js. Then you can turn on the foldable class (via the option hook) by yourself if you are okay with the above change I mentioned.

Thank you!

@atusy
Copy link
Collaborator Author

atusy commented Jun 18, 2020

@yihui

Your suggestion sounds reasonable, and is reflected.
Thank you!!

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Thanks!

@yihui yihui merged commit f615a3e into rstudio:master Jun 18, 2020
jonathan-g added a commit to jonathan-g/rmarkdown that referenced this pull request Jul 7, 2020
* rstudio/master: (61 commits)
  make metadata available before running pre_knit (rstudio#1855)
  fix rstudio#1815: apply the lua filters pagebreak.lua and latex-div.lua to beamer_presentation
  require the data-latex attribute on fenced Div's again: rstudio#1779 (comment)
  start the next version
  CRAN release v2.3
  fold any code blocks with the class `foldable` for html_document output (rstudio#1835)
  fix rstudio#1828: add aria-hidden = "true" to empty <a> tags in highlighted code blocks generated by Pandoc to improve screen reader accessibility (rstudio#1833)
  add a news item for rstudio#1832
  roxygenize
  no need to turn on --file-scope or actually write the split content into files if the split content is of length < 2
  eliminate renumber_footnotes option
  only test two pandoc versions (devel and RStudio version) and upgrade default to 2.7.3 (rstudio#1846)
  close rstudio#1838: test more R versions on Travis (rstudio#1845)
  renumber_footnotes output format option
  add the <div class="kable-table"> only when the output format is HTML, otherwise the div will be converted to a LaTeX environment, leading to the bug https://stackoverflow.com/q/62340425/559676
  change name of file_scope argument to references_scope
  re-roxygenize
  Add `publish_site()` function for "one-button" publishing of R Markdown websites.
  Enable use of pandoc --file-scope for input files originating from multiple Rmds (rstudio#1837)
  Added missing lang attribute to ioslides_presentation template (rstudio#1841)
  ...
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants