Skip to content

Commit 6086219

Browse files
authored
Merge pull request #482 from 0xflotus/patch-2
(docs): enabled syntax highlighting
2 parents 5e9a5c6 + 904a948 commit 6086219

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ If you are loading MathJax from a CDN into a web page, there is no
5151
need to install anything. Simply use a `script` tag that loads
5252
MathJax from the CDN. E.g.,
5353

54-
<script id="MathJax-script" async
55-
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
56-
</script>
54+
```html
55+
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
56+
```
5757

5858
See the [MathJax
5959
documentation](https://docs.mathjax.org/en/latest/index.html#browser-components),
@@ -74,21 +74,25 @@ To use MathJax components in a node application, install the `mathjax` package:
7474

7575
Then require `mathjax` within your application:
7676

77-
require('mathjax').init({ ... }).then((MathJax) => { ... });
77+
```js
78+
require('mathjax').init({ ... }).then((MathJax) => { ... });
79+
```
7880

7981
where the first `{ ... }` is a MathJax configuration, and the second
8082
`{ ... }` is the code to run after MathJax has been loaded. E.g.
8183

82-
require('mathjax').init({
83-
loader: {
84-
require: require,
85-
paths: {mathjax: 'mathjax/es5'},
86-
load: ['input/tex', 'output/svg']
87-
}
88-
}).then((MathJax) => {
89-
const svg = MathJax.tex2svg('\\frac{1}{x^2-1}', {display: true});
90-
console.log(MathJax.startup.adaptor.outerHTML(svg));
91-
}).catch((err) => console.log(err.message));
84+
```js
85+
require('mathjax').init({
86+
loader: {
87+
require: require,
88+
paths: {mathjax: 'mathjax/es5'},
89+
load: ['input/tex', 'output/svg']
90+
}
91+
}).then((MathJax) => {
92+
const svg = MathJax.tex2svg('\\frac{1}{x^2-1}', {display: true});
93+
console.log(MathJax.startup.adaptor.outerHTML(svg));
94+
}).catch((err) => console.log(err.message));
95+
```
9296

9397

9498
See the
@@ -120,10 +124,12 @@ demos](https://github.com/mathjax/MathJax-demos-node) for examples).
120124

121125
If you want to work from the GitHub repository directly, then do the following:
122126

123-
git clone https://github.com/mathjax/MathJax-src.git mathjax-src
124-
cd mathjax-src
125-
npm run --silent compile
126-
npm run --silent make-components
127+
```bash
128+
git clone https://github.com/mathjax/MathJax-src.git mathjax-src
129+
cd mathjax-src
130+
npm run --silent compile
131+
npm run --silent make-components
132+
```
127133

128134
in order to compile the JavaScript files from the TypeScript source,
129135
and build the component files from the JavaScript files.

0 commit comments

Comments
 (0)