diff --git a/package.json b/package.json index 4ca5c7e..5898796 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,10 @@ "cd": "pnpm run cd:build && pnpm run cd:push && pnpm run cd:rollout" }, "dependencies": { - "@vuetify/vite-plugin": "1.0.0-alpha.10", + "@auth0/auth0-vue": "^1.0.0", "@types/katex": "^0.14.0", "@types/uuid": "^8.3.4", + "@vuetify/vite-plugin": "1.0.0-alpha.10", "dependency-graph": "^0.11.0", "install": "^0.13.0", "katex": "^0.15.3", @@ -26,8 +27,7 @@ "uuid": "^8.3.2", "vue": "^3.2.25", "vue-router": "^4.0.14", - "vuetify": "3.0.0-beta.0", - "@auth0/auth0-vue": "^1.0.0" + "vuetify": "3.0.0-beta.0" }, "devDependencies": { "@braks/revue-draggable": "^0.4.2", diff --git a/src/assets/edit.svg b/src/assets/edit.svg new file mode 100644 index 0000000..b2805a9 --- /dev/null +++ b/src/assets/edit.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/Katex.vue b/src/components/Katex.vue index 420362c..acbc53b 100644 --- a/src/components/Katex.vue +++ b/src/components/Katex.vue @@ -1,5 +1,4 @@ diff --git a/src/components/Statement.vue b/src/components/Statement.vue index d7f56b0..214275d 100644 --- a/src/components/Statement.vue +++ b/src/components/Statement.vue @@ -25,16 +25,32 @@ computed(() => value = getValueStatement()) border: 1px solid #ccc; border-radius: 3px; padding: 10px; + display: flex; + flex-direction: row; + } + + .content { + flex: 1; + } + + .sidebar { + padding-left: 10px; } diff --git a/src/main.ts b/src/main.ts index 8fc3451..6c36c2d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,6 +8,10 @@ import 'vuetify/styles' // Global CSS has to be imported import { createVuetify } from 'vuetify' import * as components from 'vuetify/components' import * as directives from 'vuetify/directives' +import 'katex/dist/katex.min.css' +import 'katex/dist/contrib/auto-render.min' + + const app = createApp(App) const vuetify = createVuetify({ diff --git a/src/support/parse.ts b/src/support/parse.ts index f92b28c..6dfdae2 100644 --- a/src/support/parse.ts +++ b/src/support/parse.ts @@ -284,15 +284,18 @@ export class MathStatement { /** Render the statement as HTML string. */ toHTMLString(): HTMLString { return katex.renderToString(this.toLaTeX(), { - output: 'mathml', + output: 'html', }) as HTMLString } /** Render the statement to a DOM element. */ - toDOM(): HTMLSpanElement { - const node = document.createElement('span') + toDOM(node?: HTMLElement): HTMLSpanElement { + if ( !node ) { + node = document.createElement('span') + } + katex.render(this.toLaTeX(), node, { - output: 'mathml', + output: 'html', }) return node }