Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: shikijs/shiki
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.14.6
Choose a base ref
...
head repository: shikijs/shiki
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.14.7
Choose a head ref
  • 11 commits
  • 33 files changed
  • 5 contributors

Commits on Dec 8, 2023

  1. 🤖: update grammars

    octref committed Dec 8, 2023
    Copy the full SHA
    1a0e4ab View commit details

Commits on Dec 11, 2023

  1. 🤖: update themes

    octref committed Dec 11, 2023
    Copy the full SHA
    8be7ec4 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3092339 View commit details

Commits on Dec 14, 2023

  1. 🤖: update grammars

    octref committed Dec 14, 2023
    Copy the full SHA
    c73fec6 View commit details

Commits on Dec 15, 2023

  1. chore: update themes sources

    antfu committed Dec 15, 2023
    Copy the full SHA
    e5b6122 View commit details
  2. feat: Add nushell grammar (#522)

    hustcer authored Dec 15, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5816d88 View commit details
  3. doc: fix typo (#544)

    Seven-Y-Q-Guo authored Dec 15, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    99444cf View commit details
  4. 🤖: update themes

    octref committed Dec 15, 2023
    Copy the full SHA
    3b4cf9d View commit details
  5. chore: remove hc_light theme

    antfu committed Dec 15, 2023
    Copy the full SHA
    fc94a2a View commit details
  6. docs: udpate changelog

    antfu committed Dec 15, 2023
    Copy the full SHA
    0cf3bc6 View commit details
  7. v0.14.7

    antfu committed Dec 15, 2023
    Copy the full SHA
    dff40b6 View commit details
Showing with 2,424 additions and 706 deletions.
  1. +9 −0 CHANGELOG.md
  2. +4 −4 README.md
  3. +2 −1 docs/languages.md
  4. +1 −1 docs/themes.md
  5. +1 −1 lerna.json
  6. +2 −2 packages/renderer-path/package.json
  7. +2 −2 packages/renderer-svg/package.json
  8. +4 −4 packages/shiki/languages/fsharp.tmLanguage.json
  9. +2 −6 packages/shiki/languages/java.tmLanguage.json
  10. +116 −35 packages/shiki/languages/julia.tmLanguage.json
  11. +72 −52 packages/shiki/languages/latex.tmLanguage.json
  12. +21 −2 packages/shiki/languages/lua.tmLanguage.json
  13. +2 −7 packages/shiki/languages/markdown.tmLanguage.json
  14. +941 −0 packages/shiki/languages/nushell.tmLanguage.json
  15. +2 −2 packages/shiki/languages/sql.tmLanguage.json
  16. +2 −2 packages/shiki/languages/swift.tmLanguage.json
  17. +2 −2 packages/shiki/languages/tex.tmLanguage.json
  18. +1 −1 packages/shiki/package.json
  19. +67 −0 packages/shiki/samples/nushell.sample
  20. +13 −3 packages/shiki/src/languages.ts
  21. +2 −2 packages/shiki/src/themes.ts
  22. +0 −566 packages/shiki/themes/hc_light.json
  23. +7 −0 packages/shiki/themes/material-theme-darker.json
  24. +7 −0 packages/shiki/themes/material-theme-lighter.json
  25. +7 −0 packages/shiki/themes/material-theme-ocean.json
  26. +7 −0 packages/shiki/themes/material-theme-palenight.json
  27. +7 −0 packages/shiki/themes/material-theme.json
  28. +1,095 −0 packages/shiki/themes/vitesse-black.json
  29. +3 −3 packages/site/package.json
  30. +2 −2 packages/vuepress-plugin/package.json
  31. +5 −5 pnpm-lock.yaml
  32. +3 −0 scripts/grammarSources.ts
  33. +13 −1 scripts/themeSources.ts
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.14.7 | 2023-12-15

### 🙌 Contributions

- doc: fix typo | [#544](https://github.com/shikijs/shiki/pull/544) | [@Seven-Y-Q-Guo](https://github.com/Seven-Y-Q-Guo)
- feat: Add `nushell` grammar | [#522](https://github.com/shikijs/shiki/pull/522) | [@hustcer](https://github.com/hustcer)
- feat: add `wl` alias for `wolfram` | [#535](https://github.com/shikijs/shiki/pull/535) | [@stone-zeng](https://github.com/stone-zeng)


## 0.14.6 | 2023-12-07

### 🚀 Features & Fixes
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -372,7 +372,7 @@ The default functionality of rendering code blocks would use `codeToHtml` from t
If you want to render the tokens into a code yourself, Shiki exposes two key methods to do that.
- `codeToThemedTokens` takes a code string and a language id and returns an array of tokens. A token represents a single part of the code, for example a keyword, a string, a comment, etc.
- `renderToHTML` takes an array of tokens and returns an HTML string that represents the provided code.
- `renderToHtml` takes an array of tokens and returns an HTML string that represents the provided code.
```js
import shiki, { getHighlighter } from 'shiki'
@@ -389,15 +389,15 @@ const code = `console.log("Here is your code.");`
const tokens = highlighter.codeToThemedTokens(code, 'javascript')

// This will return an HTML string that represents the provided code.
const html = shiki.renderToHTML(tokens)
const html = shiki.renderToHtml(tokens)
```
Alternatively you can add to `renderToHTML` the desired element shape for `pre`, `code`, `line (span)`, and `token (span)`, and override the theme colors for background and foreground.
Alternatively you can add to `renderToHtml` the desired element shape for `pre`, `code`, `line (span)`, and `token (span)`, and override the theme colors for background and foreground.
For more about that, or to build your own renderer, check out the implementation in [shiki](./packages/shiki/src/renderer.ts).
```js
const html = shiki.renderToHTML(tokens, {
const html = shiki.renderToHtml(tokens, {
fg: highlighter.getForegroundColor('nord'), // Set a specific foreground color.
bg: highlighter.getBackgroundColor('nord'), // Set a specific background color.
// Specified elements override the default elements.
3 changes: 2 additions & 1 deletion docs/languages.md
Original file line number Diff line number Diff line change
@@ -156,6 +156,7 @@ export type Lang =
| 'nginx'
| 'nim'
| 'nix'
| 'nushell' | 'nu'
| 'objective-c' | 'objc'
| 'objective-cpp'
| 'ocaml'
@@ -220,7 +221,7 @@ export type Lang =
| 'wasm'
| 'wenyan' | '文言'
| 'wgsl'
| 'wolfram'
| 'wolfram' | 'wl'
| 'xml'
| 'xsl'
| 'yaml' | 'yml'
2 changes: 1 addition & 1 deletion docs/themes.md
Original file line number Diff line number Diff line change
@@ -136,7 +136,6 @@ export type Theme =
| 'github-dark-dimmed'
| 'github-dark'
| 'github-light'
| 'hc_light'
| 'light-plus'
| 'material-theme-darker'
| 'material-theme-lighter'
@@ -156,6 +155,7 @@ export type Theme =
| 'slack-ochin'
| 'solarized-dark'
| 'solarized-light'
| 'vitesse-black'
| 'vitesse-dark'
| 'vitesse-light'
```
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": ["packages/*"],
"useWorkspaces": true,
"version": "0.14.6",
"version": "0.14.7",
"npmClient": "pnpm"
}
4 changes: 2 additions & 2 deletions packages/renderer-path/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": "true",
"name": "shiki-renderer-path",
"version": "0.14.6",
"version": "0.14.7",
"description": "Path renderer for shiki",
"author": "Pine Wu <octref@gmail.com>",
"homepage": "https://github.com/octref/shiki/tree/main/packages/renderer-path",
@@ -31,6 +31,6 @@
"@types/node": "^18.11.17",
"@types/opentype.js": "^1.3.4",
"opentype.js": "^1.3.4",
"shiki": "^0.14.6"
"shiki": "^0.14.7"
}
}
4 changes: 2 additions & 2 deletions packages/renderer-svg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shiki-renderer-svg",
"version": "0.14.6",
"version": "0.14.7",
"description": "SVG renderer for shiki",
"author": "Pine Wu <octref@gmail.com>",
"homepage": "https://github.com/octref/shiki/tree/main/packages/renderer-svg",
@@ -30,6 +30,6 @@
"devDependencies": {
"@types/node": "^18.11.17",
"playwright": "^1.29.0",
"shiki": "^0.14.6"
"shiki": "^0.14.7"
}
}
8 changes: 4 additions & 4 deletions packages/shiki/languages/fsharp.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/ionide/ionide-fsgrammar/commit/078bbf85225b82de3ae4c2db7ee74d9239b249ce",
"version": "https://github.com/ionide/ionide-fsgrammar/commit/472c6b2030c962217cbbb26e4ddcce1b8ffe0867",
"name": "fsharp",
"scopeName": "source.fsharp",
"patterns": [
@@ -600,7 +600,7 @@
},
{
"name": "comment.line.double-slash.fsharp",
"match": "(?<![!%&+-.<=>?@^|/])//(?![!%&+-.<=>?@^|]).*$"
"match": "(?<![!%&+-.<=>?@^|/])//(.*$)"
}
]
},
@@ -630,7 +630,7 @@
},
"abstract_definition": {
"name": "abstract.definition.fsharp",
"begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(:)",
"begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(<)?",
"end": "\\s*(with)\\b|=|$",
"beginCaptures": {
"1": {
@@ -676,7 +676,7 @@
}
},
{
"match": "(?!with|get|set\\b)\\b([\\w0-9'`^._]+)",
"match": "(?!with|get|set\\b)\\s*([\\w0-9'`^._]+)",
"comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted",
"captures": {
"1": {
8 changes: 2 additions & 6 deletions packages/shiki/languages/java.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/redhat-developer/vscode-java/commit/5d224a552cf5f0f8ebccf69e43e2575ed2c13839",
"version": "https://github.com/redhat-developer/vscode-java/commit/f09b712f5d6d6339e765f58c8dfab3f78a378183",
"name": "java",
"scopeName": "source.java",
"patterns": [
@@ -1598,11 +1598,7 @@
"name": "string.quoted.triple.java",
"patterns": [
{
"match": "\\\\\"\"\"",
"name": "constant.character.escape.java"
},
{
"match": "\\\\.",
"match": "(\\\\\"\"\")(?!\")|(\\\\.)",
"name": "constant.character.escape.java"
}
]
Loading