title: Offline report with D3, md and equations
body: <p>Is it possible to create a single html page containing embedded <a href="https://d3js.org/" rel="nofollow noreferrer">D3js</a> charts, <a href="https://commonmark.org/" rel="nofollow noreferrer">CommonMark</a> text, and equations (e.g. <a href="https://khan.github.io/KaTeX/" rel="nofollow noreferrer">Katex</a> or <a href="https://www.mathjax.org/" rel="nofollow noreferrer">MathJax</a>) and have it all rendered the browser offline?</p>
  
  <p><strong>Must have:</strong></p>
  
  <ul>
  <li>Works offline using modern Firefox/Chrome/Safari, after having
  downloaded a minimal number of JavaScript libs.  </li>
  <li>No requirement for installing anything beyond the web browser.  So no local http server, Pandoc, R, Python etc.</li>
  </ul>
  
  <p><strong>Should have:</strong></p>
  
  <ul>
  <li>Possible to write everything in a single html file, which opens in a normal modern browser. </li>
  <li>Good archival properties with minimal maintanence.  </li>
  </ul>
  
  <p><strong>Motivation:</strong></p>
  
  <p>We work in a high security locked down IT environment and can’t install stuff, but we do have decent web browsers and can run javascript in them.  </p>
  
  <p>We routinely share small analytical reports internally, and are experimenting with delivering a directory containing </p>
  
  <ul>
  <li>an html file (with embedded JSON data), and</li>
  <li>downloaded D3 and <a href="https://underscorejs.org/" rel="nofollow noreferrer">Underscore</a> librariess</li>
  </ul>
  
  <p>All the internal customer has to do is click on index.html. So far this has been very succesful, but we'd like to use markdown and equations too.</p>
  
  <p>We are vaguely aware of data science workbook solutions like <a href="https://jupyter.org/" rel="nofollow noreferrer">Jupyter</a> and <a href="https://beta.observablehq.com/" rel="nofollow noreferrer">Observable</a>, but not sure that these meet our criteria. </p>
  
  <p><strong>Clarification</strong></p>
  
  <p>I know we can download libs and place them in a dir alongside index.html, but I'm not sure if a JavaScript library exists which can render the markdown and equations and write the results directly into the DOM.  And even if such a library exists, where in index.html would the markdown be written?  Is there some kind of html tag which can just hide a load of raw text which will be parsed by JS?</p>