Skip to content

Commit

Permalink
Merge arrays deeper into source
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Dec 28, 2023
1 parent c61e910 commit ed97380
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions plugins/shiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,20 @@ import collect from 'collect.js';
setCDN('/shiki/');
setWasm('/shiki/dist/onig.wasm');

const preloadedThemes = ['github-light'];
const preloadedLangs = [
'html',
'html-derivative',
'xml',
'sql',
'javascript',
'json',
'css',
'php',
'php-html',
];

const customThemes = ['bluloco-light', 'bluloco-dark', 'rajoyish'];

const langAliases = ['bash', 'shell'];
const excludedLangs = ['php-html', 'html-derivative'];

export default async (context, inject) => {
const highlighter = await getHighlighter({
themes: preloadedThemes,
langs: preloadedLangs,
themes: ['github-light'],
langs: [
'html',
'html-derivative',
'xml',
'sql',
'javascript',
'json',
'css',
'php',
'php-html',
],
});

const shiki = {
Expand Down Expand Up @@ -60,10 +52,14 @@ export default async (context, inject) => {
},

languages() {
const excludedLangs = ['php-html', 'html-derivative'];

const langs = BUNDLED_LANGUAGES.filter((lang) => !excludedLangs.includes(lang.id)).map(
(lang) => lang.id
);

const langAliases = ['bash', 'shell'];

return [...langs, ...langAliases];
},

Expand All @@ -78,7 +74,7 @@ export default async (context, inject) => {
themes() {
return collect(BUNDLED_THEMES)
.filter((theme) => !['slack-ochin', 'css-variables'].some((t) => theme.includes(t)))
.merge(customThemes)
.merge(['bluloco-light', 'bluloco-dark', 'rajoyish'])
.sort()
.toArray();
},
Expand Down

0 comments on commit ed97380

Please sign in to comment.