title: How can I specify HTML5 output from RMarkdown to get semantic elements like <section>?
body: <p>I noticed that in HTML produced by <code>knitr</code> from my RMarkdown document, sections are marked up thus:</p>
  
  <pre><code>&lt;div id="chunk_id" class="section level2"&gt;
  &lt;h2&gt;...&lt;/h2&gt;
  &lt;p&gt;...&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and so on. I think it's best practice to use a <code>&lt;section&gt;</code> element rather than a <code>&lt;div&gt;</code> here (<a href="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML_sections_and_outlines" rel="nofollow noreferrer">reference 1</a>, <a href="https://bitsofco.de/sectioning-content-in-html5/" rel="nofollow noreferrer">reference 2</a>), so I forked the RMarkdown code to see if I could make a change and a PR. <a href="https://github.com/rstudio/rmarkdown/blob/master/R/html_document.R" rel="nofollow noreferrer">In the code</a> I found the following:</p>
  
  <blockquote>
  <pre><code>#'@param section_divs Wrap sections in &lt;div&gt; tags (or &lt;section&gt; tags in HTML5),
  #'  and attach identifiers to the enclosing &lt;div&gt; (or &lt;section&gt;) rather than the
  #'  header itself. ```
  </code></pre>
  </blockquote>
  
  <p>so it seems like there is no need for a change to RMarkdown - it will already use <code>&lt;section&gt;</code> in the way I want, <em>if</em> it is told to output HTML5.</p>
  
  <p>My question is: how do you tell <code>knitr</code> to output HTML5? I have</p>
  
  <pre><code>output:
      html_document:
          section_divs = TRUE
  </code></pre>
  
  <p>but no idea how to "switch on" HTML5.</p>