@nvl/sv-sveltex 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +73 -0
- package/dist/index.mjs +37798 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 N. V. Lang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# `@nvl/sv-sveltex`
|
|
2
|
+
|
|
3
|
+
> [!WARNING]
|
|
4
|
+
> **This package is in alpha.** It is brand new and under active development.
|
|
5
|
+
> Its API, behaviour, and configuration may change at any time, and breaking
|
|
6
|
+
> changes should be expected before version `1.0.0`.
|
|
7
|
+
|
|
8
|
+
A community [`sv`](https://svelte.dev/docs/cli/overview) add-on for
|
|
9
|
+
[SvelTeX](https://sveltex.dev) (Svelte + Markdown + LaTeX).
|
|
10
|
+
|
|
11
|
+
It adds SvelTeX to an **existing SvelteKit project**: it installs
|
|
12
|
+
[`@nvl/sveltex`](https://www.npmjs.com/package/@nvl/sveltex) and the peer
|
|
13
|
+
dependencies for the backends you pick, creates a `sveltex.config.{js,ts}`, and
|
|
14
|
+
wires the SvelTeX preprocessor and the `.sveltex` extension into your
|
|
15
|
+
`svelte.config.{js,ts}`.
|
|
16
|
+
|
|
17
|
+
> [!IMPORTANT]
|
|
18
|
+
> Svelte maintainers have not reviewed community add-ons for malicious code. Use
|
|
19
|
+
> at your discretion.
|
|
20
|
+
|
|
21
|
+
> [!NOTE]
|
|
22
|
+
> To create a **new** project, run `npx sv create` instead. To add SvelTeX to an
|
|
23
|
+
> existing project, use this add-on.
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
In an existing SvelteKit project, run:
|
|
28
|
+
|
|
29
|
+
```shell
|
|
30
|
+
npx sv add @nvl/sv-sveltex
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
...and follow the prompts.
|
|
34
|
+
|
|
35
|
+
## Options
|
|
36
|
+
|
|
37
|
+
All options can be set non-interactively via the `sv` CLI:
|
|
38
|
+
|
|
39
|
+
```shell
|
|
40
|
+
npx sv add @nvl/sv-sveltex="markdownBackend:unified+codeBackend:shiki+mathBackend:mathjax+demoRoute:yes"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### `markdownBackend`
|
|
44
|
+
|
|
45
|
+
The Markdown backend (parser). One of `unified` (default), `markdown-it`,
|
|
46
|
+
`micromark`, `marked`, or `none`.
|
|
47
|
+
|
|
48
|
+
### `codeBackend`
|
|
49
|
+
|
|
50
|
+
The code backend (syntax highlighter). One of `shiki` (default),
|
|
51
|
+
`starry-night`, `highlight.js`, `escape`, or `none`.
|
|
52
|
+
|
|
53
|
+
### `mathBackend`
|
|
54
|
+
|
|
55
|
+
The math backend. One of `mathjax` (default), `katex`, or `none`.
|
|
56
|
+
|
|
57
|
+
### `demoRoute`
|
|
58
|
+
|
|
59
|
+
Whether to add a sample `+page.sveltex` route at `/sveltex-demo`. `yes`
|
|
60
|
+
(default) or `no`.
|
|
61
|
+
|
|
62
|
+
## What it does
|
|
63
|
+
|
|
64
|
+
- Adds `@nvl/sveltex` and the chosen backends' peer dependencies as
|
|
65
|
+
`devDependencies`.
|
|
66
|
+
- Creates `sveltex.config.{js,ts}` with the SvelTeX factory.
|
|
67
|
+
- Adds the SvelTeX preprocessor and the `.sveltex` extension to
|
|
68
|
+
`svelte.config.{js,ts}`.
|
|
69
|
+
- Optionally creates a sample `src/routes/sveltex-demo/+page.sveltex` route.
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
[MIT](./LICENSE)
|