diff --git a/scripts/build.ts b/scripts/build.ts index 9b5c13a7b2..33b2a17b20 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -27,7 +27,8 @@ const languageIds = fs .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(); @@ -46,10 +47,8 @@ async function loadComponent (id: string) { async function minifyCSS () { const input: Record = {}; - 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) { diff --git a/src/components.json b/src/components.json index 162e5ecf21..d349a7f244 100644 --- a/src/components.json +++ b/src/components.json @@ -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" } diff --git a/themes/prism-coy.css b/src/themes/coy.css similarity index 94% rename from themes/prism-coy.css rename to src/themes/coy.css index 34219d630a..8af8b285c0 100644 --- a/themes/prism-coy.css +++ b/src/themes/coy.css @@ -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-"], diff --git a/themes/prism-dark.css b/src/themes/dark.css similarity index 95% rename from themes/prism-dark.css rename to src/themes/dark.css index a0b1693e2a..eb0f9a3bc7 100644 --- a/themes/prism-dark.css +++ b/src/themes/dark.css @@ -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 */ diff --git a/themes/prism-funky.css b/src/themes/funky.css similarity index 96% rename from themes/prism-funky.css rename to src/themes/funky.css index c105c64a66..b095b82ae4 100644 --- a/themes/prism-funky.css +++ b/src/themes/funky.css @@ -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 */ diff --git a/themes/prism-okaidia.css b/src/themes/okaidia.css similarity index 91% rename from themes/prism-okaidia.css rename to src/themes/okaidia.css index 650904b2c1..d3d72317e1 100644 --- a/themes/prism-okaidia.css +++ b/src/themes/okaidia.css @@ -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-"], diff --git a/themes/prism.css b/src/themes/prism.css similarity index 98% rename from themes/prism.css rename to src/themes/prism.css index 25003b029b..bd6cce77f2 100644 --- a/themes/prism.css +++ b/src/themes/prism.css @@ -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 */ diff --git a/themes/prism-solarizedlight.css b/src/themes/solarizedlight.css similarity index 91% rename from themes/prism-solarizedlight.css rename to src/themes/solarizedlight.css index 599cd685ef..8b343d5fa0 100644 --- a/themes/prism-solarizedlight.css +++ b/src/themes/solarizedlight.css @@ -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 */ /* diff --git a/themes/prism-tomorrow.css b/src/themes/tomorrow.css similarity index 90% rename from themes/prism-tomorrow.css rename to src/themes/tomorrow.css index 42143985de..9da6ec0218 100644 --- a/themes/prism-tomorrow.css +++ b/src/themes/tomorrow.css @@ -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-"], diff --git a/themes/prism-twilight.css b/src/themes/twilight.css similarity index 99% rename from themes/prism-twilight.css rename to src/themes/twilight.css index 9c28914d5b..8040e75f9c 100644 --- a/themes/prism-twilight.css +++ b/src/themes/twilight.css @@ -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;