Project reorganization, add editorconfig and linter

This commit is contained in:
Ludwig Schubert
2017-08-09 16:47:35 -07:00
parent 07c7527734
commit 11eda0fc49
75 changed files with 1120 additions and 17117 deletions
+28
View File
@@ -0,0 +1,28 @@
import katex from "katex";
import { Mutating } from "../mixins/mutating.js"
import { Template } from "../mixins/template.js"
import katexCSS from "../../node_modules/katex/dist/katex.min.css"
const T = Template("d-math", `
<style>
d-math[block] {
display: block;
}
${katexCSS}
</style>
<span id="katex-container"></span>
`);
export class DMath extends Mutating(T(HTMLElement)) {
renderContent() {
const options = { displayMode: this.hasAttribute("block") };
const container = this.root.querySelector("#katex-container");
katex.render(this.textContent, container, options);
}
}