-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Tex math typesetting using the fastest library available: Khan …
…Academy’s KaTeX
- Loading branch information
1 parent
7c52edd
commit 398da4e
Showing
7 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,8 +29,6 @@ | |
<section class="post-content"> | ||
{{content}} | ||
</section> | ||
|
||
{{/post}} | ||
</article> | ||
|
||
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<span id="katexScript"></span> | ||
|
||
<script type="text/javascript"> | ||
var mathAreas = document.getElementsByClassName("math"); | ||
if (mathAreas){ | ||
var ss = document.createElement("link"); | ||
ss.type = "text/css"; | ||
ss.rel = "stylesheet"; | ||
ss.href = "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.css"; | ||
document.getElementsByTagName("head")[0].appendChild(ss); | ||
var script = document.createElement( 'script' ); | ||
script.type = 'text/javascript'; | ||
script.src = '//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.js'; | ||
document.body.appendChild(script); | ||
window.onload = function() { | ||
Array.prototype.forEach.call( | ||
document.getElementsByClassName("math"), | ||
function(el) { | ||
try { | ||
katex.render(el.innerHTML, el); | ||
} catch (e) { console.log(e); } | ||
} | ||
); | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters