You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Please refer to https://github.com/antfu/contribute
7
7
This repository contains a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to `vscode-textmate`. By default `git clone` does not clone submodules. To clone this repository and its submodules, use:
An ESM-focused rewrite of [shiki](https://github.com/shikijs/shiki), a beautiful syntax highlighter based on TextMate grammars, with more features and capabilities.
9
+
A beautiful syntax highlighter based on TextMate grammars, accurate and powerful.
Copy file name to clipboardexpand all lines: docs/guide/bundles.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -4,31 +4,31 @@ outline: deep
4
4
5
5
# Bundles
6
6
7
-
The main `shikiji` entries bundles all supported themes and languages via lazy dynamic imports. The efficiency shouldn't be a concern to most of the scenarios as the grammar would only be imported/downloaded when it is used. However, when you bundle Shikiji into browsers runtime or web workers, even those files are not imported, they still add up to your dist size. We provide the [fine-grained bundle](/guide/install#fine-grained-bundle) to help you compose languages and themes one-by-one as you need.
7
+
The main `shiki` entries bundles all supported themes and languages via lazy dynamic imports. The efficiency shouldn't be a concern to most of the scenarios as the grammar would only be imported/downloaded when it is used. However, when you bundle Shiki into browsers runtime or web workers, even those files are not imported, they still add up to your dist size. We provide the [fine-grained bundle](/guide/install#fine-grained-bundle) to help you compose languages and themes one-by-one as you need.
8
8
9
9
To make it easier, we also provide some pre-composed bundles for you to use:
The bundle includes all themes and common web languages like (HTML, CSS, JS, TS, JSON, Markdown, etc.) and some web frameworks (Vue, JSX, Svelte, etc.).
22
22
23
-
Use as normal, all functions from `shikiji` are also available in the bundle:
23
+
Use as normal, all functions from `shiki` are also available in the bundle:
Copy file name to clipboardexpand all lines: docs/guide/compat.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -6,38 +6,38 @@ outline: deep
6
6
7
7
We took the chance of the rewrite to make some breaking changes that we think are beneficial for the future. We'd suggest you try to migrate those changes if possible, as most of them should be straightforward. If you have very deep integration, you can try our compatibility build which aligns better with `shiki`'s current API.
8
8
9
-
## Install `shikiji-compat`
9
+
## Install `shiki-compat`
10
10
11
-
<Badgesname="shikiji-compat" />
11
+
<Badgesname="shiki-compat" />
12
12
13
13
Set the alias to `shiki` in your `package.json`:
14
14
15
15
```json
16
16
{
17
17
"dependencies": {
18
-
"shiki": "npm:shikiji-compat@0.9"
18
+
"shiki": "npm:shiki-compat@0.9"
19
19
}
20
20
}
21
21
```
22
22
23
23
## Breaking Changes from Shiki
24
24
25
-
Compare to [`shiki@0.14.3`](https://github.com/shikijs/shiki/releases/tag/v0.14.3), the breaking changes between Shiki and Shikiji are:
25
+
Compare to [`shiki@0.14.3`](https://github.com/shikijs/shiki/releases/tag/v0.14.3), the breaking changes between Shiki and Shiki are:
26
26
27
27
### Hard Breaking Changes
28
28
29
-
Breaking changes applied to both `shikiji` and `shikiji-compat`:
29
+
Breaking changes applied to both `shiki` and `shiki-compat`:
30
30
31
31
- CJS and IIFE builds are dropped. See [CJS Usage](/guide/install#cjs-usage) and [CDN Usage](/guide/install#cdn-usage) for more details.
32
32
-`codeToHtml` uses [`hast`](https://github.com/syntax-tree/hast) internally. The generated HTML will be a bit different but should behave the same.
33
33
-`css-variables` theme is not supported. Use the [dual themes](/guide/dual-themes) approach instead, or learn more at the [Theme Colors Manipulation](/guide/theme-colors) page.
34
34
35
35
### Soft Breaking Changes
36
36
37
-
Breaking changes applies to `shikiji`, but are shimmed by `shikiji-compat`:
37
+
Breaking changes applies to `shiki`, but are shimmed by `shiki-compat`:
38
38
39
39
- Top-level named exports `setCDN`, `loadLanguage`, `loadTheme`, `setWasm` are dropped as they are not needed anymore.
40
-
-`BUNDLED_LANGUAGES`, `BUNDLED_THEMES` are moved to `shikiji/langs` and `shikiji/themes` and renamed to `bundledLanguages` and `bundledThemes` respectively.
40
+
-`BUNDLED_LANGUAGES`, `BUNDLED_THEMES` are moved to `shiki/langs` and `shiki/themes` and renamed to `bundledLanguages` and `bundledThemes` respectively.
41
41
-`theme` option for `getHighlighter` is dropped, use `themes` with an array instead.
42
42
- Highlighter does not maintain an internal default theme context. `theme` option is required for `codeToHtml` and `codeToThemedTokens`.
43
43
-`codeToThemedTokens` sets `includeExplanation` to `false` by default.
0 commit comments