Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions scripts/build.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs';
import { copyFile, mkdir, readdir, readFile, rm, writeFile } from 'fs/promises';

Check warning on line 2 in scripts/build.ts

View workflow job for this annotation

GitHub Actions / lint

'readdir' is defined but never used
import path from 'path';
import { fileURLToPath } from 'url';
import commonjs from '@rollup/plugin-commonjs';
Expand Down Expand Up @@ -27,7 +27,8 @@
.sort();
const pluginIds = fs.readdirSync(path.join(SRC_DIR, 'plugins')).sort();
const themeIds = fs
.readdirSync(path.join(SRC_DIR, '../themes'))
.readdirSync(path.join(SRC_DIR, 'themes'))
.filter(f => /\.css$/i.test(f))
.map(f => f.slice(0, -'.css'.length))
.sort();

Expand All @@ -46,10 +47,8 @@
async function minifyCSS () {
const input: Record<string, string> = {};

const THEMES_DIR = path.join(__dirname, '../themes');
const themes = await readdir(THEMES_DIR);
for (const theme of themes.filter(f => /\.css$/i.test(f))) {
input[`themes/${theme}`] = path.join(THEMES_DIR, theme);
for (const id of themeIds) {
input[`themes/${id}.css`] = path.join(SRC_DIR, `themes/${id}.css`);
}

for (const id of pluginIds) {
Expand Down Expand Up @@ -241,7 +240,7 @@
renderChunk (code) {
const str = new MagicString(code);
str.replace(
/\/((?:[^\n\r[\\\/]|\\.|\[(?:[^\n\r\\\]]|\\.)*\])+)\/\s*\.\s*source\b/g,

Check warning on line 243 in scripts/build.ts

View workflow job for this annotation

GitHub Actions / lint

Unnecessary escape character: \/
(m, source: string) => {
// escape backslashes
source = source.replace(/\\(.)|\[(?:\\s\\S|\\S\\s)\]/g, (m, g1: string) => {
Expand Down Expand Up @@ -283,7 +282,7 @@
renderChunk (code) {
const str = new MagicString(code);
str.replace(
/^(?<indent>[ \t]+)grammar: (\{[\s\S]*?^\k<indent>\})/m,

Check warning on line 285 in scripts/build.ts

View workflow job for this annotation

GitHub Actions / lint

The quantifier '[\s\S]*?' is always entered despite having a minimum of 0. This is because the assertion '^' contradicts with the element(s) after the quantifier. Either set the minimum to 1 (+?) or change the assertion
(m, _, grammar: string) => `\tgrammar: () => (${grammar})`
);
return toRenderedChunk(str);
Expand Down
23 changes: 15 additions & 8 deletions src/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,34 @@
},
"prism": {
"title": "Default",
"option": "default"
"option": "default",
"owner": "LeaVerou"
},
"dark": {
"title": "Dark",
"owner": "LeaVerou"
},
"funky": {
"title": "Funky",
"owner": "LeaVerou"
},
"prism-dark": "Dark",
"prism-funky": "Funky",
"prism-okaidia": {
"okaidia": {
"title": "Okaidia",
"owner": "ocodia"
},
"prism-twilight": {
"twilight": {
"title": "Twilight",
"owner": "remybach"
},
"prism-coy": {
"coy": {
"title": "Coy",
"owner": "tshedor"
},
"prism-solarizedlight": {
"solarizedlight": {
"title": "Solarized Light",
"owner": "hectormatos2011 "
},
"prism-tomorrow": {
"tomorrow": {
"title": "Tomorrow Night",
"owner": "Rosey"
}
Expand Down
4 changes: 2 additions & 2 deletions themes/prism-coy.css → src/themes/coy.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML
* Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics);
* @author Tim Shedor
* Based on https://github.com/tshedor/workshop-wp-theme.
* @author Tim Shedor
*/

code[class*="language-"],
Expand Down
2 changes: 1 addition & 1 deletion themes/prism-dark.css → src/themes/dark.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* prism.js Dark theme for JavaScript, CSS and HTML
* Based on the slides of the talk “/Reg(exp){2}lained/”
* Based on the slides of the talk [“/Reg(exp){2}lained/”](https://regexplained.com/slides.html).
* @author Lea Verou
*/

Expand Down
2 changes: 1 addition & 1 deletion themes/prism-funky.css → src/themes/funky.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* prism.js Funky theme
* Based on “Polyfilling the gaps” talk slides http://lea.verou.me/polyfilling-the-gaps/
* Based on [“Polyfilling the gaps”](https://talks.verou.me/polyfilling-the-gaps/) talk slides.
* @author Lea Verou
*/

Expand Down
6 changes: 3 additions & 3 deletions themes/prism-okaidia.css → src/themes/okaidia.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* okaidia theme for JavaScript, CSS and HTML
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
* @author ocodia
* prism.js Okaidia theme for JavaScript, CSS and HTML
* Loosely based on Monokai textmate theme by https://monokai.com/.
* @author Paul Livingstone
*/

code[class*="language-"],
Expand Down
2 changes: 1 addition & 1 deletion themes/prism.css → src/themes/prism.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* Based on [dabblet](https://dabblet.com).
* @author Lea Verou
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
Solarized Color Schemes originally by Ethan Schoonover
http://ethanschoonover.com/solarized

Ported for PrismJS by Hector Matos
Website: https://krakendev.io
Twitter Handle: https://twitter.com/allonsykraken)
/**
* prism.js Solarized Light theme
* Based on [Solarized Color Schemes](https://ethanschoonover.com/solarized) by Ethan Schoonover.
* @author Hector Matos
*/

/*
Expand Down
6 changes: 3 additions & 3 deletions themes/prism-tomorrow.css → src/themes/tomorrow.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML
* Based on https://github.com/chriskempson/tomorrow-theme
* @author Rose Pritchard
* prism.js Tomorrow Night theme for JavaScript, CoffeeScript, CSS and HTML
* Based on https://github.com/chriskempson/tomorrow-theme.
* @author Rose Robertson
*/

code[class*="language-"],
Expand Down
3 changes: 2 additions & 1 deletion themes/prism-twilight.css → src/themes/twilight.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/**
* prism.js Twilight theme
* Based (more or less) on the Twilight theme originally of Textmate fame.
* @author Remy Bach
* @author Rémy Bach
*/

code[class*="language-"],
pre[class*="language-"] {
color: white;
Expand Down
Loading