Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmasson committed Apr 30, 2020
1 parent 8150bb2 commit 6240fc4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
var div = document.createElement( 'div' );
a.appendChild( div );

var math = this.response.indexOf( 'math/' ) > -1 ? `
var math = this.response.includes( 'math.js' ) ? `
<script src="../../math/build/math.js"><\/script>` : '';

var mathjax = this.response.indexOf( 'mathjax' ) > -1 ? `
var mathjax = this.response.includes( 'mathjax' ) ? `
<script src="https://cdn.jsdelivr.net/gh/mathjax/MathJax@2.7.5/MathJax.js?config=TeX-AMS_HTML"><\/script>` : '';

var iframe = document.createElement( 'iframe' );
Expand Down
19 changes: 15 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,24 @@
xhr.onload = function() {

var parser = new DOMParser();
var dom = parser.parseFromString( xhr.response, 'text/html' );
var dom = parser.parseFromString( this.response, 'text/html' );
var cell = dom.getElementsByClassName( 'mathcell' )[0];

var math = this.response.includes( 'math.js' ) ? `
<script src="../math/build/math.js"><\/script>` : '';

var mathjax = this.response.includes( 'mathjax' ) ? `
<script src="https://cdn.jsdelivr.net/gh/mathjax/MathJax@2.7.5/MathJax.js?config=TeX-AMS_HTML"><\/script>` : '';

var view = document.getElementById( 'view' );
view.srcdoc = '<html><body>'
+ '<script src="https://paulmasson.github.io/mathcell/build/mathcell.js"><\/script>'
+ cell.outerHTML + '</body></html>';
view.srcdoc = `
<html>
<body>
<script src="https://paulmasson.github.io/mathcell/build/mathcell.js"><\/script> ${math} ${mathjax}
${cell.outerHTML}
</body>
</html>
`;

}

Expand Down

0 comments on commit 6240fc4

Please sign in to comment.