Skip to content

Commit aeedf0c

Browse files
Move and rename themes (#3947)
- Move themes to the `src` folder and remove the `prism-` prefix - Adjust the build process accordingly - Adjust themes' metadata: - Remove broken links - Add/update authors' full names - Update GitHub handles - Use Markdown-style links - In `components.json`, fix theme ids and add Lea Verou as the owner to the prism, dark, and funky themes
1 parent b634abe commit aeedf0c

File tree

10 files changed

+36
-32
lines changed

10 files changed

+36
-32
lines changed

scripts/build.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ const languageIds = fs
2727
.sort();
2828
const pluginIds = fs.readdirSync(path.join(SRC_DIR, 'plugins')).sort();
2929
const themeIds = fs
30-
.readdirSync(path.join(SRC_DIR, '../themes'))
30+
.readdirSync(path.join(SRC_DIR, 'themes'))
31+
.filter(f => /\.css$/i.test(f))
3132
.map(f => f.slice(0, -'.css'.length))
3233
.sort();
3334

@@ -46,10 +47,8 @@ async function loadComponent (id: string) {
4647
async function minifyCSS () {
4748
const input: Record<string, string> = {};
4849

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

5554
for (const id of pluginIds) {

src/components.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,34 @@
1414
},
1515
"prism": {
1616
"title": "Default",
17-
"option": "default"
17+
"option": "default",
18+
"owner": "LeaVerou"
19+
},
20+
"dark": {
21+
"title": "Dark",
22+
"owner": "LeaVerou"
23+
},
24+
"funky": {
25+
"title": "Funky",
26+
"owner": "LeaVerou"
1827
},
19-
"prism-dark": "Dark",
20-
"prism-funky": "Funky",
21-
"prism-okaidia": {
28+
"okaidia": {
2229
"title": "Okaidia",
2330
"owner": "ocodia"
2431
},
25-
"prism-twilight": {
32+
"twilight": {
2633
"title": "Twilight",
2734
"owner": "remybach"
2835
},
29-
"prism-coy": {
36+
"coy": {
3037
"title": "Coy",
3138
"owner": "tshedor"
3239
},
33-
"prism-solarizedlight": {
40+
"solarizedlight": {
3441
"title": "Solarized Light",
3542
"owner": "hectormatos2011 "
3643
},
37-
"prism-tomorrow": {
44+
"tomorrow": {
3845
"title": "Tomorrow Night",
3946
"owner": "Rosey"
4047
}

themes/prism-coy.css renamed to src/themes/coy.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML
3-
* 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);
4-
* @author Tim Shedor
3+
* Based on https://github.com/tshedor/workshop-wp-theme.
4+
* @author Tim Shedor
55
*/
66

77
code[class*="language-"],

themes/prism-dark.css renamed to src/themes/dark.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* prism.js Dark theme for JavaScript, CSS and HTML
3-
* Based on the slides of the talk “/Reg(exp){2}lained/”
3+
* Based on the slides of the talk [“/Reg(exp){2}lained/”](https://regexplained.com/slides.html).
44
* @author Lea Verou
55
*/
66

themes/prism-funky.css renamed to src/themes/funky.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* prism.js Funky theme
3-
* Based on “Polyfilling the gaps” talk slides http://lea.verou.me/polyfilling-the-gaps/
3+
* Based on [“Polyfilling the gaps”](https://talks.verou.me/polyfilling-the-gaps/) talk slides.
44
* @author Lea Verou
55
*/
66

themes/prism-okaidia.css renamed to src/themes/okaidia.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* okaidia theme for JavaScript, CSS and HTML
3-
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
4-
* @author ocodia
2+
* prism.js Okaidia theme for JavaScript, CSS and HTML
3+
* Loosely based on Monokai textmate theme by https://monokai.com/.
4+
* @author Paul Livingstone
55
*/
66

77
code[class*="language-"],

themes/prism.css renamed to src/themes/prism.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* prism.js default theme for JavaScript, CSS and HTML
3-
* Based on dabblet (http://dabblet.com)
3+
* Based on [dabblet](https://dabblet.com).
44
* @author Lea Verou
55
*/
66

themes/prism-solarizedlight.css renamed to src/themes/solarizedlight.css

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
/*
2-
Solarized Color Schemes originally by Ethan Schoonover
3-
http://ethanschoonover.com/solarized
4-
5-
Ported for PrismJS by Hector Matos
6-
Website: https://krakendev.io
7-
Twitter Handle: https://twitter.com/allonsykraken)
1+
/**
2+
* prism.js Solarized Light theme
3+
* Based on [Solarized Color Schemes](https://ethanschoonover.com/solarized) by Ethan Schoonover.
4+
* @author Hector Matos
85
*/
96

107
/*

themes/prism-tomorrow.css renamed to src/themes/tomorrow.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML
3-
* Based on https://github.com/chriskempson/tomorrow-theme
4-
* @author Rose Pritchard
2+
* prism.js Tomorrow Night theme for JavaScript, CoffeeScript, CSS and HTML
3+
* Based on https://github.com/chriskempson/tomorrow-theme.
4+
* @author Rose Robertson
55
*/
66

77
code[class*="language-"],

themes/prism-twilight.css renamed to src/themes/twilight.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/**
22
* prism.js Twilight theme
33
* Based (more or less) on the Twilight theme originally of Textmate fame.
4-
* @author Remy Bach
4+
* @author Rémy Bach
55
*/
6+
67
code[class*="language-"],
78
pre[class*="language-"] {
89
color: white;

0 commit comments

Comments
 (0)