Merge remote-tracking branch 'katex-upstream/gh-pages'
This commit is contained in:
commit
e2ac677fa5
35
bower_components/katex/bower.json
vendored
Normal file
35
bower_components/katex/bower.json
vendored
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"name": "KaTeX",
|
||||||
|
"version": "0.7.0",
|
||||||
|
"main": [
|
||||||
|
"dist/katex.min.js",
|
||||||
|
"dist/katex.min.css"
|
||||||
|
],
|
||||||
|
"homepage": "http://khan.github.io/KaTeX/",
|
||||||
|
"description": "Fast math typesetting for the web.",
|
||||||
|
"moduleType": [
|
||||||
|
"amd",
|
||||||
|
"globals",
|
||||||
|
"node"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/Khan/KaTeX.git"
|
||||||
|
},
|
||||||
|
"ignore": [
|
||||||
|
"**/.*",
|
||||||
|
"/*.txt",
|
||||||
|
"/*.js",
|
||||||
|
"/*.md",
|
||||||
|
"/package.json",
|
||||||
|
"/Makefile",
|
||||||
|
"/build",
|
||||||
|
"/test",
|
||||||
|
"/src",
|
||||||
|
"/contrib",
|
||||||
|
"/dockers",
|
||||||
|
"/metrics",
|
||||||
|
"/static"
|
||||||
|
]
|
||||||
|
}
|
|
@ -16,8 +16,8 @@ KaTeX supports all major browsers, including Chrome, Safari, Firefox, Opera, and
|
||||||
You can [download KaTeX](https://github.com/khan/katex/releases) and host it on your server or include the `katex.min.js` and `katex.min.css` files on your page directly from a CDN:
|
You can [download KaTeX](https://github.com/khan/katex/releases) and host it on your server or include the `katex.min.js` and `katex.min.css` files on your page directly from a CDN:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css">
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### In-browser rendering
|
#### In-browser rendering
|
||||||
|
|
2
katex/katex.min.css
vendored
2
katex/katex.min.css
vendored
File diff suppressed because one or more lines are too long
9
katex/katex.min.js
vendored
9
katex/katex.min.js
vendored
File diff suppressed because one or more lines are too long
212
main.css
Normal file
212
main.css
Normal file
|
@ -0,0 +1,212 @@
|
||||||
|
body {
|
||||||
|
font: 16px/1.4 "proxima-nova", "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
margin: 0 auto;
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 800px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header, .footer {
|
||||||
|
color: #fff;
|
||||||
|
background: #329894;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta {
|
||||||
|
margin: 10px 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta a {
|
||||||
|
border-radius: 3px;
|
||||||
|
display: inline-block;
|
||||||
|
font-weight: 600;
|
||||||
|
margin: 0 10px;
|
||||||
|
padding: 8px 24px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
padding: 40px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 45px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tagline {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 300;
|
||||||
|
padding: 20px 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tagline em {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header .cta a {
|
||||||
|
border: 3px solid;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header .cta a:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo {
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
|
||||||
|
font-size: 22px;
|
||||||
|
margin: 50px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo,
|
||||||
|
.demo-left,
|
||||||
|
.demo-right {
|
||||||
|
height: 260px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-left,
|
||||||
|
.demo-right {
|
||||||
|
box-sizing: border-box;
|
||||||
|
float: left;
|
||||||
|
padding: 20px 30px;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-instructions {
|
||||||
|
line-height: 1.5;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-left {
|
||||||
|
background: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-left textarea {
|
||||||
|
background: #000;
|
||||||
|
border: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: #fff;
|
||||||
|
font: 14px Menlo, monospace;
|
||||||
|
height: 160px;
|
||||||
|
padding: 10px;
|
||||||
|
resize: none;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-right {
|
||||||
|
background: #fff;
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
#demo-output {
|
||||||
|
font-size: 18px;
|
||||||
|
padding: 10px 0;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main {
|
||||||
|
background: #fff2e7;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
|
||||||
|
min-height: 400px;
|
||||||
|
position: relative;
|
||||||
|
padding: 30px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtagline {
|
||||||
|
color: #329894;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 20px 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.features {
|
||||||
|
font-size: 20px;
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 540px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.features > li {
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main .examples {
|
||||||
|
margin: 40px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main .example {
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
margin: 30px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main .comparison-labels {
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main .comparison-labels .left,
|
||||||
|
.main .comparison-labels .right {
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 50%;
|
||||||
|
float: left;
|
||||||
|
height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main .comparison {
|
||||||
|
background-image: url(katex-comparison.gif);
|
||||||
|
background-position: 50% 50%;
|
||||||
|
background-size: cover;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
|
||||||
|
height: 340px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main .cta {
|
||||||
|
padding-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main .cta a {
|
||||||
|
border: 3px solid;
|
||||||
|
color: #329894;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main .cta a:hover {
|
||||||
|
background: rgba(50, 152, 148, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
padding: 30px 0;
|
||||||
|
font-size: 21px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ka-logo {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ka-logo img {
|
||||||
|
border: none;
|
||||||
|
vertical-align: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.credits {
|
||||||
|
float: left;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.credits a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.errorMessage {
|
||||||
|
color: red;
|
||||||
|
}
|
32
main.js
Normal file
32
main.js
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
window.startup = function() {
|
||||||
|
var tex = document.getElementsByClassName("tex");
|
||||||
|
Array.prototype.forEach.call(tex, function(el) {
|
||||||
|
katex.render(el.getAttribute("data-expr"), el);
|
||||||
|
});
|
||||||
|
|
||||||
|
var demoInput = document.getElementById("demo-input");
|
||||||
|
var demoOutput = document.getElementById("demo-output");
|
||||||
|
|
||||||
|
function doDemo() {
|
||||||
|
try {
|
||||||
|
katex.render(demoInput.value, demoOutput, {
|
||||||
|
displayMode: true
|
||||||
|
});
|
||||||
|
} catch(err) {
|
||||||
|
while(demoOutput.lastChild) {
|
||||||
|
demoOutput.removeChild(demoOutput.lastChild);
|
||||||
|
}
|
||||||
|
var msg = document.createTextNode(err.message);
|
||||||
|
var span = document.createElement("span");
|
||||||
|
span.appendChild(msg);
|
||||||
|
demoOutput.appendChild(span);
|
||||||
|
span.setAttribute("class", "errorMessage");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
demoInput.addEventListener("input", function() {
|
||||||
|
doDemo();
|
||||||
|
});
|
||||||
|
|
||||||
|
doDemo();
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user