Commit 28a4cc33 authored by Bruno Burke's avatar Bruno Burke 😁

add favicon; katex as npm dependency

parent 17c331fb
Pipeline #44900 passed with stages
in 1 minute and 49 seconds
......@@ -14,6 +14,7 @@
"tinymce": "^5.2.1",
"quill": "^1.3.5",
"prismjs": "1.19.0",
"katex": "0.12.0",
"bulma": "0.9.0",
"bulma-calendar": "6.0.0"
},
......
......@@ -10,7 +10,6 @@
[garden "1.3.10"]
[hickory "0.7.1"]
[binaryage/oops "0.7.0"]
[cljsjs/katex "0.11.1-0"]
[clj-http "3.10.1"]
[wwsoftware/clj-helper "0.0.3.2"]
[cljs-ajax "0.8.0"]
......
......@@ -10,23 +10,23 @@
<link rel="stylesheet" href="node_modules/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="css/screen.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/katex.min.js" integrity="sha384-jmxIlussZWB7qCuB+PgKG1uLjjxbVVIayPJwi6cG6Zb4YKq0JIw+OMnkkEC7kYCq" crossorigin="anonymous"></script>
<link rel="stylesheet" href="node_modules/quill/dist/quill.snow.css">
<script src="node_modules/sortablejs/Sortable.js"></script>
<script src="node_modules/codemirror/lib/codemirror.js"></script>
<script src="node_modules/codemirror/mode/python/python.js"></script>
<script src="node_modules/katex/dist/katex.js"></script>
<script src="node_modules/katex/dist/contrib/auto-render.min.js"></script>
<link rel="stylesheet" href="node_modules/katex/dist/katex.css">
<script src="node_modules/mathjs/dist/math.min.js"></script>
<link rel="stylesheet" href="node_modules/codemirror/lib/codemirror.css">
<style id="com-rigsomelight-devcards-addons-css"></style>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/katex.min.css" integrity="sha384-TEMocfGvRuD1rIAacqrknm5BQZ7W7uWitoih+jMNFXQIbNl16bO8OZmylH/Vi/Ei" crossorigin="anonymous">
<div id="app"></div>
<script src="cljs-out/dev-main-devcards.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/contrib/auto-render.min.js" integrity="sha384-IiI65aU9ZYub2MY9zhtKd1H2ps7xxf+eb2YFG9lX6uRqpXCvBTOidPRCXCrQ++Uc" crossorigin="anonymous"></script>
</body>
</html>
(ns lernmeister.components.common
(:require [reagent.core :as reagent]
[reagent.dom :as rdom]
[cljsjs.katex]
[lernmeister.components.ui :as ui]
[lernmeister.components.static-content.images :refer [the-scream]]))
......@@ -17,6 +16,8 @@
:else "")))
(defn renderMath [id]
(js/console.warn "renderMath is deprecated.")
;;;TODO solution without katex-autorenderer
(when-let [render-fn (resolve 'js/renderMathInElement)]
(render-fn
(js/document.getElementById (str id))
......
(ns lernmeister.components.content-elements.text
(:require [reagent.core :as reagent]
[lernmeister.components.common :as common]))
(defn content-element [element]
(let [id (str (gensym))]
(reagent/create-class
{:component-did-update #(common/renderMath id)
:component-did-mount #(common/renderMath id)
:reagent-render
(fn [element]
[:p.content-element.ce-text.flow-text
{:id id} (:value element)])})))
(defn init-element [add-fn]
(add-fn "text" content-element :label "Text (unformatiert)"))
......@@ -11,7 +11,6 @@
[lernmeister.components.content-elements.exercise.show :as exercise]
[lernmeister.components.exercise-types.core :refer [get-exercise get-types]]
[lernmeister.components.content-elements.core :as content-manager]
[lernmeister.components.content-elements.text :as ce-text]
[lernmeister.components.material-design :as md]
[clojure.pprint :refer [pprint]]
[devcards.core]
......@@ -37,7 +36,7 @@
(defn show-text []
(fn []
[:div
[ce-text/content-element @content-element]
[content-manager/show @content-element]
])
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment