Improve server-side rendering documentation (#2178)

* Improve server-side rendering documentation

* Fix typo

* Document Node + mhchem

* Re-order require statements

Co-authored-by: ylemkimon <mail@ylem.kim>
This commit is contained in:
Erik Demaine
2020-01-04 05:55:12 -05:00
committed by ylemkimon
parent 3cb9bd78bb
commit e85fdd7212

View File

@@ -75,4 +75,25 @@ import katex from 'katex/dist/katex.mjs'
```
> The ES module contains ES6 syntaxes and features, and may need transpiling to
use in old environments:
use in old environments.
See the [API](api.html) for available functions in the `katex` module.
## Including in webpages
To render any HTML generated by e.g. `katex.renderToString`, you will
still need to link the CSS file, make the KaTeX font files available to the
client, and use the HTML5 doctype. See [browser usage](browser.html).
Note, however, that you do not need to include `katex.js` on the client.
## Using mhchem extension
The [mhchem extension](https://github.com/Khan/KaTeX/tree/master/contrib/mhchem)
adds its features by modifying the `katex` module. So you can use KaTeX with
mhchem in Node as follows:
```js
const katex = require('katex');
require('katex/dist/contrib/mhchem.js'); // modify katex module
const html = katex.renderToString('\\ce{CO2 + C -> 2 C0}");
```