Skip to content

Commit 7a9a148

Browse files
authored
Merge pull request #13 from 0xflotus/patch-1
enabled syntax highlighting
2 parents f94ad44 + 49e3374 commit 7a9a148

File tree

5 files changed

+25
-23
lines changed

5 files changed

+25
-23
lines changed

component/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Other than these considerations, the configuration and usage of MathJax in node
1616

1717
An example of the configuration for the `tex2chtml` example is given below. The `argv` object contains the command-line arguments and option values:
1818

19-
```
19+
```js
2020
MathJax = {
2121
loader: {
2222
paths: {mathjax: 'mathjax-full/es5'},
@@ -61,6 +61,8 @@ The function we provide for `pageReady()` uses the `tex2chtmlPromise()` command
6161

6262
Once the configuration is set, the last thing to do is load the startup component:
6363

64-
require('mathjax-full/' + (argv.dist ? 'es5' : 'components/src/startup') + '/startup.js');
64+
```js
65+
require('mathjax-full/' + (argv.dist ? 'es5' : 'components/src/startup') + '/startup.js');
66+
```
6567

6668
This loads either the distribution or the source version, depending on which was requested by the command-line options.

custom-tex-extension/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ The key portions of the [code](tex2mml) used to do this is described below.
1414

1515
First, we add the `mml` package to the default list of packages:
1616

17-
```
17+
```js
1818
const PACKAGES = 'base, autoload, require, ams, newcommand, mml';
1919
```
2020

2121
Then we configure MathJax to know about the new package:
2222

23-
```
23+
```js
2424
MathJax = {
2525
loader: {
2626
paths: {

direct/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ All the examples in this directory consist of four main parts:
1111

1212
These parts are described below using the `tex2chtml` command as an example. It loads the following MathJax values:
1313

14-
```
14+
```js
1515
const mathjax = require('mathjax-full/js/mathjax.js').mathjax;
1616
const TeX = require('mathjax-full/js/input/tex.js').TeX;
1717
const CHTML = require('mathjax-full/js/output/chtml.js').CHTML;
@@ -25,7 +25,7 @@ The `TeX` and `CHTML` objects are the input and output jax class constructors, t
2525

2626
Next we create the needed MathJax objects:
2727

28-
```
28+
```js
2929
const adaptor = liteAdaptor();
3030
RegisterHTMLHandler(adaptor);
3131

@@ -38,7 +38,7 @@ Here we create the `liteDOM` adaptor and use it to tell MathJax that we will use
3838

3939
Finally, we do the conversion:
4040

41-
```
41+
```js
4242
const node = html.convert(argv._[0] || '', {
4343
display: !argv.inline,
4444
em: argv.em,

preload/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ All the examples in this directory consist of four main parts:
1111

1212
These parts are described below using the `tex2chtml` command as an example. The configuration and loading of components is accomplished via
1313

14-
```
14+
```js
1515
MathJax = {
1616
tex: {packages: argv.packages.replace('\*', PACKAGES).split(/\s*,\s*/)},
1717
chtml: {fontURL: argv.fontURL},
@@ -47,7 +47,7 @@ The `MathJax` object simply configures the `tex`, `chtml`, and startup modules,
4747

4848
Once the files are loaded and MathJax is told about them, we tell the startup module to initialize itself:
4949

50-
```
50+
```js
5151
MathJax.config.startup.ready();
5252
const adaptor = MathJax.startup.adaptor;
5353
```
@@ -56,7 +56,7 @@ This creates the needed input and output jax, the DOM adaptor, and the internal
5656

5757
Finally, we do the conversion:
5858

59-
```
59+
```js
6060
const node = MathJax.tex2chtml(argv._[0] || '', {
6161
display: !argv.inline,
6262
em: argv.em,

speech/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ Most of the examples in this directory use the MathJax [components approach](../
1414

1515
We use the [`tex2chtml`](tex2chtml) code as an example. The key pieces are the following lines from the configuration:
1616

17-
```
18-
loader: {
19-
paths: {
20-
sre: 'mathjax-full/es5/a11y/sre-node'
21-
},
22-
load: ['adaptors/liteDOM', 'a11y/semantic-enrich']
23-
},
24-
options: {
25-
enrichSpeech: argv.speech,
26-
renderActions: require('./action.js').speechAction
17+
```js
18+
loader: {
19+
paths: {
20+
sre: 'mathjax-full/es5/a11y/sre-node'
2721
},
22+
load: ['adaptors/liteDOM', 'a11y/semantic-enrich']
23+
},
24+
options: {
25+
enrichSpeech: argv.speech,
26+
renderActions: require('./action.js').speechAction
27+
},
2828
```
2929

3030
The `loader` section sets up the path to the speech-rule-engine (SRE), which is used to load the node-based version of SRE (there are separate browser and node versions), and includes the `a11y/semantic-enrich` component in the list to be loaded.
@@ -37,21 +37,21 @@ The rest of the file is the same as the standard `tex2chtml` using components.
3737

3838
The [`mml2svg`](mml2svg) example uses the [direct import](../direct) approach. The key additions in this case are
3939

40-
```
40+
```js
4141
const EnrichHandler = require('mathjax-full/es5/a11y/semantic-enrich.js').EnrichHandler;
4242
```
4343

4444
which loads a function used to augment the HTML handler to include the enrichment functions. It is used in
4545

46-
```
46+
```js
4747
EnrichHandler(RegisterHTMLHandler(adaptor), new MathML());
4848
```
4949

5050
to modify the handler that is register by `RegisterHTMLHandler()`, creating a new handler that has the enrichment actions included. You need to provide a MathML input handler so that it can parse the serialized MathML returned by the SRE.
5151

5252
Finally, the lines
5353

54-
```
54+
```js
5555
const html = MathJax.document('', {
5656
InputJax: mml,
5757
OutputJax: svg,

0 commit comments

Comments
 (0)