Skip to content

Commit

Permalink
docs: fix typo (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbzx10299 authored Feb 11, 2024
1 parent a4103a7 commit afe74d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docs/guide/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ We also provide some integrations:

### Shorthands

The quickest way to get started with `shiki` is to use the shorthands functions we provided. They will load the necessary themes and languages on demand and cache them in memory automatically.
The quickest way to get started with `shiki` is to use the provided shorthand functions. These will load the necessary themes and languages on demand, and automatically cache them in memory.

Passing your code snippet to the `codeToHtml` function with the `lang` and `theme` specified, it will return a highlighted HTML string that you can embed in your page. The generated HTML contains inline style for each token, so you don't need extra CSS to style it.

Expand Down Expand Up @@ -102,7 +102,7 @@ const code = highlighter.codeToHtml('const a = 1', {
})
```

In addition, if you want to load themes and languages after the highlighter is created, you can use the `loadTheme` and `loadLanguage` methods.
Additionally, if you want to load themes and languages after the highlighter is created, you can use the `loadTheme` and `loadLanguage` methods.

```ts twoslash
import { getHighlighter } from 'shiki'
Expand All @@ -113,7 +113,7 @@ await highlighter.loadTheme('vitesse-light')
await highlighter.loadLanguage('css')
```

Unlike `shiki` that loads all themes and languages by default, `shiki` requires all themes and languages to be loaded explicitly.
Unlike `shiki`, which loads all themes and languages by default, `shiki` requires all themes and languages to be loaded explicitly.

```ts theme:slack-dark twoslash
import { getHighlighter } from 'shiki'
Expand All @@ -132,7 +132,7 @@ highlighter.codeToHtml(
await highlighter.loadLanguage('javascript') // load the language
```

If you want to load all themes and languages (not recommended), you can iterate all keys from `bundledLanguages` and `bundledThemes`.
If you want to load all themes and languages (not recommended), you can iterate over all keys from `bundledLanguages` and `bundledThemes`.

```ts twoslash theme:poimandres
import { bundledLanguages, bundledThemes, getHighlighter } from 'shiki'
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/load-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ const html = highlighter.codeToHtml(code, {
})
```

The theme is a TextMate theme in JavaScript object. For example, [it should looks like this](https://github.com/antfu/textmate-grammars-themes/blob/main/packages/tm-themes/themes/dark-plus.json).
The theme is a TextMate theme in JavaScript object. For example, [it should look like this](https://github.com/antfu/textmate-grammars-themes/blob/main/packages/tm-themes/themes/dark-plus.json).

0 comments on commit afe74d2

Please sign in to comment.