Official MathJax support for Discourse
Go to file
Daniel Hollas dce1a1b0a1 FEATURE: Add KaTeX rendering support (#15)
* FEATURE: Add KaTeX in-browser rendering support.

* Remove ttf fonts from KaTeX

* Update KaTeX to v0.10.1, fix paths to fonts.

Font loading was fixed by rebuilding KaTeX
and specifiying absolute paths to fonts in CSS:
Steps to build KaTeX:

1. `git clone https://github.com/KaTeX/KaTeX.git && cd KaTeX`
    `git submodule update --init --recursive`

2. Change paths to fonts:
    `sed -ri 's/@font-folder.+$/@font-folder:
"\/plugins\/discourse-math\/katex\/fonts";/'
submodules/katex-fonts/fonts.less`

3. Disable TTF fonts:
   `export USE_TTF=false`
    Alternatively, we could modify `.browserslistrc` to match what
Discourse supports

3. Build KaTeX
   `yarn && yarn builld`

4. Copy `katex.min.js` and `katex.min.css` from `dist/` to
`discourse-math/public/katex/`

5. Update fonts, copy woff and woff2 files from
`submodules/katex-fonts/fonts`

* Minor copy edit to settings

Mark MathKJax only settings

* Add Mhchem extension for KaTeX.

It is already automatically loaded for MathJaX.
2019-03-05 07:35:00 +11:00
.tx Update translations 2018-09-10 14:02:22 -04:00
assets/javascripts FEATURE: Add KaTeX rendering support (#15) 2019-03-05 07:35:00 +11:00
bin Transifex integration 2017-12-08 14:54:35 -05:00
config FEATURE: Add KaTeX rendering support (#15) 2019-03-05 07:35:00 +11:00
lib Fix rubocop offenses. 2017-08-02 15:56:11 +09:00
public FEATURE: Add KaTeX rendering support (#15) 2019-03-05 07:35:00 +11:00
spec fix specs 2017-07-18 14:40:05 -04:00
.gitignore Inherit rubocop config from discourse repo 2018-12-03 00:37:09 +01:00
.rubocop.yml Inherit rubocop config from discourse repo 2018-12-03 00:37:09 +01:00
Gemfile Transifex integration 2017-12-08 14:54:35 -05:00
Gemfile.lock Update translations 2019-01-31 16:36:43 -05:00
LICENSE add license 2017-07-06 16:51:50 -04:00
README.md FEATURE: Add KaTeX rendering support (#15) 2019-03-05 07:35:00 +11:00
plugin.rb Add URL to plugin.rb 2018-06-30 17:18:39 -04:00

README.md

Discourse Math plugin

Adds LaTeX support to your Discourse instance.

https://meta.discourse.org/t/discourse-math-plugin/65770