forked from nodejs/nodejs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shiki.config.mjs
70 lines (67 loc) · 1.94 KB
/
shiki.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
'use strict';
import diffLanguage from 'shiki/langs/diff.mjs';
import dockerLanguage from 'shiki/langs/docker.mjs';
import javaScriptLanguage from 'shiki/langs/javascript.mjs';
import jsonLanguage from 'shiki/langs/json.mjs';
import powershellLanguage from 'shiki/langs/powershell.mjs';
import shellScriptLanguage from 'shiki/langs/shellscript.mjs';
import shellSessionLanguage from 'shiki/langs/shellsession.mjs';
import typeScriptLanguage from 'shiki/langs/typescript.mjs';
import shikiNordTheme from 'shiki/themes/nord.mjs';
/** @type {Array<import('shiki').LanguageRegistration>} */
export const LANGUAGES = [
{
...javaScriptLanguage[0],
scopeName: 'source.js',
aliases: ['mjs', 'cjs', 'js'],
displayName: 'JavaScript',
},
{
...jsonLanguage[0],
scopeName: 'source.json',
displayName: 'JSON',
},
{
...typeScriptLanguage[0],
scopeName: 'source.ts',
aliases: ['ts'],
displayName: 'TypeScript',
},
{
...shellScriptLanguage[0],
scopeName: 'source.shell',
aliases: ['bash', 'sh', 'shell', 'zsh'],
displayName: 'Bash',
},
{
...powershellLanguage[0],
scopeName: 'source.powershell',
aliases: ['ps', 'ps1'],
displayName: 'PowerShell',
},
{
...shellSessionLanguage[0],
scopeName: 'text.shell-session',
aliases: ['console'],
displayName: 'Bash',
},
{
...dockerLanguage[0],
scopeName: 'source.dockerfile',
aliases: ['dockerfile'],
displayName: 'Dockerfile',
},
{
...diffLanguage[0],
scopeName: 'source.diff',
displayName: 'Diff',
},
];
// This is the default theme we use for our Shiki Syntax Highlighter
export const DEFAULT_THEME = {
// We updating this color because the background color and comment text color
// in the Codebox component do not comply with accessibility standards
// @see https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html
colorReplacements: { '#616e88': '#707e99' },
...shikiNordTheme,
};