svelte-highlight 6.0.0 → 6.0.1
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/CHANGELOG.md +12 -0
- package/README.md +12 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [6.0.1](https://github.com/metonym/svelte-highlight/releases/tag/v6.0.1) - 2022-03-26
|
|
9
|
+
|
|
10
|
+
- update generated `SUPPORTED_LANGUAGES.md` and `SUPPORTED_STYLES.md`
|
|
11
|
+
|
|
12
|
+
## [6.0.0](https://github.com/metonym/svelte-highlight/releases/tag/v6.0.0) - 2022-03-26
|
|
13
|
+
|
|
14
|
+
**Breaking Changes**
|
|
15
|
+
|
|
16
|
+
- use SvelteKit to package the library and auto-generate TypeScript definitions
|
|
17
|
+
- styles are moved from `src/styles` to `styles`
|
|
18
|
+
- languages are moved from `src/languages` to `languages`
|
|
19
|
+
|
|
8
20
|
## [5.3.2](https://github.com/metonym/svelte-highlight/releases/tag/v5.3.2) - 2022-03-16
|
|
9
21
|
|
|
10
22
|
- specify in docs that vite should optimize both "highlight.js" and "highlight.js/lib/core" if using SvelteKit or vite
|
package/README.md
CHANGED
|
@@ -62,8 +62,8 @@ This component exports `highlight.js` themes in JavaScript. Import the theme fro
|
|
|
62
62
|
```svelte
|
|
63
63
|
<script>
|
|
64
64
|
import Highlight from "svelte-highlight";
|
|
65
|
-
import typescript from "svelte-highlight/
|
|
66
|
-
import github from "svelte-highlight/
|
|
65
|
+
import typescript from "svelte-highlight/languages/typescript";
|
|
66
|
+
import github from "svelte-highlight/styles/github";
|
|
67
67
|
|
|
68
68
|
const code = "const add = (a: number, b: number) => a + b;";
|
|
69
69
|
</script>
|
|
@@ -82,8 +82,8 @@ Depending on your set-up, importing a CSS StyleSheet in Svelte may require a CSS
|
|
|
82
82
|
```svelte
|
|
83
83
|
<script>
|
|
84
84
|
import { Highlight } from "svelte-highlight";
|
|
85
|
-
import typescript from "svelte-highlight/
|
|
86
|
-
import "svelte-highlight/
|
|
85
|
+
import typescript from "svelte-highlight/languages/typescript";
|
|
86
|
+
import "svelte-highlight/styles/github.css";
|
|
87
87
|
|
|
88
88
|
const code = "const add = (a: number, b: number) => a + b;";
|
|
89
89
|
</script>
|
|
@@ -98,9 +98,9 @@ Use the `HighlightSvelte` component for Svelte syntax highlighting.
|
|
|
98
98
|
```svelte
|
|
99
99
|
<script>
|
|
100
100
|
import { HighlightSvelte } from "svelte-highlight";
|
|
101
|
-
import github from "svelte-highlight/
|
|
101
|
+
import github from "svelte-highlight/styles/github";
|
|
102
102
|
|
|
103
|
-
$: code =
|
|
103
|
+
$: code = `<button on:click={() => { console.log(0); }}>Increment {count}</button>`;
|
|
104
104
|
</script>
|
|
105
105
|
|
|
106
106
|
<svelte:head>
|
|
@@ -114,10 +114,14 @@ Use the `HighlightSvelte` component for Svelte syntax highlighting.
|
|
|
114
114
|
|
|
115
115
|
The `HighlightAuto` component invokes the `highlightAuto` API from `highlight.js`.
|
|
116
116
|
|
|
117
|
+
Note that auto-highlighting will result in a larger bundle size in order to infer a language.
|
|
118
|
+
|
|
119
|
+
Prefer to specify a language if possible.
|
|
120
|
+
|
|
117
121
|
```svelte
|
|
118
122
|
<script>
|
|
119
123
|
import { HighlightAuto } from "svelte-highlight";
|
|
120
|
-
import github from "svelte-highlight/
|
|
124
|
+
import github from "svelte-highlight/styles/github";
|
|
121
125
|
|
|
122
126
|
$: code = `body {\n padding: 0;\n color: red;\n}`;
|
|
123
127
|
</script>
|
|
@@ -233,7 +237,7 @@ Refer to the highlight.js [language definition guide](https://highlightjs.readth
|
|
|
233
237
|
|
|
234
238
|
Svelte version 3.31 or greater is required to use this component with TypeScript.
|
|
235
239
|
|
|
236
|
-
TypeScript definitions are
|
|
240
|
+
TypeScript definitions are auto-generated by SvelteKit.
|
|
237
241
|
|
|
238
242
|
## [Supported Languages](SUPPORTED_LANGUAGES.md)
|
|
239
243
|
|