Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed Dec 1, 2020
2 parents 93dedfa + 897a03e commit ce536c8
Show file tree
Hide file tree
Showing 3 changed files with 407 additions and 1 deletion.
2 changes: 1 addition & 1 deletion convert-configuration/convert-configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ <h2>Comments:</h2>
</div>

</body>
</html>
</html>
187 changes: 187 additions & 0 deletions speech-generator/convert-with-speech.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width">
<title>Convert LaTeX or MathML to Speech</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script>
MathJax = {
loader: {load: ['input/asciimath', 'input/mml', 'input/tex', 'output/svg', 'sre/sre_browser']},
tex: {inlineMath: [['$', '$'], ['\\(', '\\)']]},
startup: {
ready: function() {
MathJax.startup.defaultReady();
// Initialise convert when MathJax/SRE is fully loaded.
MathJax.startup.promise.then(function () {
Convert.init();
});
}
}
};
</script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/startup.js"></script>
<style>
body {
font-family: sans-serif
}
h2 {
margin: 1.5em 0 1em;
font-size: 120%;
}
h2:first-child {
margin-top: .5em;
}
.fullwidth {
width: 100%;
}
table.fullwidth tr {
vertical-align: baseline;
}
table.fullwidth td {
white-space: nowrap;
}
td.fullwidth input {
width: 100%;
box-sizing: border-box;
}
td.spacing {
width: 20%
}
.red {
color: #880000;
background-color: #FFEEEE;
}
.green {
color: #008800;
background-color: #EEFFEE;
}
#explanation {
display: inline-block;
box-sizing: border-box;
width: 100%;
min-width: 25em;
vertical-align: top;
margin-bottom: 2em;
line-height: 1.5;
padding-right: .75em;
}
.converter {
display: inline-block;
box-sizing: border-box;
width: 48%;
min-width: 25em;
vertical-align: top;
background-color: #F0F0F0;
border: 2px solid #CCC;
padding: .75em;
}
#input {
font-family: monospace;
font-size: 100%;
padding: .3em;
width: 100%;
box-sizing: border-box;
}
#configfile {
border: 1px solid #AAA;
padding: 2px;
font-family: monospace;
font-size: 100%
}
.speech {
border: 1px solid #AAA;
padding: .5em;
background-color: white;
}
.speech {
min-height: 8em;
border: 1px solid #AAA;
background-color: #F8F8F8;
padding: .5em .5em .5em 1.5em;
overflow: auto;
white-space: pre;
}
#errors code, #explanation code {
background-color: #EEE;
display: inline-block;
padding: 1px 2px;
border: 1px solid #AAA;
margin: 1px;
}
#explanation code {
padding: 0 2px;
}
</style>
<script src="./convert-with-speech.js"></script>
</head>
<body>

<h1>MathJax Speech Converter</h1>

<div id="explanation">
<p>

This tool converts math input expressions given in LaTeX, MathML or AsciiMath to
text output.

</p>
</div>

<div class="converter" id="inputpanel">
<H2>Input:</h2>
<textarea rows="15" cols="80" id="input">
</textarea>
<table class="fullwidth">
<tr>
<td><input type="radio" checked name="format" value="latex"><label for="latex">LaTeX</label></input></td>
<td><input type="radio" name="format" value="asciimath"><label for="asciimath">AsciiMath</label></input></td>
<td><input type="radio" name="format" value="mathml"><label for="mathml">MathML</label></input></td>
<td class="spacing"></td>
<td><label for="locale">Locale</label>
<select id="locale" onchange="Convert.updateLocale(value)">
</select>
</td>
<td><label for="locale">Markup</label>
<select id="markup" onchange="Convert.convertExpression()">
<option value="none">None</option>
<option value="punctuation">Punctuation</option>
<option value="ssml">SSML</option>
<option value="sable">Sable</option>
</select>
</td>
<td class="fullwidth"></td>
<td><input type="button" value="Convert"
onclick="Convert.convertExpression()"/></td>
</tr>
</table>

<h2>Expression:</h2>
<div id="rendered"></div>

</div>
<div class="converter" id="outputpanel">

<h2>Mathspeak Output:</h2>
<span><label for="locale">Style</label>
<select id="style" onchange="Convert.computeMathspeak()">
<option value="default">Verbose</option>
<option value="brief">Brief</option>
<option value="sbrief">Superbrief</option>
</select>
</span>
<pre class="speech" id="mathspeak">
</pre>

<h2>Clearspeak Output:</h2>
<pre class="speech" id="clearspeak">
</pre>
<div>
<label for="preferences">Preferences:</label>
<div id="preferences"></div>
</div>

</div>

</body>
</html>
Loading

0 comments on commit ce536c8

Please sign in to comment.