mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Implement latex highlighting for Latex in codable
This commit is contained in:
parent
6953ea9703
commit
14aaa10bf3
1 changed files with 17 additions and 1 deletions
|
@ -2,7 +2,9 @@
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import * as CodeMirror from "codemirror/lib/codemirror";
|
import * as CodeMirror from "codemirror/lib/codemirror";
|
||||||
|
import "codemirror/mode/python/python";
|
||||||
import "codemirror/mode/htmlmixed/htmlmixed";
|
import "codemirror/mode/htmlmixed/htmlmixed";
|
||||||
|
import "codemirror/mode/stex/stex";
|
||||||
import "codemirror/addon/fold/foldcode";
|
import "codemirror/addon/fold/foldcode";
|
||||||
import "codemirror/addon/fold/foldgutter";
|
import "codemirror/addon/fold/foldgutter";
|
||||||
import "codemirror/addon/fold/xml-fold";
|
import "codemirror/addon/fold/xml-fold";
|
||||||
|
@ -11,8 +13,22 @@ import "codemirror/addon/edit/closetag.js";
|
||||||
|
|
||||||
import { inCodable } from "./toolbar";
|
import { inCodable } from "./toolbar";
|
||||||
|
|
||||||
|
const latex = {
|
||||||
|
name: "stex",
|
||||||
|
inMathMode: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
const htmlanki = {
|
||||||
|
name: "htmlmixed",
|
||||||
|
tags: {
|
||||||
|
"anki-mathjax-inline": [[null, null, latex]],
|
||||||
|
"anki-mathjax-block": [[null, null, latex]],
|
||||||
|
"anki-mathjax-chemistry": [[null, null, latex]],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
const codeMirrorOptions = {
|
const codeMirrorOptions = {
|
||||||
mode: "htmlmixed",
|
mode: htmlanki,
|
||||||
theme: "monokai",
|
theme: "monokai",
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
lineWrapping: true,
|
lineWrapping: true,
|
||||||
|
|
Loading…
Reference in a new issue