Prometheus
Prometheus

Reputation: 2017

RMarkdown button to show or hide code

I am often writing markdown documents that get read by both technical people and executives.

In that sense, I was wondering if its possible to create a button in the HTML that would hide or show the code chunks in the final output?

Currently, I am creating two seperate files, which I think is a less elegant solution.

Anyone?

Upvotes: 12

Views: 9506

Answers (1)

jordan
jordan

Reputation: 398

@docendo discimus provided a link that answers the OP question. I'm including the code here for posterity purposes.

---
title: "test"
output: 
  html_document:
    code_folding: hide
---

Which produces the code folding button: enter image description here

Upvotes: 12

Related Questions