Merge pull request #636 from mathquill/ci.screenshots
Take screenshots of visual.html during unit tests
diff --git a/docs/extra.css b/docs/extra.css
new file mode 100644
index 0000000..559adca
--- /dev/null
+++ b/docs/extra.css
@@ -0,0 +1,8 @@
+/* default ReadTheDocs MkDocs theme's <code> font-size
+ much too small at 75%, override */
+body code {
+ font-size: 90%;
+}
+body pre code {
+ font-size: 100%;
+}
diff --git a/mkdocs.yml b/mkdocs.yml
new file mode 100644
index 0000000..5351f6e
--- /dev/null
+++ b/mkdocs.yml
@@ -0,0 +1,22 @@
+site_name: MathQuill
+site_url: http://docs.mathquill.com
+repo_url: https://github.com/mathquill/mathquill
+site_description: Easily type math in your webapp
+site_author: Han, Jeanine, Mary
+site_favicon: http://mathquill.com/favicon.ico
+google_analytics: ['UA-73742753-3', 'docs.mathquill.com']
+
+pages:
+ - index.md
+ - Getting_Started.md
+ - 'API Methods': Api_Methods.md
+ - 'Config Options': Config.md
+ - 'Under the Hood': Contributing.md
+ - Code_of_Conduct.md
+
+markdown_extensions:
+ - toc:
+ permalink: True
+
+extra_css:
+ - extra.css
diff --git a/src/commands/math/commands.js b/src/commands/math/commands.js
index 1538c51..e0e2d99 100644
--- a/src/commands/math/commands.js
+++ b/src/commands/math/commands.js
@@ -474,17 +474,6 @@
};
});
-var Vec = LatexCmds.vec = P(MathCommand, function(_, super_) {
- _.ctrlSeq = '\\vec';
- _.htmlTemplate =
- '<span class="mq-non-leaf">'
- + '<span class="mq-vector-prefix">→</span>'
- + '<span class="mq-vector-stem">&0</span>'
- + '</span>'
- ;
- _.textTemplate = ['vec(', ')'];
-});
-
var NthRoot =
LatexCmds.nthroot = P(SquareRoot, function(_, super_) {
_.htmlTemplate =
@@ -500,6 +489,21 @@
};
});
+var DiacriticAbove = P(MathCommand, function(_, super_) {
+ _.init = function(ctrlSeq, symbol, textTemplate) {
+ var htmlTemplate =
+ '<span class="mq-non-leaf">'
+ + '<span class="mq-diacritic-above">'+symbol+'</span>'
+ + '<span class="mq-diacritic-stem">&0</span>'
+ + '</span>'
+ ;
+
+ super_.init.call(this, ctrlSeq, htmlTemplate, textTemplate);
+ };
+});
+LatexCmds.vec = bind(DiacriticAbove, '\\vec', '→', ['vec(', ')']);
+LatexCmds.tilde = bind(DiacriticAbove, '\\tilde', '~', ['tilde(', ')']);
+
function DelimsMixin(_, super_) {
_.jQadd = function() {
super_.jQadd.apply(this, arguments);
diff --git a/src/css/math.less b/src/css/math.less
index aae409d..e65ae15 100644
--- a/src/css/math.less
+++ b/src/css/math.less
@@ -294,16 +294,15 @@
padding-top: 1px;
}
- .mq-vector-prefix {
+ .mq-diacritic-above {
display: block;
text-align: center;
- line-height: .25em;
- margin-bottom: -.1em;
- font-size: 0.75em;
+ line-height: .4em;
}
- .mq-vector-stem {
+ .mq-diacritic-stem {
display: block;
+ text-align: center;
}
.mq-large-operator {
diff --git a/src/intro.js b/src/intro.js
index 654b8cd..265c233 100644
--- a/src/intro.js
+++ b/src/intro.js
@@ -17,6 +17,8 @@
min = Math.min,
max = Math.max;
+if (!jQuery) throw 'MathQuill requires jQuery 1.4.3+ to be loaded first';
+
function noop() {}
/**
diff --git a/test/visual.html b/test/visual.html
index ffad141..acfa902 100644
--- a/test/visual.html
+++ b/test/visual.html
@@ -211,6 +211,7 @@
<tr><td><span class="mathquill-static-math">1+\sum_0^n+\sum_{i=0123}^n+\sum_0^{wordiness}</span><td><span>1+\sum_0^n+\sum_{i=0123}^n+\sum_0^{wordiness}</span>^M
<tr><td><span class="mathquill-static-math">x\ \ \ +\ \ \ y</span><td><span>x\ \ \ +\ \ \ y</span>^M
<tr><td><span class="mathquill-static-math">\sum _{n=0}^3\cos x</span><td><span>\sum _{n=0}^3\cos x</span>^M
+<tr><td><span class="mathquill-static-math">\vec x + \tilde x + \vec A + \tilde A + \vec{abcd} + \tilde{abcd}</span><td><span>\vec x + \tilde x + \vec A + \tilde A + \vec{abcd} + \tilde{abcd}</span>^M
<tr><td><span class="mathquill-static-math">\int _{\phi =0}^{2\pi }\int _{\theta =0}^{\pi }\int _{r=0}^{\infty }f(r,\theta ,\phi )r^2\sin \theta drd\theta d\phi </span><td><span>\int _{\phi =0}^{2\pi }\int _{\theta =0}^{\pi }\int _{r=0}^{\infty }f(r,\theta ,\phi )r^2\sin \theta drd\theta d\phi </span>
<tr><td><span class="mathquill-static-math">\int_0^{\frac{\frac{1}{2}}{3}} \int_0^{\frac{1}{\frac{2}{3}}} \int_0^{\frac{1}{\frac{2}{\frac{3}{\frac{4}{5}}}}}</span><td><span>\int_0^{\frac{\frac{1}{2}}{3}} \int_0^{\frac{1}{\frac{2}{3}}} \int_0^{\frac{1}{\frac{2}{\frac{3}{\frac{4}{5}}}}}</span>
<tr><td colspan=2><span id="sixes"></span>