Skip to content

Commit b615a94

Browse files
committed
notification for initialization
1 parent 3c35097 commit b615a94

9 files changed

Lines changed: 306 additions & 226 deletions

package-lock.json

Lines changed: 139 additions & 206 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lemniscate",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"license": "MIT",
55
"scripts": {
66
"dev": "vite dev",
@@ -27,31 +27,32 @@
2727
},
2828
"devDependencies": {
2929
"@codemirror/lang-markdown": "^6.5.0",
30-
"@embedpdf/core": "^2.6.0",
31-
"@embedpdf/engines": "^2.6.0",
32-
"@embedpdf/plugin-document-manager": "^2.6.0",
33-
"@embedpdf/plugin-export": "^2.6.0",
34-
"@embedpdf/plugin-fullscreen": "^2.6.0",
35-
"@embedpdf/plugin-print": "^2.6.0",
36-
"@embedpdf/plugin-render": "^2.6.0",
37-
"@embedpdf/plugin-scroll": "^2.6.0",
38-
"@embedpdf/plugin-spread": "^2.6.0",
39-
"@embedpdf/plugin-viewport": "^2.6.0",
40-
"@embedpdf/plugin-zoom": "^2.6.0",
30+
"@embedpdf/core": "^2.6.2",
31+
"@embedpdf/engines": "^2.6.2",
32+
"@embedpdf/plugin-document-manager": "^2.6.2",
33+
"@embedpdf/plugin-export": "^2.6.2",
34+
"@embedpdf/plugin-fullscreen": "^2.6.2",
35+
"@embedpdf/plugin-print": "^2.6.2",
36+
"@embedpdf/plugin-render": "^2.6.2",
37+
"@embedpdf/plugin-scroll": "^2.6.2",
38+
"@embedpdf/plugin-spread": "^2.6.2",
39+
"@embedpdf/plugin-tiling": "^2.6.2",
40+
"@embedpdf/plugin-viewport": "^2.6.2",
41+
"@embedpdf/plugin-zoom": "^2.6.2",
4142
"@sveltejs/adapter-static": "^3.0.10",
4243
"@sveltejs/package": "^2.5.7",
4344
"@sveltejs/vite-plugin-svelte": "^6.2.4",
4445
"@types/file-saver": "^2.0.7",
45-
"@types/node": "^25.2.3",
46-
"carbon-components-svelte": "^0.99.3",
46+
"@types/node": "^25.3.0",
47+
"carbon-components-svelte": "^0.101.0",
4748
"carbon-icons-svelte": "^13.8.0",
4849
"cm6-theme-basic-dark": "^0.2.0",
4950
"cm6-theme-basic-light": "^0.2.0",
5051
"file-saver": "^2.0.5",
5152
"pandoc-wasm": "^1.0.1",
5253
"publint": "^0.3.17",
53-
"svelte": "^5.50.2",
54-
"svelte-check": "^4.3.6",
54+
"svelte": "^5.53.0",
55+
"svelte-check": "^4.4.3",
5556
"svelte-codemirror-editor": "^2.1.0",
5657
"svelte-idle": "^3.0.1",
5758
"texlyre-busytex": "^0.1.2-alpha",

src/lib/Notification.svelte

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script module lang='ts'>
2+
import { writable } from 'svelte/store';
3+
export const openNotification = writable<boolean>(false);
4+
</script>
5+
6+
<script lang='ts'>
7+
import { ToastNotification } from "carbon-components-svelte";
8+
</script>
9+
10+
<div
11+
style:position='fixed'
12+
style:right='1rem'
13+
style:top='1rem'
14+
style:z-index={10}
15+
>
16+
<ToastNotification
17+
bind:open={$openNotification}
18+
kind='warning'
19+
title='Please Wait'
20+
caption='Busytex is initializing'
21+
timeout={3000}
22+
/>
23+
</div>

src/lib/PDFViewer.svelte

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
SpreadMode
3232
} from '@embedpdf/plugin-spread/svelte'
3333
import { FullscreenPluginPackage } from '@embedpdf/plugin-fullscreen/svelte';
34+
/*import {
35+
TilingLayer,
36+
TilingPluginPackage
37+
} from '@embedpdf/plugin-tiling/svelte';*/
3438
3539
import { SettingsStore } from './stores.ts';
3640
import PDFPluginLoader from './PDFPluginLoader.svelte';
@@ -47,7 +51,7 @@
4751
const pdfEngine = usePdfiumEngine();
4852
const plugins = [
4953
createPluginRegistration(DocumentManagerPluginPackage, {
50-
initialDocuments: [{ url: asset('initial.pdf') }]
54+
initialDocuments: [{ url: asset('using-lemniscate-editor.pdf') }]
5155
}),
5256
createPluginRegistration(ViewportPluginPackage),
5357
createPluginRegistration(ScrollPluginPackage),
@@ -60,7 +64,12 @@
6064
createPluginRegistration(SpreadPluginPackage, {
6165
defaultSpreadMode: SpreadMode.None
6266
}),
63-
createPluginRegistration(FullscreenPluginPackage)
67+
createPluginRegistration(FullscreenPluginPackage),
68+
/*createPluginRegistration(TilingPluginPackage, {
69+
tileSize: 768,
70+
overlapPx: 5,
71+
extraRings: 0
72+
})*/
6473
];
6574
6675
let docManager: DocumentManager | undefined = $state(undefined);
@@ -126,7 +135,15 @@
126135
style:height='{page.height}px'
127136
style:position='relative'
128137
>
129-
<RenderLayer {documentId} pageIndex={page.pageIndex} />
138+
<RenderLayer
139+
{documentId}
140+
pageIndex={page.pageIndex}
141+
scale={1.0}
142+
/>
143+
<!--TilingLayer
144+
{documentId}
145+
pageIndex={page.pageIndex}
146+
/-->
130147
</div>
131148
{/snippet}
132149
<PDFPluginLoader

src/routes/+layout.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
Theme
88
} from 'carbon-components-svelte';
99
10+
import Notification from '$lib/Notification.svelte';
1011
import { SettingsStore } from '../lib/stores.ts';
1112
1213
let { children } = $props();
1314
</script>
1415

1516
<Theme theme={$SettingsStore.theme === 'light' ? 'g10' : 'g90'} />
16-
<Content>{@render children()}</Content>
17+
<Content>
18+
<Notification />
19+
{@render children()}
20+
</Content>

src/routes/+page.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import SettingsModal from '$lib/SettingsModal.svelte';
4848
import PDFViewer from '$lib/PDFViewer.svelte';
4949
50+
import { openNotification } from '$lib/Notification.svelte';
5051
import {
5152
ConfigStore,
5253
EditorStore,
@@ -104,6 +105,10 @@
104105
}
105106
106107
const compile = async (): Promise<void> => {
108+
if (!runner.isInitialized()) {
109+
openNotification.set(true);
110+
return;
111+
}
107112
let metablock = `---\nlinkcolor: blue\n`;
108113
if ($ConfigStore.title !== '') metablock += `title: ${$ConfigStore.title}\n`;
109114
if ($ConfigStore.author !== '') metablock += `author: ${$ConfigStore.author}\n`;

static/initial.pdf

-191 KB
Binary file not shown.

static/using-lemniscate-editor.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Heading One
2+
## Heading Two
3+
### Heading Three
4+
5+
```
6+
# Heading One
7+
## Heading Two
8+
### Heading Three
9+
```
10+
11+
\hrulefill
12+
13+
There is **bold** text and *italic* text and ***bold italic*** text.
14+
15+
Links can be [included](https://lemniscate-editor.github.io/).
16+
17+
> Block quotes push text in
18+
19+
```
20+
There is **bold** text and *italic* text and ***bold italic*** text.
21+
22+
Links can be [included](https://lemniscate-editor.github.io/).
23+
24+
> Block quotes push text in
25+
```
26+
27+
\hrulefill
28+
29+
1. Ordered lists are numbered
30+
2. Using the number and a period
31+
32+
- Unordered list are possible
33+
- You can use a hyphen, asterisk, or plus sign
34+
- You can nest lists, too
35+
- Just indent a couple spaces before the hyphen
36+
37+
```
38+
1. Ordered lists are numbered
39+
2. Using the number and a period
40+
41+
- Unordered list are possible
42+
- You can use a hyphen, asterisk, or plus sign
43+
- You can nest lists, too
44+
- Just indent a couple spaces before the hyphen
45+
```
46+
47+
\hrulefill
48+
49+
New paragraphs are created by...
50+
51+
...having an empty line between the lines.
52+
But two spaces at the end of line will do a line break.
53+
54+
You can insert \LaTeX directly, including creating vertical space with `\vspace{}`, horizontal rules with `\hrulefill`, and page breaks with `\pagebreak`.
55+
56+
\pagebreak
57+
58+
Math can be inserted inlined by surrounding the math with single dollar signs like `$f(x)=2x$` to create $f(x)=2x$, or displayed centered by surrounding it with two dollar signs like `$$f(x)=2x$$` to create $$f(x)=2x$$
59+
60+
Some symbols, such as `+`, `-`, `=`, `<`, and `>`, do not require special formatting, while others do:
61+
62+
- `\div` $\to\div$
63+
- `\cdot` $\to\cdot$
64+
- `\ast` $\to\ast$
65+
- `\pm` $\to\;\pm$
66+
- `\neq` $\to\;\neq$
67+
- `\approx` $\to\;\approx$
68+
- `\leq` $\to\;\leq$
69+
- `\geq` $\to\;\geq$
70+
71+
\vspace{1em}
72+
73+
Superscripts are created with `^` and subscripts with `_`. If the argument is more than one character, it is enclosed between `{}`. Examples: `x^4` $\to\;x^4$, `a_5` $\to\;a_5$, `2^{3y}` $\to\;2^{3y}$
74+
75+
Fractions can be displayed nicely using `\frac{}{}` and `\dfrac{}{}`, with the former better suited for inline and the latter for displayed equations. Examples: `\frac{1}{x}` $\to\;\frac{1}{x}$ and `\dfrac{e^x}{1-x}` $\to$ $$\dfrac{e^x}{1-x}$$
76+
77+
Parentheses and square brackets (mostly) work as expected, while curly braces need to be escaped like `\{` and `\}`. However, none of them grow automatically if the equation grows, like with fractions. This can be done by inserting `\left` and `\right` before the corresponding fences. Example: `\left(\dfrac{1}{x^2}\right)` $\to\;\left(\dfrac{1}{x^2}\right)$
78+
79+
\vspace{1em}
80+
81+
Radicals are expressed with `\sqrt[]{}`, where the index of the radical is in the square brackets and the radicand in the curly braces. If the index is omitted, it is not drawn, and the result is a square root.
82+
Examples: `\sqrt{x}` $\to\;\sqrt{x}$ and `\sqrt[3]{343}` $\to\;\sqrt[3]{343}$
83+
84+
In order for some functions to stand out from variables, they have a backslash before the function. These include trigonometric functions (`\sin`), plus their inverses (`\arccos`) and hyperbolic forms (`\tanh`), and logarithmic functions (`\log` and `\ln`). Plain text can be added with `\text{}`.
85+
86+
Limits, summations, and integrals all have their own formatting, with `\lim`, `\sum`, and `\int` respectively. Bounds can be included with subscripts and superscripts immediately following the function name. You can also put `\limits` between the function and the bounds to force them under the symbol.
87+
Examples: `\int_{0}^{\infty}{f(x)dx}` $\to\;\int_{0}^{\infty}{f(x)dx}$ and `\sum\limits_{i=1}^{n}i=\dfrac{n(n+1)}{2}` $\to$ $$\sum\limits_{i=1}^{n}i=\dfrac{n(n+1)}{2}$$
88+
89+
Greek letters are accessed by typing the name of the letter after a backslash. If the name is capitalized, then it yields the capital Greek letter. Examples: `\pi` $\to\;\pi$, `\theta` $\to\;\theta$, `\Delta` $\to\;\Delta$
90+
91+
A variety of geometric symbols are also available. Some examples are below:
92+
93+
- `m\angle{Q}=40^\circ` $\to\;m\angle{Q}=40^\circ$
94+
- `\angle{ABC}\cong\angle{DEF}` $\to\;\angle{ABC}\cong\angle{DEF}$
95+
- `\Delta PQR\sim\Delta LMN` $\to\;\Delta PQR\sim\Delta LMN$
96+
- `\overline{XY}\perp\overline{YZ}` $\to\;\overline{XY}\perp\overline{YZ}$
97+
- `\overleftrightarrow{RS}\parallel\overleftrightarrow{UV}` $\to\;\overleftrightarrow{RS}\parallel\overleftrightarrow{UV}$

static/using-lemniscate-editor.pdf

259 KB
Binary file not shown.

0 commit comments

Comments
 (0)