r - How to add numbered section folding to rmarkdown -


i trying show sections of text after clicking on them (very code folding).

so far using following html script @ beginning of rmd file:

  <script language="javascript">      function toggle(num) {       var ele = document.getelementbyid("toggletext" + num);       var text = document.getelementbyid("displaytext" + num);       if(ele.style.display == "block") {         ele.style.display = "none";         text.innerhtml = "show";       }       else {         ele.style.display = "block";         text.innerhtml = "hide";       }    }    </script> 

but whenever use sections/headers lose automatic numbering.

<a id="displaytext" href="javascript:toggle(5);"><h1>i code fold section  </h1></a>   <div id="toggletext5" style="display: none">   bla bla  </div> 

and heading numbering this:

1 - code fold section


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -