提交 86ebba45 编写于 作者: K Kevin Nadro

added mathjax example

上级 db033eee
......@@ -11,6 +11,20 @@
<title>Algorithm Visualizer</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">
<link rel="stylesheet" href="public/algorithm_visualizer.min.css">
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
styles: {
".MJXc-display": {
"display": "inline !important",
"margin": "0 !important"
},
}
});
</script>
<script type="text/javascript" async
src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
</head>
<body>
......@@ -36,7 +50,6 @@
<span class="btn-text">Generate</span>
</div>
</div>
<div class="btn" id="btn_share">
<div class="wrapper">
<i class="fa fa-share" aria-hidden="true"></i> Share <input type="text" class="collapse" id="shared">
......
'use strict';
const app = require('../app');
const {
isScratchPaper
} = require('../utils');
const utils = require('../utils');
const showDescription = require('./show_description');
const addFiles = require('./add_files');
......@@ -14,7 +10,7 @@ module.exports = (category, algorithm, data, requestedFile) => {
let category_name;
let algorithm_name;
if (isScratchPaper(category)) {
if (utils.isScratchPaper(category)) {
$menu = $('#scratch-paper');
category_name = 'Scratch Paper';
algorithm_name = algorithm ? 'Shared' : 'Temporary';
......@@ -45,4 +41,5 @@ module.exports = (category, algorithm, data, requestedFile) => {
showDescription(data);
addFiles(category, algorithm, files, requestedFile);
utils.renderMathJax();
};
......@@ -14,8 +14,13 @@ const getFileDir = (category, algorithm, file) => {
return `./algorithm/${category}/${algorithm}/${file}/`;
};
const renderMathJax = () =>{
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
};
module.exports = {
isScratchPaper,
getAlgorithmDir,
getFileDir
};
\ No newline at end of file
getFileDir,
renderMathJax
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册