mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 19:28:39 +00:00
Create node server to replace 'make watch'
Reviewers: xymostech Reviewed By: xymostech Differential Revision: http://phabricator.benalpert.com/D38
This commit is contained in:
14
static/index.html
Normal file
14
static/index.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>MJLite Test</title>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js" type="text/javascript"></script>
|
||||
<script src="MJLite.js" type="text/javascript"></script>
|
||||
<script src="main.js" type="text/javascript"></script>
|
||||
<link href="style.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<input type="text" value="2x^2 + 3" id="input" />
|
||||
<div id="math"></div>
|
||||
</body>
|
||||
</html>
|
10
static/main.js
Normal file
10
static/main.js
Normal file
@@ -0,0 +1,10 @@
|
||||
window.onload = function() {
|
||||
var input = document.getElementById("input");
|
||||
var math = document.getElementById("math");
|
||||
|
||||
MJLite.process(input.value, math);
|
||||
|
||||
input.oninput = function() {
|
||||
MJLite.process(input.value, math);
|
||||
};
|
||||
};
|
106
static/style.css
Normal file
106
static/style.css
Normal file
@@ -0,0 +1,106 @@
|
||||
@font-face {
|
||||
font-family: MathJax_Main;
|
||||
src: url("http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Regular.otf");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: MathJax_Main;
|
||||
src: url("http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Italic.otf");
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: MathJax_Math;
|
||||
src: url("http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Math-Italic.otf");
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/*
|
||||
thin space: 1/6 quad
|
||||
medium space: 2/9 quad
|
||||
thick space: 5/18 quad
|
||||
|
||||
things to do:
|
||||
^ _ and styles
|
||||
\sin
|
||||
\sum, \int, \lim
|
||||
\frac
|
||||
\sqrt
|
||||
big parens
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
input {
|
||||
margin: 0px;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
#math {
|
||||
font-family: MathJax_Main;
|
||||
}
|
||||
|
||||
.mathit {
|
||||
font: italic 100% MathJax_Math;
|
||||
}
|
||||
|
||||
.mord + .mbin {
|
||||
margin-left: 0.22222em;
|
||||
}
|
||||
|
||||
.mbin + .mord {
|
||||
margin-left: 0.22222em;
|
||||
}
|
||||
|
||||
.mbin + .mopen {
|
||||
margin-left: 0.22222em;
|
||||
}
|
||||
|
||||
.mclose + .mbin {
|
||||
margin-left: 0.22222em;
|
||||
}
|
||||
|
||||
.msub {
|
||||
vertical-align: bottom;
|
||||
font-size: 70%;
|
||||
position: relative;
|
||||
top: 0.2em;
|
||||
}
|
||||
|
||||
.msup {
|
||||
position: relative;
|
||||
top: -0.5em;
|
||||
font-size: 70%;
|
||||
}
|
||||
|
||||
.msupsub {
|
||||
display: inline-table;
|
||||
table-layout: fixed;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.msupsub > .msup, .msupsub > .msub {
|
||||
display: table-row;
|
||||
vertical-align: baseline;
|
||||
line-height: 1em;
|
||||
}
|
||||
|
||||
.mfrac {
|
||||
display: inline-table;
|
||||
vertical-align: 0.88em;
|
||||
}
|
||||
|
||||
.mfracnum, .mfracmid, .mfracden {
|
||||
display: table-row;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mfracmid > span {
|
||||
background: black;
|
||||
display: block;
|
||||
height: 0.05em;
|
||||
min-height: 1px;
|
||||
}
|
Reference in New Issue
Block a user