diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 5e953de830..ef00de5ffa 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -98,7 +98,8 @@ jobs: strategy: fail-fast: false matrix: - node: ['18', '20', '22'] + # FIXME: https://github.com/nodejs/node/pull/53934 + node: ['18', '20', '22.4.1'] bundler: ['vite', 'webpack'] runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 030bc4804c..e5c101209c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,60 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +### Bug Fixes + +- **highlighter-helper:** fix code block style ([4db9133](https://github.com/vuepress/ecosystem/commit/4db9133ffcbf9a2a2033616333785aeaaedccddc)) +- **plugin-docsearch:** fix base issue ([7e56412](https://github.com/vuepress/ecosystem/commit/7e56412a1b21bb3974668230496708a5bd6d71fe)) +- **plugin-prismjs:** fix scss variable ([f9dcfcf](https://github.com/vuepress/ecosystem/commit/f9dcfcf90fc85974fb86ba70409ca8be8d9da941)) +- **plugin-prismjs:** unify word highlight option name ([6b48402](https://github.com/vuepress/ecosystem/commit/6b48402a3ec501238e4f77a6db186298a8791185)) +- **theme-default:** fix code highlight color ([c9a5fc2](https://github.com/vuepress/ecosystem/commit/c9a5fc20f505ad90fcef33a2d316534e1267feff)) +- **theme-default:** hide mixed-decls warnings for vite ([37211b2](https://github.com/vuepress/ecosystem/commit/37211b2892bf90f96d9a258de9722e91a15c4679)) + +### Features + +- add cache plugin ([#209](https://github.com/vuepress/ecosystem/issues/209)) ([7e04cee](https://github.com/vuepress/ecosystem/commit/7e04cee1cdfd5d797fc74cb3fe2595b4851894b3)) +- **helper:** improve body normalize ([adfa670](https://github.com/vuepress/ecosystem/commit/adfa6707c64a7c8f81a2706d51927ddf36e14d27)) +- **helper:** improve normalize with motion reduce ([29058bc](https://github.com/vuepress/ecosystem/commit/29058bc9471700f590753a553135a5288833fac8)) +- make styles built-in for highlighter plugins ([#217](https://github.com/vuepress/ecosystem/issues/217)) ([25e1ea2](https://github.com/vuepress/ecosystem/commit/25e1ea2c755bb7858b397a93982d6b92ec8d18c5)) + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +### Bug Fixes + +- **theme-default:** disable sass deprecations for webpack ([28e1110](https://github.com/vuepress/ecosystem/commit/28e1110066bbafe568d3b9cc09098cbb158c210d)) +- **theme-default:** fix incorrect 404 page layout, close [#207](https://github.com/vuepress/ecosystem/issues/207) ([#213](https://github.com/vuepress/ecosystem/issues/213)) ([c7c9a72](https://github.com/vuepress/ecosystem/commit/c7c9a72e65a3f492a9d799836695ce2173a1566b)) +- **theme-default:** fix incorrect code notation diff layout, close [#212](https://github.com/vuepress/ecosystem/issues/212) ([#214](https://github.com/vuepress/ecosystem/issues/214)) ([983ad4a](https://github.com/vuepress/ecosystem/commit/983ad4aa04e47131cee4d898a939a2af880b2050)) + +### Features + +- **create-vuepress:** use @inquirer/prompts ([984b53a](https://github.com/vuepress/ecosystem/commit/984b53ab97bd5936f09f488a97dc79f590a45fde)) +- **plugin-shiki:** rename `getHighlighter` to `createHighlighter` ([#208](https://github.com/vuepress/ecosystem/issues/208)) ([bb739df](https://github.com/vuepress/ecosystem/commit/bb739dfa0893bc8a46d9e40000f43eef28be856b)) + +### Performance Improvements + +- **plugin-shiki:** improve logging when language is not available ([#215](https://github.com/vuepress/ecosystem/issues/215)) ([b84ce08](https://github.com/vuepress/ecosystem/commit/b84ce08df9c72dc56fabb8790afc192bc45abfda)) + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/ecosystem + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +### Bug Fixes + +- **theme-default:** fix transition for ``, `
` and `
`, close [#203](https://github.com/vuepress/ecosystem/issues/203) ([#205](https://github.com/vuepress/ecosystem/issues/205)) ([69a07dc](https://github.com/vuepress/ecosystem/commit/69a07dcc445e3e555c52fb7852cb3270cd383702)) +- **theme-default:** fix alias with vite ([ba09b87](https://github.com/vuepress/ecosystem/commit/ba09b873cb525af4494d5b42663dee3e97b85bbe)) +- **theme-default:** fix sidebar selector ([0a29075](https://github.com/vuepress/ecosystem/commit/0a29075388cb435e5f95d25dc1b54abbcd343d9a)) + +### Features + +- add support for highlight whitespace ([#204](https://github.com/vuepress/ecosystem/issues/204)) ([b91d04e](https://github.com/vuepress/ecosystem/commit/b91d04e5cc44adcff7405f2cdc14c4b9a6d9834d)) +- add support for word highlight ([#201](https://github.com/vuepress/ecosystem/issues/201)) ([6f37277](https://github.com/vuepress/ecosystem/commit/6f372774488f79e8570e1d8b4b1e26a5744be807)) +- **create-vuepress:** use optional peers to ensure version is up-to-date ([e8da8b8](https://github.com/vuepress/ecosystem/commit/e8da8b81a9b515e4a5b0838468be78724ffe2120)) +- **theme-default:** improve sidebar headers ([#196](https://github.com/vuepress/ecosystem/issues/196)) ([c39e4e4](https://github.com/vuepress/ecosystem/commit/c39e4e450c64e05c3939f866f56474cb83722b2c)) + # [2.0.0-rc.35](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.34...v2.0.0-rc.35) (2024-06-05) ### Bug Fixes diff --git a/docs/.vuepress/client.ts b/docs/.vuepress/client.ts index b07264ddb8..a299ef4856 100644 --- a/docs/.vuepress/client.ts +++ b/docs/.vuepress/client.ts @@ -1,7 +1,6 @@ import { defineGiscusConfig } from '@vuepress/plugin-comment/client' import { defineDocSearchConfig } from '@vuepress/plugin-docsearch/client' import { defineClientConfig } from 'vuepress/client' -import type { ClientConfig } from 'vuepress/client' import CommentPage from './layouts/CommentPage.vue' defineGiscusConfig({ @@ -66,4 +65,4 @@ export default defineClientConfig({ // We override the default layout to provide comment service CommentPage, }, -}) as ClientConfig +}) diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 68756bd6c5..2e32e39eff 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -3,6 +3,7 @@ import { footnote } from '@mdit/plugin-footnote' import { viteBundler } from '@vuepress/bundler-vite' import { webpackBundler } from '@vuepress/bundler-webpack' import { getRealPath } from '@vuepress/helper' +import { cachePlugin } from '@vuepress/plugin-cache' import { catalogPlugin } from '@vuepress/plugin-catalog' import { commentPlugin } from '@vuepress/plugin-comment' import { docsearchPlugin } from '@vuepress/plugin-docsearch' @@ -105,13 +106,18 @@ export default defineUserConfig({ isProd ? shikiPlugin({ langs: ['bash', 'diff', 'json', 'md', 'ts', 'vue'], - theme: 'dark-plus', + themes: { + light: 'one-light', + dark: 'one-dark-pro', + }, lineNumbers: 10, notationDiff: true, notationErrorLevel: true, notationFocus: true, notationHighlight: true, + notationWordHighlight: true, }) : [], + cachePlugin(), ], }) as UserConfig diff --git a/docs/.vuepress/configs/navbar/en.ts b/docs/.vuepress/configs/navbar/en.ts index 3198735d76..09335be355 100644 --- a/docs/.vuepress/configs/navbar/en.ts +++ b/docs/.vuepress/configs/navbar/en.ts @@ -17,6 +17,10 @@ export const navbarEn: NavbarConfig = [ text: 'Plume Theme', link: 'https://theme-plume.vuejs.press', }, + { + text: 'Reco Theme', + link: 'https://theme-reco.vuejs.press/en', + }, ], }, { diff --git a/docs/.vuepress/configs/navbar/zh.ts b/docs/.vuepress/configs/navbar/zh.ts index b384f4285a..b1f73039e9 100644 --- a/docs/.vuepress/configs/navbar/zh.ts +++ b/docs/.vuepress/configs/navbar/zh.ts @@ -17,6 +17,10 @@ export const navbarZh: NavbarConfig = [ text: 'Plume 主题', link: 'https://theme-plume.vuejs.press', }, + { + text: 'Reco 主题', + link: 'https://theme-reco.vuejs.press', + }, ], }, { diff --git a/docs/.vuepress/configs/sidebar/en.ts b/docs/.vuepress/configs/sidebar/en.ts index 363ef69f54..8abdc39d97 100644 --- a/docs/.vuepress/configs/sidebar/en.ts +++ b/docs/.vuepress/configs/sidebar/en.ts @@ -116,7 +116,12 @@ export const sidebarEn: SidebarConfig = { '/plugins/pwa/remove-pwa', ], - '/plugins/tools/': ['google-tag-manager', 'redirect', 'register-components'], + '/plugins/tools/': [ + 'cache', + 'google-tag-manager', + 'redirect', + 'register-components', + ], '/plugins/search/': ['docsearch', 'search'], diff --git a/docs/.vuepress/configs/sidebar/zh.ts b/docs/.vuepress/configs/sidebar/zh.ts index 987233e00c..0fca7b9419 100644 --- a/docs/.vuepress/configs/sidebar/zh.ts +++ b/docs/.vuepress/configs/sidebar/zh.ts @@ -117,6 +117,7 @@ export const sidebarZh: SidebarConfig = { ], '/zh/plugins/tools/': [ + 'cache', 'google-tag-manager', 'redirect', 'register-components', diff --git a/docs/.vuepress/theme.ts b/docs/.vuepress/theme.ts index b8f4e5a5c1..066f539e29 100644 --- a/docs/.vuepress/theme.ts +++ b/docs/.vuepress/theme.ts @@ -73,6 +73,12 @@ export default defaultTheme({ notationErrorLevel: true, notationFocus: true, notationHighlight: true, + notationWordHighlight: true, + whitespace: true, + themes: { + light: 'one-light', + dark: 'one-dark', + }, }, }, }) as Theme diff --git a/docs/package.json b/docs/package.json index 770fd03c39..c4e5a7bd49 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,14 +4,14 @@ "scripts": { "docs:build": "vuepress build . --clean-cache --clean-temp", "docs:build-webpack": "DOCS_BUNDLER=webpack pnpm docs:build", - "docs:dev": "vuepress dev . --clean-cache --clean-temp", + "docs:dev": "vuepress dev .", "docs:dev-webpack": "DOCS_BUNDLER=webpack pnpm docs:dev", "docs:serve": "http-server -a localhost .vuepress/dist" }, "dependencies": { "@mdit/plugin-footnote": "0.12.0", - "@vuepress/bundler-vite": "2.0.0-rc.13", - "@vuepress/bundler-webpack": "2.0.0-rc.13", + "@vuepress/bundler-vite": "2.0.0-rc.14", + "@vuepress/bundler-webpack": "2.0.0-rc.14", "@vuepress/plugin-back-to-top": "workspace:*", "@vuepress/helper": "workspace:*", "@vuepress/plugin-catalog": "workspace:*", @@ -29,10 +29,11 @@ "@vuepress/plugin-register-components": "workspace:*", "@vuepress/plugin-search": "workspace:*", "@vuepress/plugin-shiki": "workspace:*", + "@vuepress/plugin-cache": "workspace:*", "@vuepress/theme-default": "workspace:*", "mathjax-full": "3.2.2", "sass-loader": "^14.2.1", - "vue": "^3.4.27", - "vuepress": "2.0.0-rc.13" + "vue": "^3.4.32", + "vuepress": "2.0.0-rc.14" } } diff --git a/docs/plugins/markdown/prismjs.md b/docs/plugins/markdown/prismjs.md index 425049609e..a9a1e0de5d 100644 --- a/docs/plugins/markdown/prismjs.md +++ b/docs/plugins/markdown/prismjs.md @@ -28,19 +28,68 @@ export default { ## Options -### preloadLanguages +### theme -- Type: `string[]` +- Type: `PrismjsTheme` -- Default: `['markdown', 'jsdoc', 'yaml']` +- Default: `'nord'` + +- Details: Theme of Prismjs, will be applied to code blocks. + +### themes + +- Type: `{ light: PrismjsTheme; dark: PrismjsTheme }` - Details: - Languages to preload. + Apply Light / Dark Dual themes. - By default, languages will be loaded on demand when parsing markdown files. + Note: To use this, your theme must set `data-theme="dark"` attribute on the `` tag when dark mode is enabled. - However, Prism.js has [some potential issues](https://github.com/PrismJS/prism/issues/2716) about loading languages dynamically. To avoid them, you can preload languages via this option. +::: tip Available Prism.js Light themes + +- ateliersulphurpool-light +- coldark-cold +- coy +- duotone-light +- ghcolors +- gruvbox-light +- material-light +- one-light +- vs + +::: + +::: tip Available Prism.js Dark themes + +- atom-dark +- cb +- coldark-dark +- dark +- dracula +- duotone-dark +- duotone-earth +- duotone-forest +- duotone-sea +- duotone-space +- gruvbox-dark +- holi +- hopscotch +- lucario +- material-dark +- material-oceanic +- night-owl +- nord +- one-dark +- pojoaque +- shades-of-purple +- solarized-dark-atom +- tomorrow +- vsc-dark-plus +- xonokai +- z-touch + +::: ### lineNumbers @@ -145,18 +194,12 @@ export default defineUserConfig({ }) ``` -:::: tip +::: tip In the new version, some functionalities similar to [shiki](https://shiki.style/packages/transformers) have been implemented, allowing you to style code blocks using the same syntax. -The following features requires additional style to work, which should be handled by themes or users. - -::: details View Styles Example -@[code{260-349}](@vuepress/theme-default/src/client/styles/content/code.scss) ::: -:::: - ### notationDiff - Type: `boolean` @@ -167,6 +210,18 @@ The following features requires additional style to work, which should be handle - Example: + **Input:** + + ````md + ```ts + console.log('hewwo') // [\!code --] + console.log('hello') // [\!code ++] + console.log('goodbye') + ``` + ```` + + **Output:** + ```ts console.log('hewwo') // [!code --] console.log('hello') // [!code ++] @@ -186,6 +241,18 @@ The following features requires additional style to work, which should be handle - Example: + **Input:** + + ````md + ```ts + console.log('Not focused') + console.log('Focused') // [\!code focus] + console.log('Not focused') + ``` + ```` + + **Output:** + ```ts console.log('Not focused') console.log('Focused') // [!code focus] @@ -205,6 +272,18 @@ The following features requires additional style to work, which should be handle - Example: + **Input:** + + ````md + ```ts + console.log('Not highlighted') + console.log('Highlighted') // [\!code highlight] + console.log('Not highlighted') + ``` + ```` + + **Output:** + ```ts console.log('Not highlighted') console.log('Highlighted') // [!code highlight] @@ -224,6 +303,18 @@ The following features requires additional style to work, which should be handle - Example: + **Input:** + + ````md + ```ts + console.log('No errors or warnings') + console.warn('Warning') // [\!code warning] + console.error('Error') // [\!code error] + ``` + ```` + + **Output:** + ```ts console.log('No errors or warnings') console.warn('Warning') // [!code warning] @@ -233,6 +324,165 @@ The following features requires additional style to work, which should be handle - Also see: - [Shiki > Notation Error Level](https://shiki.style/packages/transformers#transformernotationerrorlevel) +### notationWordHighlight + +- Type: `boolean` + +- Default: `false` + +- Details: Whether enable notation word highlight. + + Word highlight must be written on a separate line. + +- Example: + + **Input:** + + ````md + ```ts + // [\!code word:Hello] + const message = 'Hello World' + console.log(message) // prints Hello World + ``` + ```` + + **Output:** + + ```ts + // [!code word:Hello] + const message = 'Hello World' + console.log(message) // prints Hello World + ``` + +- Example:Highlight words based on the meta string provided on the code snippet + + **Input:** + + ````md + ```js /Hello/ + const msg = 'Hello World' + console.log(msg) + console.log(msg) // prints Hello World + ``` + ```` + + **Output:** + + ```js /Hello/ + const msg = 'Hello World' + console.log(msg) + console.log(msg) // prints Hello World + ``` + +- Also see: + + - [Shiki > Notation Word Highlight](https://shiki.style/packages/transformers#transformernotationwordhighlight) + +### whitespace + +- Type: `boolean | 'all' | 'boundary' | 'trailing'` + +- Default: `false` + +- Details: Whether enable whitespace characters (Space and Tab). + + - `true`: enable render whitespace, same of `all` + - `false`: disable render whitespace + - `'all'`: render all whitespace + - `'boundary'`: render leading and trailing whitespace of the line + - `'trailing'`: render trailing whitespace of the line + + You can add `:whitespace / :no-whitespace` mark in your fenced code blocks to override the value set in config, and customize the render type by adding `=` after `:whitespace`. For example `:whitespace=boundary` will render leading and trailing whitespace of the line. + +- Example: + + **Input:** + + ````md + ```ts :whitespace + // render all whitespace + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=boundary + // render leading and trailing whitespace of the line + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=trailing + // render trailing whitespace of the line + function block() { + space() + tab() + } + ``` + + ```ts :no-whitespace + // disable render whitespace + function block() { + space() + tab() + } + ``` + ```` + + **Output:** + + ```ts :whitespace data-title="ts :whitespace" + // render all whitespace + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=boundary data-title="ts :whitespace=boundary" + // render leading and trailing whitespace of the line + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=trailing data-title="ts :whitespace=trailing" + // render trailing whitespace of the line + function block() { + space() + tab() + } + ``` + + ```ts :no-whitespace data-title="ts :no-whitespace" + // disable render whitespace + function block() { + space() + tab() + } + ``` + +- Also see: + - [Shiki > Render Whitespace](https://shiki.style/packages/transformers#transformerrenderwhitespace) + +### preloadLanguages + +- Type: `string[]` + +- Default: `['markdown', 'jsdoc', 'yaml']` + +- Details: + + Languages to preload. + + By default, languages will be loaded on demand when parsing markdown files. + + However, Prism.js has [some potential issues](https://github.com/PrismJS/prism/issues/2716) about loading languages dynamically. To avoid them, you can preload languages via this option. + ### preWrapper - Type: `boolean` diff --git a/docs/plugins/markdown/shiki.md b/docs/plugins/markdown/shiki.md index 0852eb1df2..880813e181 100644 --- a/docs/plugins/markdown/shiki.md +++ b/docs/plugins/markdown/shiki.md @@ -39,7 +39,7 @@ export default { Languages of code blocks to be parsed by Shiki. - This option will be forwarded to `getHighlighter()` method of Shiki. + This option will be forwarded to `createHighlighter()` method of Shiki. ::: warning @@ -190,16 +190,6 @@ export default defineUserConfig({ }) ``` -:::: tip - -The following features requires additional style to work, which should be handled by themes or users. - -::: details View Styles Example -@[code{260-349}](@vuepress/theme-default/src/client/styles/content/code.scss) -::: - -:::: - ### notationDiff - Type: `boolean` @@ -210,6 +200,18 @@ The following features requires additional style to work, which should be handle - Example: + **Input:** + + ````md + ```ts + console.log('hewwo') // [\!code --] + console.log('hello') // [\!code ++] + console.log('goodbye') + ``` + ```` + + **Output:** + ```ts console.log('hewwo') // [!code --] console.log('hello') // [!code ++] @@ -229,6 +231,18 @@ The following features requires additional style to work, which should be handle - Example: + **Input:** + + ````md + ```ts + console.log('Not focused') + console.log('Focused') // [\!code focus] + console.log('Not focused') + ``` + ```` + + **Output:** + ```ts console.log('Not focused') console.log('Focused') // [!code focus] @@ -248,6 +262,18 @@ The following features requires additional style to work, which should be handle - Example: + **Input:** + + ````md + ```ts + console.log('Not highlighted') + console.log('Highlighted') // [\!code highlight] + console.log('Not highlighted') + ``` + ```` + + **Output:** + ```ts console.log('Not highlighted') console.log('Highlighted') // [!code highlight] @@ -267,6 +293,18 @@ The following features requires additional style to work, which should be handle - Example: + **Input:** + + ````md + ```ts + console.log('No errors or warnings') + console.warn('Warning') // [\!code warning] + console.error('Error') // [\!code error] + ``` + ```` + + **Output:** + ```ts console.log('No errors or warnings') console.warn('Warning') // [!code warning] @@ -276,13 +314,158 @@ The following features requires additional style to work, which should be handle - Also see: - [Shiki > Notation Error Level](https://shiki.style/packages/transformers#transformernotationerrorlevel) +### notationWordHighlight + +- Type: `boolean` + +- Default: `false` + +- Details: Whether enable notation word highlight. + + Word highlight must be written on a separate line. + +- Example: + + **Input:** + + ````md + ```ts + // [\!code word:Hello] + const message = 'Hello World' + console.log(message) // prints Hello World + ``` + ```` + + **Output:** + + ```ts + // [!code word:Hello] + const message = 'Hello World' + console.log(message) // prints Hello World + ``` + +- Example:Highlight words based on the meta string provided on the code snippet + + **Input:** + + ````md + ```js /Hello/ + const msg = 'Hello World' + console.log(msg) + console.log(msg) // prints Hello World + ``` + ```` + + **Output:** + + ```js /Hello/ + const msg = 'Hello World' + console.log(msg) + console.log(msg) // prints Hello World + ``` + +- Also see: + + - [Shiki > Notation Word Highlight](https://shiki.style/packages/transformers#transformernotationwordhighlight) + +### whitespace + +- Type: `boolean | 'all' | 'boundary' | 'trailing'` + +- Default: `false` + +- Details: Whether enable whitespace characters (Space and Tab). + + - `true`: enable render whitespace, same of `all` + - `false`: disable render whitespace + - `'all'`: render all whitespace + - `'boundary'`: render leading and trailing whitespace of the line + - `'trailing'`: render trailing whitespace of the line + + You can add `:whitespace / :no-whitespace` mark in your fenced code blocks to override the value set in config, and customize the render type by adding `=` after `:whitespace`. For example `:whitespace=boundary` will render leading and trailing whitespace of the line. + +- Example: + + **Input:** + + ````md + ```ts :whitespace + // render all whitespace + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=boundary + // render leading and trailing whitespace of the line + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=trailing + // render trailing whitespace of the line + function block() { + space() + tab() + } + ``` + + ```ts :no-whitespace + // disable render whitespace + function block() { + space() + tab() + } + ``` + ```` + + **Output:** + + ```ts :whitespace data-title="ts :whitespace" + // render all whitespace + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=boundary data-title="ts :whitespace=boundary" + // render leading and trailing whitespace of the line + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=trailing data-title="ts :whitespace=trailing" + // render trailing whitespace of the line + function block() { + space() + tab() + } + ``` + + ```ts :no-whitespace data-title="ts :no-whitespace" + // disable render whitespace + function block() { + space() + tab() + } + ``` + +- Also see: + - [Shiki > Render Whitespace](https://shiki.style/packages/transformers#transformerrenderwhitespace) + ## Advanced Options ### defaultLang - Type: `string` -- Default: `'plain'` +- Default: `''` - Details: Fallback language when the specified language is not available. diff --git a/docs/plugins/tools/cache.md b/docs/plugins/tools/cache.md new file mode 100644 index 0000000000..f04ed61571 --- /dev/null +++ b/docs/plugins/tools/cache.md @@ -0,0 +1,49 @@ +# cache + + + +This plugin is used to solve the issue of long startup times in VuePress. + +By caching the `markdown render` during the initial startup of the VuePress development server, the plugin skips unnecessary `markdown render` on subsequent startups, thus speeding up the startup process. + +## Usage + +```bash +npm i -D @vuepress/plugin-cache@next +``` + +::: tip Using it as last plugin + +It is recommended to place `cachePlugin` as the last item in the `plugins` configuration, as this can ensure maximum utilization of caching. + +::: + +```ts +import { cachePlugin } from '@vuepress/plugin-cache' + +export default { + plugins: [ + // ... other plugins + + // using as the last plugin + cachePlugin({ + // options + }), + ], +} +``` + +## Options + +### type + +- Type: `'memory'` | `'filesystem'` + +- Default: `'memory'` + +- Details: + + Cache Types + + - `'memory'` is for memory cache, using memory cache can achieve optimal optimization effects, but as the project scales up, it occupies more memory, suitable for projects with fewer pages. + - `'filesystem'` is for file system cache, for complex projects with many pages, file cache is recommended. diff --git a/docs/zh/plugins/markdown/prismjs.md b/docs/zh/plugins/markdown/prismjs.md index c6728e3387..96cf88e451 100644 --- a/docs/zh/plugins/markdown/prismjs.md +++ b/docs/zh/plugins/markdown/prismjs.md @@ -28,19 +28,68 @@ export default { ## 配置项 -### preloadLanguages +### theme -- 类型: `string[]` +- 类型:`PrismjsTheme` -- 默认值: `['markdown', 'jsdoc', 'yaml']` +- 默认值:`'nord'` + +- 详情:Prismjs 的主题。该主题会应用到代码块上。 + +### themes + +- 类型:`{ light: PrismjsTheme; dark: PrismjsTheme }` - 详情: - 需要预加载的语言。 + 使用暗黑和明亮模式双主题。 - 默认情况下,语言会在解析 Markdown 文件时按需加载。 + 注意:想使用这个功能,你的主题必须在夜间模式下在 `` 标签上 `data-theme="dark"` 属性。 - 然而, Prism.js 在动态加载语言时可能会遇到 [一些潜在的问题](https://github.com/PrismJS/prism/issues/2716) 。为了避免这些问题,你可以使用该配置项来预加载一些语言。 +::: tip 可用的 Prism.js 浅色主题 + +- ateliersulphurpool-light +- coldark-cold +- coy +- duotone-light +- ghcolors +- gruvbox-light +- material-light +- one-light +- vs + +::: + +::: tip 可用的 Prism.js 深色主题 + +- atom-dark +- cb +- coldark-dark +- dark +- dracula +- duotone-dark +- duotone-earth +- duotone-forest +- duotone-sea +- duotone-space +- gruvbox-dark +- holi +- hopscotch +- lucario +- material-dark +- material-oceanic +- night-owl +- nord +- one-dark +- pojoaque +- shades-of-purple +- solarized-dark-atom +- tomorrow +- vsc-dark-plus +- xonokai +- z-touch + +::: ### lineNumbers @@ -145,19 +194,13 @@ export default defineUserConfig({ }) ``` -:::: tip +::: tip 在新的版本中,实现了类似于 [shiki](https://shiki.style/packages/transformers) 的部分功能, 你可以使用与其相同的语法来为代码块添加样式。 -以下功能需要额外的样式才能正常工作,这应该由主题或用户来处理。 - -::: details 查看样式示例 -@[code{260-349}](@vuepress/theme-default/src/client/styles/content/code.scss) ::: -:::: - ### notationDiff - 类型:`boolean` @@ -168,6 +211,18 @@ export default defineUserConfig({ - 示例: + **输入:** + + ````md + ```ts + console.log('hewwo') // [\!code --] + console.log('hello') // [\!code ++] + console.log('goodbye') + ``` + ```` + + **输出:** + ```ts console.log('hewwo') // [!code --] console.log('hello') // [!code ++] @@ -187,6 +242,18 @@ export default defineUserConfig({ - 示例: + **输入:** + + ````md + ```ts + console.log('Not focused') + console.log('Focused') // [\!code focus] + console.log('Not focused') + ``` + ```` + + **输出:** + ```ts console.log('Not focused') console.log('Focused') // [!code focus] @@ -206,6 +273,18 @@ export default defineUserConfig({ - 示例: + **输入:** + + ````md + ```ts + console.log('Not highlighted') + console.log('Highlighted') // [\!code highlight] + console.log('Not highlighted') + ``` + ```` + + **输出:** + ```ts console.log('Not highlighted') console.log('Highlighted') // [!code highlight] @@ -225,6 +304,18 @@ export default defineUserConfig({ - 示例: + **输入:** + + ````md + ```ts + console.log('No errors or warnings') + console.warn('Warning') // [\!code warning] + console.error('Error') // [\!code error] + ``` + ```` + + **输出:** + ```ts console.log('No errors or warnings') console.warn('Warning') // [!code warning] @@ -234,6 +325,165 @@ export default defineUserConfig({ - 参考: - [Shiki > 错误级别标记](https://shiki.tmrs.site/packages/transformers#transformernotationerrorlevel) +### notationWordHighlight + +- 类型:`boolean` + +- 默认值:`false` + +- 详情:是否启用词高亮标记。 + + 词高亮标记 必须单独写在一行。 + +- 示例: + + **输入:** + + ````md + ```ts + // [\!code word:Hello] + const message = 'Hello World' + console.log(message) // prints Hello World + ``` + ```` + + **输出:** + + ```ts + // [!code word:Hello] + const message = 'Hello World' + console.log(message) // prints Hello World + ``` + +- 示例:根据代码片段中提供的元字符串,高亮显示词 + + **输入:** + + ````md + ```js /Hello/ + const msg = 'Hello World' + console.log(msg) + console.log(msg) // 打印 Hello World + ``` + ```` + + **输出:** + + ```js /Hello/ + const msg = 'Hello World' + console.log(msg) + console.log(msg) // 打印 Hello World + ``` + +- 参考: + + - [Shiki > 词高亮标记](https://shiki.tmrs.site/packages/transformers#transformernotationwordhighlight) + +### whitespace + +- 类型:`boolean | 'all' | 'boundary' | 'trailing'` + +- 默认值:`false` + +- 详情:是否启用空白符(空格 和 Tab)渲染。 + + - `true`: 启用空白符渲染,等同于 `all` + - `false`: 禁用空白符渲染 + - `'all'`: 渲染所有空白符 + - `'boundary'`: 仅渲染行首行尾的空白符 + - `'trailing'`: 仅渲染行尾的空白符 + + 你可以在代码块中添加 `:whitespace / :no-whitespace` 标记来覆盖配置项中的设置。还可以在 `:whitespace` 之后添加 `=` 来定义渲染空白符的方式。比如 `:whitespace=boundary` 将渲染行首行尾的空白符。 + +- 示例: + + **输入:** + + ````md + ```ts :whitespace + // 渲染所有空白符 + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=boundary + // 渲染行首行尾的空白符 + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=trailing + // 渲染行尾的空白符 + function block() { + space() + tab() + } + ``` + + ```ts :no-whitespace + // 禁用空白符 + function block() { + space() + tab() + } + ``` + ```` + + **输出:** + + ```ts :whitespace data-title="ts :whitespace" + // 渲染所有空白符 + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=boundary data-title="ts :whitespace=boundary" + // 渲染行首行尾的空白符 + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=trailing data-title="ts :whitespace=trailing" + // 渲染行尾的空白符 + function block() { + space() + tab() + } + ``` + + ```ts :no-whitespace data-title="ts :no-whitespace" + // 禁用空白符 + function block() { + space() + tab() + } + ``` + +- 参考: + - [Shiki > 空白符渲染](https://shiki.tmrs.site/packages/transformers#transformerrenderwhitespace) + +### preloadLanguages + +- 类型: `string[]` + +- 默认值: `['markdown', 'jsdoc', 'yaml']` + +- 详情: + + 需要预加载的语言。 + + 默认情况下,语言会在解析 Markdown 文件时按需加载。 + + 然而, Prism.js 在动态加载语言时可能会遇到 [一些潜在的问题](https://github.com/PrismJS/prism/issues/2716) 。为了避免这些问题,你可以使用该配置项来预加载一些语言。 + ### preWrapper - 类型: `boolean` diff --git a/docs/zh/plugins/markdown/shiki.md b/docs/zh/plugins/markdown/shiki.md index 3f67088971..f7e17ccdbb 100644 --- a/docs/zh/plugins/markdown/shiki.md +++ b/docs/zh/plugins/markdown/shiki.md @@ -39,7 +39,7 @@ export default { Shiki 要解析的代码块的语言。 - 该配置项会被传递到 Shiki 的 `getHighlighter()` 方法中。 + 该配置项会被传递到 Shiki 的 `createHighlighter()` 方法中。 ::: warning @@ -192,16 +192,6 @@ export default defineUserConfig({ }) ``` -:::: tip - -以下功能需要额外的样式才能正常工作,这应该由主题或用户来处理。 - -::: details 查看样式示例 -@[code{260-349}](@vuepress/theme-default/src/client/styles/content/code.scss) -::: - -:::: - ### notationDiff - 类型:`boolean` @@ -212,6 +202,18 @@ export default defineUserConfig({ - 示例: + **输入:** + + ````md + ```ts + console.log('hewwo') // [\!code --] + console.log('hello') // [\!code ++] + console.log('goodbye') + ``` + ```` + + **输出:** + ```ts console.log('hewwo') // [!code --] console.log('hello') // [!code ++] @@ -231,6 +233,18 @@ export default defineUserConfig({ - 示例: + **输入:** + + ````md + ```ts + console.log('Not focused') + console.log('Focused') // [\!code focus] + console.log('Not focused') + ``` + ```` + + **输出:** + ```ts console.log('Not focused') console.log('Focused') // [!code focus] @@ -250,6 +264,18 @@ export default defineUserConfig({ - 示例: + **输入:** + + ````md + ```ts + console.log('Not highlighted') + console.log('Highlighted') // [\!code highlight] + console.log('Not highlighted') + ``` + ```` + + **输出:** + ```ts console.log('Not highlighted') console.log('Highlighted') // [!code highlight] @@ -269,6 +295,18 @@ export default defineUserConfig({ - 示例: + **输入:** + + ````md + ```ts + console.log('No errors or warnings') + console.warn('Warning') // [\!code warning] + console.error('Error') // [\!code error] + ``` + ```` + + **输出:** + ```ts console.log('No errors or warnings') console.warn('Warning') // [!code warning] @@ -278,13 +316,158 @@ export default defineUserConfig({ - 参考: - [Shiki > 错误级别标记](https://shiki.tmrs.site/packages/transformers#transformernotationerrorlevel) +### notationWordHighlight + +- 类型:`boolean` + +- 默认值:`false` + +- 详情:是否启用词高亮标记。 + + 词高亮标记 必须单独写在一行。 + +- 示例: + + **输入:** + + ````md + ```ts + // [\!code word:Hello] + const message = 'Hello World' + console.log(message) // prints Hello World + ``` + ```` + + **输出:** + + ```ts + // [!code word:Hello] + const message = 'Hello World' + console.log(message) // prints Hello World + ``` + +- 示例:根据代码片段中提供的元字符串,高亮显示词 + + **输入:** + + ````md + ```js /Hello/ + const msg = 'Hello World' + console.log(msg) + console.log(msg) // 打印 Hello World + ``` + ```` + + **输出:** + + ```js /Hello/ + const msg = 'Hello World' + console.log(msg) + console.log(msg) // 打印 Hello World + ``` + +- 参考: + + - [Shiki > 词高亮标记](https://shiki.tmrs.site/packages/transformers#transformernotationwordhighlight) + +### whitespace + +- 类型:`boolean | 'all' | 'boundary' | 'trailing'` + +- 默认值:`false` + +- 详情:是否启用空白符(空格 和 Tab)渲染。 + + - `true`: 启用空白符渲染,等同于 `all` + - `false`: 禁用空白符渲染 + - `'all'`: 渲染所有空白符 + - `'boundary'`: 仅渲染行首行尾的空白符 + - `'trailing'`: 仅渲染行尾的空白符 + + 你可以在代码块中添加 `:whitespace / :no-whitespace` 标记来覆盖配置项中的设置。还可以在 `:whitespace` 之后添加 `=` 来定义渲染空白符的方式。比如 `:whitespace=boundary` 将渲染行首行尾的空白符。 + +- 示例: + + **输入:** + + ````md + ```ts :whitespace + // 渲染所有空白符 + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=boundary + // 渲染行首行尾的空白符 + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=trailing + // 渲染行尾的空白符 + function block() { + space() + tab() + } + ``` + + ```ts :no-whitespace + // 禁用空白符 + function block() { + space() + tab() + } + ``` + ```` + + **输出:** + + ```ts :whitespace data-title="ts :whitespace" + // 渲染所有空白符 + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=boundary data-title="ts :whitespace=boundary" + // 渲染行首行尾的空白符 + function block() { + space() + tab() + } + ``` + + ```ts :whitespace=trailing data-title="ts :whitespace=trailing" + // 渲染行尾的空白符 + function block() { + space() + tab() + } + ``` + + ```ts :no-whitespace data-title="ts :no-whitespace" + // 禁用空白符 + function block() { + space() + tab() + } + ``` + +- 参考: + - [Shiki > 空白符渲染](https://shiki.tmrs.site/packages/transformers#transformerrenderwhitespace) + ## 高级选项 ### defaultLang - 类型:`string` -- 默认值:`'plain'` +- 默认值:`''` - 详情:指定的语言不可用时所使用的备选语言。 diff --git a/docs/zh/plugins/tools/cache.md b/docs/zh/plugins/tools/cache.md new file mode 100644 index 0000000000..bda55a8d0f --- /dev/null +++ b/docs/zh/plugins/tools/cache.md @@ -0,0 +1,50 @@ +# cache + + + +该插件 用于解决 VuePress 启动耗时过长 的问题。 + +通过在首次启动 VuePress 开发服务时,对 `markdown render` 建立缓存,在二次启动时,直接读取缓存跳过 +不必要的 `markdown render` ,从而加快启动速度。 + +## 使用方法 + +```bash +npm i -D @vuepress/plugin-cache@next +``` + +::: tip 作为最后一个插件使用 + +建议将 `cachePlugin` 放在 `plugins` 配置项中的最后一项,这能够确保缓存最大化的使用。 + +::: + +```ts +import { cachePlugin } from '@vuepress/plugin-cache' + +export default { + plugins: [ + // ... 其它插件 + + // 作为最后一个插件使用 + cachePlugin({ + // 配置项 + }), + ], +} +``` + +## 配置项 + +### type + +- 类型: `'memory'` | `'filesystem'` + +- 默认值: `'memory'` + +- 详情: + + 缓存类型 + + - `'memory'` 为内存缓存,使用内存缓存可以实现最佳的优化效果,但随着项目规模增长,内存占用更多,适合页面较少的项目。 + - `'filesystem'` 为文件系统缓存,对于复杂的项目,包含许多页面,建议使用文件缓存。 diff --git a/e2e/docs/.vuepress/client.ts b/e2e/docs/.vuepress/client.ts index 5e75c0321b..7e4354446b 100644 --- a/e2e/docs/.vuepress/client.ts +++ b/e2e/docs/.vuepress/client.ts @@ -1,5 +1,4 @@ import { defineClientConfig } from 'vuepress/client' -import type { ClientConfig } from 'vuepress/client' import ThemeData from './components/ThemeData.vue' import Article from './layouts/Article.vue' import Category from './layouts/Category.vue' @@ -14,4 +13,4 @@ export default defineClientConfig({ Timeline, }, rootComponents: [ThemeData], -}) as ClientConfig +}) diff --git a/e2e/package.json b/e2e/package.json index a4c5a3ac64..29e7e7ee9a 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -15,8 +15,8 @@ "e2e:dev-webpack": "cross-env E2E_COMMAND=dev E2E_BUNDLER=webpack playwright test" }, "dependencies": { - "@vuepress/bundler-vite": "2.0.0-rc.13", - "@vuepress/bundler-webpack": "2.0.0-rc.13", + "@vuepress/bundler-vite": "2.0.0-rc.14", + "@vuepress/bundler-webpack": "2.0.0-rc.14", "@vuepress/plugin-blog": "workspace:*", "@vuepress/plugin-catalog": "workspace:*", "@vuepress/plugin-copyright": "workspace:*", @@ -28,12 +28,12 @@ "@vuepress/plugin-theme-data": "workspace:*", "@vuepress/plugin-watermark": "workspace:*", "@vuepress/theme-default": "workspace:*", - "sass": "^1.77.4", + "sass": "^1.77.8", "sass-loader": "^14.2.1", - "vue": "^3.4.27", - "vuepress": "2.0.0-rc.13" + "vue": "^3.4.32", + "vuepress": "2.0.0-rc.14" }, "devDependencies": { - "@playwright/test": "^1.44.1" + "@playwright/test": "^1.45.2" } } diff --git a/lerna.json b/lerna.json index d98eb6fbd3..aef842307b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,13 +1,18 @@ { "npmClient": "pnpm", - "version": "2.0.0-rc.35", + "version": "2.0.0-rc.39", "command": { "version": { "allowBranch": "main", + "allowPeerDependenciesUpdate": true, "conventionalCommits": true, "exact": true, "message": "build: publish v%v", "syncWorkspaceLock": true + }, + "publish": { + "graphType": "all", + "removePackageFields": ["devDependencies", "scripts"] } }, "packages": ["plugins/*/*", "themes/*", "tools/*"], diff --git a/package.json b/package.json index e3f9db484f..866cf6a2cb 100644 --- a/package.json +++ b/package.json @@ -31,11 +31,11 @@ "devDependencies": { "@commitlint/cli": "^19.3.0", "@commitlint/config-conventional": "^19.2.2", - "@lerna-lite/cli": "^3.5.0", - "@lerna-lite/publish": "^3.5.0", - "@types/node": "^20.14.1", + "@lerna-lite/cli": "^3.7.1", + "@lerna-lite/publish": "^3.7.1", + "@types/node": "^20.14.11", "@types/webpack-env": "^1.18.5", - "@vitest/coverage-istanbul": "^1.6.0", + "@vitest/coverage-istanbul": "^2.0.3", "conventional-changelog-cli": "^5.0.0", "cpx2": "^7.0.1", "cross-env": "^7.0.3", @@ -43,31 +43,26 @@ "eslint-config-vuepress": "^4.10.1", "eslint-config-vuepress-typescript": "^4.10.1", "http-server": "^14.1.1", - "husky": "^9.0.11", + "husky": "^9.1.1", "nano-staged": "^0.8.0", "postcss-html": "^1.7.0", - "prettier": "^3.3.0", + "prettier": "^3.3.3", "prettier-config-vuepress": "^4.4.0", - "rimraf": "^5.0.7", - "sass": "1.77.4", + "rimraf": "^6.0.1", + "sass": "1.77.8", "sort-package-json": "^2.10.0", - "stylelint": "^16.6.1", - "stylelint-config-hope": "^6.0.1", + "stylelint": "^16.7.0", + "stylelint-config-hope": "^7.0.2", "stylelint-config-html": "^1.1.0", "tsconfig-vuepress": "^4.5.0", - "tsx": "^4.11.2", - "typescript": "^5.4.5", - "vite": "5.2.11", - "vitest": "^1.6.0", - "vuepress": "2.0.0-rc.13" + "tsx": "^4.16.2", + "typescript": "^5.5.3", + "vite": "5.3.4", + "vitest": "^2.0.3", + "vuepress": "2.0.0-rc.14" }, - "packageManager": "pnpm@9.1.4", + "packageManager": "pnpm@9.5.0", "engines": { "node": ">=18.19.0" - }, - "pnpm": { - "overrides": { - "artalk": "2.8.5" - } } } diff --git a/plugins/analytics/plugin-baidu-analytics/CHANGELOG.md b/plugins/analytics/plugin-baidu-analytics/CHANGELOG.md index 6450c96643..177907ed4c 100644 --- a/plugins/analytics/plugin-baidu-analytics/CHANGELOG.md +++ b/plugins/analytics/plugin-baidu-analytics/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-baidu-analytics + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-baidu-analytics + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-baidu-analytics + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-baidu-analytics + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-baidu-analytics diff --git a/plugins/analytics/plugin-baidu-analytics/package.json b/plugins/analytics/plugin-baidu-analytics/package.json index 660c231982..780e94e948 100644 --- a/plugins/analytics/plugin-baidu-analytics/package.json +++ b/plugins/analytics/plugin-baidu-analytics/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-baidu-analytics", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - baidu-analytics", "keywords": [ "vuepress-plugin", @@ -41,10 +41,10 @@ }, "dependencies": { "@vuepress/helper": "workspace:*", - "vue": "^3.4.27" + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/analytics/plugin-baidu-analytics/src/client/config.ts b/plugins/analytics/plugin-baidu-analytics/src/client/config.ts index 3691ac32b1..0553067789 100644 --- a/plugins/analytics/plugin-baidu-analytics/src/client/config.ts +++ b/plugins/analytics/plugin-baidu-analytics/src/client/config.ts @@ -1,5 +1,4 @@ import { defineClientConfig } from 'vuepress/client' -import type { ClientConfig } from 'vuepress/client' import { useBaiduAnalytics } from './composables/index.js' declare const __BD_ID__: string @@ -9,4 +8,4 @@ export default defineClientConfig({ if (__VUEPRESS_SSR__) return useBaiduAnalytics(__BD_ID__) }, -}) as ClientConfig +}) diff --git a/plugins/analytics/plugin-google-analytics/CHANGELOG.md b/plugins/analytics/plugin-google-analytics/CHANGELOG.md index dbc7d91122..2b2552ce30 100644 --- a/plugins/analytics/plugin-google-analytics/CHANGELOG.md +++ b/plugins/analytics/plugin-google-analytics/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-google-analytics + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-google-analytics diff --git a/plugins/analytics/plugin-google-analytics/package.json b/plugins/analytics/plugin-google-analytics/package.json index ecaeddcd2a..521ee57364 100644 --- a/plugins/analytics/plugin-google-analytics/package.json +++ b/plugins/analytics/plugin-google-analytics/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-google-analytics", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.37", "description": "VuePress plugin - google-analytics", "keywords": [ "vuepress-plugin", @@ -36,7 +36,7 @@ "clean": "rimraf --glob ./lib ./*.tsbuildinfo" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/analytics/plugin-google-analytics/src/client/config.ts b/plugins/analytics/plugin-google-analytics/src/client/config.ts index 934b6c2844..91806e0654 100644 --- a/plugins/analytics/plugin-google-analytics/src/client/config.ts +++ b/plugins/analytics/plugin-google-analytics/src/client/config.ts @@ -1,5 +1,4 @@ import { defineClientConfig } from 'vuepress/client' -import type { ClientConfig } from 'vuepress/client' import type { GoogleAnalyticsPluginOptions } from '../shared/index.js' import { useGoogleAnalytics } from './composables/index.js' @@ -12,4 +11,4 @@ export default defineClientConfig({ if (__VUEPRESS_SSR__) return useGoogleAnalytics(options) }, -}) as ClientConfig +}) diff --git a/plugins/analytics/plugin-umami-analytics/CHANGELOG.md b/plugins/analytics/plugin-umami-analytics/CHANGELOG.md index 1122b9385a..2ee685bb90 100644 --- a/plugins/analytics/plugin-umami-analytics/CHANGELOG.md +++ b/plugins/analytics/plugin-umami-analytics/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-umami-analytics + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-umami-analytics + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-umami-analytics + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-umami-analytics + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-umami-analytics diff --git a/plugins/analytics/plugin-umami-analytics/package.json b/plugins/analytics/plugin-umami-analytics/package.json index 922a6a71f1..274100b665 100644 --- a/plugins/analytics/plugin-umami-analytics/package.json +++ b/plugins/analytics/plugin-umami-analytics/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-umami-analytics", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - umami-analytics", "keywords": [ "vuepress-plugin", @@ -41,10 +41,10 @@ }, "dependencies": { "@vuepress/helper": "workspace:*", - "vue": "^3.4.27" + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/analytics/plugin-umami-analytics/src/client/config.ts b/plugins/analytics/plugin-umami-analytics/src/client/config.ts index 6b83f39026..d3894fc4a0 100644 --- a/plugins/analytics/plugin-umami-analytics/src/client/config.ts +++ b/plugins/analytics/plugin-umami-analytics/src/client/config.ts @@ -1,5 +1,4 @@ import { defineClientConfig } from 'vuepress/client' -import type { ClientConfig } from 'vuepress/client' import type { UmamiOptions } from '../shared/index.js' import { useUmamiAnalytics } from './composables/index.js' @@ -10,4 +9,4 @@ export default defineClientConfig({ if (__VUEPRESS_SSR__) return useUmamiAnalytics(__UMM_OPTIONS__) }, -}) as ClientConfig +}) diff --git a/plugins/blog/plugin-blog/CHANGELOG.md b/plugins/blog/plugin-blog/CHANGELOG.md index 52a56d396e..75edb163a8 100644 --- a/plugins/blog/plugin-blog/CHANGELOG.md +++ b/plugins/blog/plugin-blog/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-blog + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-blog + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-blog + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-blog + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-blog diff --git a/plugins/blog/plugin-blog/package.json b/plugins/blog/plugin-blog/package.json index 82f2650f86..cf4442b7ca 100644 --- a/plugins/blog/plugin-blog/package.json +++ b/plugins/blog/plugin-blog/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-blog", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - blog", "keywords": [ "vuepress-plugin", @@ -41,10 +41,10 @@ "dependencies": { "@vuepress/helper": "workspace:*", "chokidar": "^3.6.0", - "vue": "^3.4.27" + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/blog/plugin-comment/CHANGELOG.md b/plugins/blog/plugin-comment/CHANGELOG.md index c2e6470f4b..4aae206c33 100644 --- a/plugins/blog/plugin-comment/CHANGELOG.md +++ b/plugins/blog/plugin-comment/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-comment + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-comment + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-comment + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-comment + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) ### Features diff --git a/plugins/blog/plugin-comment/package.json b/plugins/blog/plugin-comment/package.json index 5329e4e59f..0d58d2ce1b 100644 --- a/plugins/blog/plugin-comment/package.json +++ b/plugins/blog/plugin-comment/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-comment", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - comment", "keywords": [ "vuepress-plugin", @@ -48,13 +48,13 @@ "dependencies": { "@vuepress/helper": "workspace:*", "giscus": "^1.5.0", - "vue": "^3.4.27" + "vue": "^3.4.32" }, "peerDependencies": { "@waline/client": "^3.1.0", - "artalk": "^2.7.3", + "artalk": "^2.8.7", "twikoo": "^1.5.0", - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "peerDependenciesMeta": { "@waline/client": { diff --git a/plugins/blog/plugin-comment/src/client/config.ts b/plugins/blog/plugin-comment/src/client/config.ts index 6241898553..409c3ddf84 100644 --- a/plugins/blog/plugin-comment/src/client/config.ts +++ b/plugins/blog/plugin-comment/src/client/config.ts @@ -1,4 +1,3 @@ -import type { ClientConfig } from 'vuepress/client' import { defineClientConfig } from 'vuepress/client' import CommentService from './components/CommentService.js' import { injectCommentConfig } from './helpers/index.js' @@ -11,4 +10,4 @@ export default defineClientConfig({ injectCommentConfig(app) app.component('CommentService', CommentService) }, -}) as ClientConfig +}) diff --git a/plugins/blog/plugin-feed/CHANGELOG.md b/plugins/blog/plugin-feed/CHANGELOG.md index 95167edb27..41987c8879 100644 --- a/plugins/blog/plugin-feed/CHANGELOG.md +++ b/plugins/blog/plugin-feed/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-feed + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-feed + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-feed + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-feed + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-feed diff --git a/plugins/blog/plugin-feed/package.json b/plugins/blog/plugin-feed/package.json index d002d23f9c..648aee9db7 100644 --- a/plugins/blog/plugin-feed/package.json +++ b/plugins/blog/plugin-feed/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-feed", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "Feed plugin for vuepress-theme-hope", "keywords": [ "vuepress", @@ -48,7 +48,7 @@ "@vuepress/plugin-git": "workspace:*" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/development/plugin-active-header-links/CHANGELOG.md b/plugins/development/plugin-active-header-links/CHANGELOG.md index 0c48faad39..b76a5a958d 100644 --- a/plugins/development/plugin-active-header-links/CHANGELOG.md +++ b/plugins/development/plugin-active-header-links/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-active-header-links + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-active-header-links + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-active-header-links + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-active-header-links + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-active-header-links diff --git a/plugins/development/plugin-active-header-links/package.json b/plugins/development/plugin-active-header-links/package.json index 3d17844f21..2474bebcbb 100644 --- a/plugins/development/plugin-active-header-links/package.json +++ b/plugins/development/plugin-active-header-links/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-active-header-links", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - active header links", "keywords": [ "vuepress-plugin", @@ -36,11 +36,11 @@ "clean": "rimraf --glob ./lib ./*.tsbuildinfo" }, "dependencies": { - "@vueuse/core": "^10.10.0", - "vue": "^3.4.27" + "@vueuse/core": "^10.11.0", + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/development/plugin-active-header-links/src/client/config.ts b/plugins/development/plugin-active-header-links/src/client/config.ts index 944eb7670e..ddf503c20b 100644 --- a/plugins/development/plugin-active-header-links/src/client/config.ts +++ b/plugins/development/plugin-active-header-links/src/client/config.ts @@ -1,5 +1,4 @@ import { defineClientConfig } from 'vuepress/client' -import type { ClientConfig } from 'vuepress/client' import { useActiveHeaderLinks } from './composables/index.js' declare const __AHL_HEADER_LINK_SELECTOR__: string @@ -23,4 +22,4 @@ export default defineClientConfig({ offset, }) }, -}) as ClientConfig +}) diff --git a/plugins/development/plugin-git/CHANGELOG.md b/plugins/development/plugin-git/CHANGELOG.md index c09da89882..70aabaeead 100644 --- a/plugins/development/plugin-git/CHANGELOG.md +++ b/plugins/development/plugin-git/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-git + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-git + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-git + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-git diff --git a/plugins/development/plugin-git/package.json b/plugins/development/plugin-git/package.json index a276ea0918..ae500b8b34 100644 --- a/plugins/development/plugin-git/package.json +++ b/plugins/development/plugin-git/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-git", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.38", "description": "VuePress plugin - git", "keywords": [ "vuepress-plugin", @@ -34,10 +34,10 @@ "clean": "rimraf --glob ./lib ./*.tsbuildinfo" }, "dependencies": { - "execa": "^9.1.0" + "execa": "^9.3.0" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/development/plugin-palette/CHANGELOG.md b/plugins/development/plugin-palette/CHANGELOG.md index 6c5b0c8738..9e4f09fb1b 100644 --- a/plugins/development/plugin-palette/CHANGELOG.md +++ b/plugins/development/plugin-palette/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-palette + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-palette diff --git a/plugins/development/plugin-palette/package.json b/plugins/development/plugin-palette/package.json index 461ce9de76..400614ce61 100644 --- a/plugins/development/plugin-palette/package.json +++ b/plugins/development/plugin-palette/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-palette", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.37", "description": "VuePress plugin - palette", "keywords": [ "vuepress-plugin", @@ -42,7 +42,7 @@ "chokidar": "^3.6.0" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/development/plugin-reading-time/CHANGELOG.md b/plugins/development/plugin-reading-time/CHANGELOG.md index 908f159ff0..01a0a3fb60 100644 --- a/plugins/development/plugin-reading-time/CHANGELOG.md +++ b/plugins/development/plugin-reading-time/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-reading-time + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-reading-time + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-reading-time + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-reading-time + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-reading-time diff --git a/plugins/development/plugin-reading-time/package.json b/plugins/development/plugin-reading-time/package.json index 6e3e524b97..c6d207d8fe 100644 --- a/plugins/development/plugin-reading-time/package.json +++ b/plugins/development/plugin-reading-time/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-reading-time", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - reading-time", "keywords": [ "vuepress-plugin", @@ -41,10 +41,10 @@ }, "dependencies": { "@vuepress/helper": "workspace:*", - "vue": "^3.4.27" + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/development/plugin-rtl/CHANGELOG.md b/plugins/development/plugin-rtl/CHANGELOG.md index 9f0e99494e..0b46ec6ddc 100644 --- a/plugins/development/plugin-rtl/CHANGELOG.md +++ b/plugins/development/plugin-rtl/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-rtl + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-rtl + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-rtl + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-rtl + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-rtl diff --git a/plugins/development/plugin-rtl/package.json b/plugins/development/plugin-rtl/package.json index e24741f856..7db985fa61 100644 --- a/plugins/development/plugin-rtl/package.json +++ b/plugins/development/plugin-rtl/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-rtl", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - rtl", "keywords": [ "vuepress-plugin", @@ -38,10 +38,10 @@ "clean": "rimraf --glob ./lib ./*.tsbuildinfo" }, "dependencies": { - "vue": "^3.4.27" + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/development/plugin-rtl/src/client/config.ts b/plugins/development/plugin-rtl/src/client/config.ts index fdfe0ad5fa..d3ce36b880 100644 --- a/plugins/development/plugin-rtl/src/client/config.ts +++ b/plugins/development/plugin-rtl/src/client/config.ts @@ -1,5 +1,4 @@ import { onMounted, watch } from 'vue' -import type { ClientConfig } from 'vuepress/client' import { defineClientConfig, useRouteLocale } from 'vuepress/client' declare const __RTL_LOCALES__: string[] @@ -49,4 +48,4 @@ export default defineClientConfig({ watch(routeLocale, toggleRTL, { immediate: true }) }) }, -}) as ClientConfig +}) diff --git a/plugins/development/plugin-sass-palette/CHANGELOG.md b/plugins/development/plugin-sass-palette/CHANGELOG.md index 03c08f77a5..63613c7ba8 100644 --- a/plugins/development/plugin-sass-palette/CHANGELOG.md +++ b/plugins/development/plugin-sass-palette/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-sass-palette + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-sass-palette + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-sass-palette + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-sass-palette + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-sass-palette diff --git a/plugins/development/plugin-sass-palette/package.json b/plugins/development/plugin-sass-palette/package.json index cef77537c0..59f5d4d0c2 100644 --- a/plugins/development/plugin-sass-palette/package.json +++ b/plugins/development/plugin-sass-palette/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-sass-palette", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - sass-palette", "keywords": [ "vuepress-plugin", @@ -48,15 +48,15 @@ "dependencies": { "@vuepress/helper": "workspace:*", "chokidar": "^3.6.0", - "sass": "^1.77.4" + "sass": "^1.77.8" }, "devDependencies": { - "@vuepress/bundler-vite": "2.0.0-rc.13", - "@vuepress/bundler-webpack": "2.0.0-rc.13" + "@vuepress/bundler-vite": "2.0.0-rc.14", + "@vuepress/bundler-webpack": "2.0.0-rc.14" }, "peerDependencies": { "sass-loader": "^14.0.0", - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "peerDependenciesMeta": { "sass-loader": { diff --git a/plugins/development/plugin-theme-data/CHANGELOG.md b/plugins/development/plugin-theme-data/CHANGELOG.md index 881b8a0335..ce580a36bc 100644 --- a/plugins/development/plugin-theme-data/CHANGELOG.md +++ b/plugins/development/plugin-theme-data/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-theme-data + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-theme-data + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-theme-data + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-theme-data + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-theme-data diff --git a/plugins/development/plugin-theme-data/package.json b/plugins/development/plugin-theme-data/package.json index 674f5ef4bb..ad2b3aab98 100644 --- a/plugins/development/plugin-theme-data/package.json +++ b/plugins/development/plugin-theme-data/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-theme-data", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - theme data", "keywords": [ "vuepress-plugin", @@ -36,11 +36,11 @@ "copy": "cpx \"src/**/*.d.ts\" lib" }, "dependencies": { - "@vue/devtools-api": "^6.6.2", - "vue": "^3.4.27" + "@vue/devtools-api": "^6.6.3", + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/development/plugin-theme-data/src/client/config.ts b/plugins/development/plugin-theme-data/src/client/config.ts index 1d3917918f..590bb7f451 100644 --- a/plugins/development/plugin-theme-data/src/client/config.ts +++ b/plugins/development/plugin-theme-data/src/client/config.ts @@ -1,6 +1,6 @@ import { setupDevtoolsPlugin } from '@vue/devtools-api' import { computed } from 'vue' -import type { ClientConfig, ClientData } from 'vuepress/client' +import type { ClientData } from 'vuepress/client' import { clientDataSymbol, defineClientConfig } from 'vuepress/client' import { resolveThemeLocaleData, @@ -66,4 +66,4 @@ export default defineClientConfig({ ) } }, -}) as ClientConfig +}) diff --git a/plugins/development/plugin-toc/CHANGELOG.md b/plugins/development/plugin-toc/CHANGELOG.md index 5484f0c443..eea3054ab8 100644 --- a/plugins/development/plugin-toc/CHANGELOG.md +++ b/plugins/development/plugin-toc/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-toc + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-toc + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-toc + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-toc + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-toc diff --git a/plugins/development/plugin-toc/package.json b/plugins/development/plugin-toc/package.json index 90ef095390..751e0662b7 100644 --- a/plugins/development/plugin-toc/package.json +++ b/plugins/development/plugin-toc/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-toc", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - toc", "keywords": [ "vuepress-plugin", @@ -35,11 +35,11 @@ "clean": "rimraf --glob ./lib ./*.tsbuildinfo" }, "dependencies": { - "vue": "^3.4.27", - "vue-router": "^4.3.2" + "vue": "^3.4.32", + "vue-router": "^4.4.0" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/development/plugin-toc/src/client/config.ts b/plugins/development/plugin-toc/src/client/config.ts index c2cd24e204..596b6f90a7 100644 --- a/plugins/development/plugin-toc/src/client/config.ts +++ b/plugins/development/plugin-toc/src/client/config.ts @@ -1,6 +1,5 @@ import { h } from 'vue' import { defineClientConfig } from 'vuepress/client' -import type { ClientConfig } from 'vuepress/client' import type { TocPropsOptions } from '../shared/index.js' import { Toc } from './components/Toc.js' @@ -22,4 +21,4 @@ export default defineClientConfig({ }), ) }, -}) as ClientConfig +}) diff --git a/plugins/features/plugin-back-to-top/CHANGELOG.md b/plugins/features/plugin-back-to-top/CHANGELOG.md index 5cd100bccd..76170a14c2 100644 --- a/plugins/features/plugin-back-to-top/CHANGELOG.md +++ b/plugins/features/plugin-back-to-top/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-back-to-top + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-back-to-top + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-back-to-top + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-back-to-top + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-back-to-top diff --git a/plugins/features/plugin-back-to-top/package.json b/plugins/features/plugin-back-to-top/package.json index ae97370fef..a6515fde24 100644 --- a/plugins/features/plugin-back-to-top/package.json +++ b/plugins/features/plugin-back-to-top/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-back-to-top", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - back to top", "keywords": [ "vuepress-plugin", @@ -38,11 +38,11 @@ }, "dependencies": { "@vuepress/helper": "workspace:*", - "@vueuse/core": "^10.10.0", - "vue": "^3.4.27" + "@vueuse/core": "^10.11.0", + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/features/plugin-back-to-top/src/client/config.ts b/plugins/features/plugin-back-to-top/src/client/config.ts index 6e5ff44b1c..a4bee9c33c 100644 --- a/plugins/features/plugin-back-to-top/src/client/config.ts +++ b/plugins/features/plugin-back-to-top/src/client/config.ts @@ -1,9 +1,8 @@ import { defineClientConfig } from 'vuepress/client' -import type { ClientConfig } from 'vuepress/client' import { BackToTop } from './components/index.js' import './styles/vars.css' export default defineClientConfig({ rootComponents: [BackToTop], -}) as ClientConfig +}) diff --git a/plugins/features/plugin-back-to-top/src/client/styles/back-to-top.scss b/plugins/features/plugin-back-to-top/src/client/styles/back-to-top.scss index 56a3b3ed7a..c44ae416c2 100644 --- a/plugins/features/plugin-back-to-top/src/client/styles/back-to-top.scss +++ b/plugins/features/plugin-back-to-top/src/client/styles/back-to-top.scss @@ -1,7 +1,7 @@ .vp-back-to-top-button { position: fixed !important; - bottom: 4rem; inset-inline-end: 1rem; + bottom: 4rem; z-index: 100; width: 48px; diff --git a/plugins/features/plugin-catalog/CHANGELOG.md b/plugins/features/plugin-catalog/CHANGELOG.md index 36319f4fa2..ced9bc6df5 100644 --- a/plugins/features/plugin-catalog/CHANGELOG.md +++ b/plugins/features/plugin-catalog/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-catalog + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-catalog + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-catalog + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-catalog + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-catalog diff --git a/plugins/features/plugin-catalog/package.json b/plugins/features/plugin-catalog/package.json index bcac4c90cb..a9ec624040 100644 --- a/plugins/features/plugin-catalog/package.json +++ b/plugins/features/plugin-catalog/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-catalog", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - catalog", "keywords": [ "vuepress-plugin", @@ -42,10 +42,10 @@ }, "dependencies": { "@vuepress/helper": "workspace:*", - "vue": "^3.4.27" + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/features/plugin-catalog/src/client/config.ts b/plugins/features/plugin-catalog/src/client/config.ts index 6606492ec9..c469dd7e3a 100644 --- a/plugins/features/plugin-catalog/src/client/config.ts +++ b/plugins/features/plugin-catalog/src/client/config.ts @@ -1,5 +1,4 @@ import { hasGlobalComponent } from '@vuepress/helper/client' -import type { ClientConfig } from 'vuepress/client' import { defineClientConfig } from 'vuepress/client' import Catalog from './components/Catalog.js' import { injectCatalogInfoGetter } from './helpers/index.js' @@ -12,4 +11,4 @@ export default defineClientConfig({ injectCatalogInfoGetter(app) if (!hasGlobalComponent('Catalog', app)) app.component('Catalog', Catalog) }, -}) as ClientConfig +}) diff --git a/plugins/features/plugin-catalog/src/client/styles/catalog.scss b/plugins/features/plugin-catalog/src/client/styles/catalog.scss index 6729aaf1d1..40197cf12e 100644 --- a/plugins/features/plugin-catalog/src/client/styles/catalog.scss +++ b/plugins/features/plugin-catalog/src/client/styles/catalog.scss @@ -42,8 +42,8 @@ } .vp-catalogs { - margin: 0; counter-reset: catalog-item; + margin: 0; &.deep { padding-inline-start: 0; diff --git a/plugins/features/plugin-copy-code/CHANGELOG.md b/plugins/features/plugin-copy-code/CHANGELOG.md index ad11778c57..974106c78b 100644 --- a/plugins/features/plugin-copy-code/CHANGELOG.md +++ b/plugins/features/plugin-copy-code/CHANGELOG.md @@ -3,6 +3,24 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +### Features + +- make styles built-in for highlighter plugins ([#217](https://github.com/vuepress/ecosystem/issues/217)) ([25e1ea2](https://github.com/vuepress/ecosystem/commit/25e1ea2c755bb7858b397a93982d6b92ec8d18c5)) + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-copy-code + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-copy-code + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-copy-code + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-copy-code diff --git a/plugins/features/plugin-copy-code/package.json b/plugins/features/plugin-copy-code/package.json index 3f2d6e8c42..855ed351cc 100644 --- a/plugins/features/plugin-copy-code/package.json +++ b/plugins/features/plugin-copy-code/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-copy-code", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - copy code block", "keywords": [ "vuepress-plugin", @@ -43,11 +43,11 @@ }, "dependencies": { "@vuepress/helper": "workspace:*", - "@vueuse/core": "^10.10.0", - "vue": "^3.4.27" + "@vueuse/core": "^10.11.0", + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/features/plugin-copy-code/src/client/config.ts b/plugins/features/plugin-copy-code/src/client/config.ts index 52f3ef082a..402d9cda10 100644 --- a/plugins/features/plugin-copy-code/src/client/config.ts +++ b/plugins/features/plugin-copy-code/src/client/config.ts @@ -1,4 +1,3 @@ -import type { ClientConfig } from 'vuepress/client' import { defineClientConfig } from 'vuepress/client' import type { CopyCodePluginLocaleConfig } from '../shared/index.js' import { useCopyCode } from './composables/index.js' @@ -19,4 +18,4 @@ export default defineClientConfig({ showInMobile: __CC_SHOW_IN_MOBILE__, }) }, -}) as ClientConfig +}) diff --git a/plugins/features/plugin-copy-code/src/client/styles/copy-code.scss b/plugins/features/plugin-copy-code/src/client/styles/copy-code.scss index 692168a60c..f420afc5c1 100644 --- a/plugins/features/plugin-copy-code/src/client/styles/copy-code.scss +++ b/plugins/features/plugin-copy-code/src/client/styles/copy-code.scss @@ -1,8 +1,8 @@ :root { --code-copy-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' height='20' width='20' stroke='rgba(128,128,128,1)' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2' /%3e%3c/svg%3e"); --code-copied-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' height='20' width='20' stroke='rgba(128,128,128,1)' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m-6 9 2 2 4-4' /%3e%3c/svg%3e"); - --copy-code-color: #9e9e9e; - --copy-code-hover: rgb(0 0 0 / 50%); + --copy-code-color: var(--code-line-number-color, #9e9e9e); + --copy-code-hover: var(--code-highlight-bg-color, rgb(0 0 0 / 50%)); } .vp-copy-code-button { @@ -47,10 +47,10 @@ mask-image: var(--code-copy-icon); -webkit-mask-position: 50%; mask-position: 50%; - -webkit-mask-repeat: no-repeat; - mask-repeat: no-repeat; -webkit-mask-size: 1em; mask-size: 1em; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; } &:focus, diff --git a/plugins/features/plugin-copyright/CHANGELOG.md b/plugins/features/plugin-copyright/CHANGELOG.md index aba69ce553..e4438019d3 100644 --- a/plugins/features/plugin-copyright/CHANGELOG.md +++ b/plugins/features/plugin-copyright/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-copyright + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-copyright + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-copyright + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-copyright + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-copyright diff --git a/plugins/features/plugin-copyright/package.json b/plugins/features/plugin-copyright/package.json index a146107a90..f4e9c12042 100644 --- a/plugins/features/plugin-copyright/package.json +++ b/plugins/features/plugin-copyright/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-copyright", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - copyright", "keywords": [ "vuepress-plugin", @@ -40,11 +40,11 @@ }, "dependencies": { "@vuepress/helper": "workspace:*", - "@vueuse/core": "^10.10.0", - "vue": "^3.4.27" + "@vueuse/core": "^10.11.0", + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/features/plugin-copyright/src/client/composables/setupCopyright.ts b/plugins/features/plugin-copyright/src/client/composables/setupCopyright.ts index 8abd98327a..1ae0db1be3 100644 --- a/plugins/features/plugin-copyright/src/client/composables/setupCopyright.ts +++ b/plugins/features/plugin-copyright/src/client/composables/setupCopyright.ts @@ -56,13 +56,14 @@ export const setupCopyright = (): void => { const disableSelection = computed(() => enabled.value - ? copyOptions.value?.disableSelection ?? copyrightOptions.disableSelection + ? (copyOptions.value?.disableSelection ?? + copyrightOptions.disableSelection) : false, ) const maxLength = computed(() => enabled.value - ? copyOptions.value?.maxLength ?? copyrightOptions.maxLength + ? (copyOptions.value?.maxLength ?? copyrightOptions.maxLength) : 0, ) diff --git a/plugins/features/plugin-copyright/src/client/config.ts b/plugins/features/plugin-copyright/src/client/config.ts index 2cb1aa027c..936958ed88 100644 --- a/plugins/features/plugin-copyright/src/client/config.ts +++ b/plugins/features/plugin-copyright/src/client/config.ts @@ -1,4 +1,3 @@ -import type { ClientConfig } from 'vuepress/client' import { defineClientConfig } from 'vuepress/client' import { setupCopyright } from './composables/index.js' @@ -6,4 +5,4 @@ export default defineClientConfig({ setup: () => { setupCopyright() }, -}) as ClientConfig +}) diff --git a/plugins/features/plugin-medium-zoom/CHANGELOG.md b/plugins/features/plugin-medium-zoom/CHANGELOG.md index ee0db7aed5..9388d852fc 100644 --- a/plugins/features/plugin-medium-zoom/CHANGELOG.md +++ b/plugins/features/plugin-medium-zoom/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-medium-zoom + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-medium-zoom + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-medium-zoom + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-medium-zoom + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-medium-zoom diff --git a/plugins/features/plugin-medium-zoom/package.json b/plugins/features/plugin-medium-zoom/package.json index 45df3bc1e7..ac2cd6973f 100644 --- a/plugins/features/plugin-medium-zoom/package.json +++ b/plugins/features/plugin-medium-zoom/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-medium-zoom", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - medium-zoom", "keywords": [ "vuepress-plugin", @@ -40,10 +40,10 @@ "dependencies": { "@vuepress/helper": "workspace:*", "medium-zoom": "^1.1.0", - "vue": "^3.4.27" + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/features/plugin-medium-zoom/src/client/config.ts b/plugins/features/plugin-medium-zoom/src/client/config.ts index a68b820b59..b9fc37f730 100644 --- a/plugins/features/plugin-medium-zoom/src/client/config.ts +++ b/plugins/features/plugin-medium-zoom/src/client/config.ts @@ -2,7 +2,6 @@ import { wait } from '@vuepress/helper/client' import mediumZoom from 'medium-zoom' import type { ZoomOptions } from 'medium-zoom' import { defineClientConfig } from 'vuepress/client' -import type { ClientConfig } from 'vuepress/client' import { mediumZoomSymbol } from './composables/index.js' import './styles/vars.css' @@ -32,4 +31,4 @@ export default defineClientConfig({ wait(delay).then(() => zoom.refresh()) }) }, -}) as ClientConfig +}) diff --git a/plugins/features/plugin-notice/CHANGELOG.md b/plugins/features/plugin-notice/CHANGELOG.md index f9eca78fff..68a1a09a1a 100644 --- a/plugins/features/plugin-notice/CHANGELOG.md +++ b/plugins/features/plugin-notice/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-notice + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-notice + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-notice + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-notice + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-notice diff --git a/plugins/features/plugin-notice/package.json b/plugins/features/plugin-notice/package.json index 01bc554503..5560417138 100644 --- a/plugins/features/plugin-notice/package.json +++ b/plugins/features/plugin-notice/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-notice", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - back to top", "keywords": [ "vuepress-plugin", @@ -38,11 +38,11 @@ }, "dependencies": { "@vuepress/helper": "workspace:*", - "@vueuse/core": "^10.10.0", - "vue": "^3.4.27" + "@vueuse/core": "^10.11.0", + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/features/plugin-notice/src/client/config.ts b/plugins/features/plugin-notice/src/client/config.ts index 52818f766f..cc022fbffc 100644 --- a/plugins/features/plugin-notice/src/client/config.ts +++ b/plugins/features/plugin-notice/src/client/config.ts @@ -1,6 +1,5 @@ import { h } from 'vue' import { defineClientConfig } from 'vuepress/client' -import type { ClientConfig } from 'vuepress/client' import type { NoticeAttrOptions } from '../shared/index.js' import { Notice } from './components/index.js' @@ -10,4 +9,4 @@ declare const __NOTICE_OPTIONS__: NoticeAttrOptions[] export default defineClientConfig({ rootComponents: [() => h(Notice, { config: __NOTICE_OPTIONS__ })], -}) as ClientConfig +}) diff --git a/plugins/features/plugin-notice/src/client/styles/notice.scss b/plugins/features/plugin-notice/src/client/styles/notice.scss index 88be10d27a..5cd9c4f453 100644 --- a/plugins/features/plugin-notice/src/client/styles/notice.scss +++ b/plugins/features/plugin-notice/src/client/styles/notice.scss @@ -25,8 +25,8 @@ .vp-notice-wrapper { position: fixed; - top: 80px; inset-inline-end: 20px; + top: 80px; z-index: var(--notice-z-index); overflow: hidden; diff --git a/plugins/features/plugin-nprogress/CHANGELOG.md b/plugins/features/plugin-nprogress/CHANGELOG.md index 92104858a7..053b43fc7a 100644 --- a/plugins/features/plugin-nprogress/CHANGELOG.md +++ b/plugins/features/plugin-nprogress/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-nprogress + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-nprogress + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-nprogress + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-nprogress + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-nprogress diff --git a/plugins/features/plugin-nprogress/package.json b/plugins/features/plugin-nprogress/package.json index 612f585167..727dea1dcc 100644 --- a/plugins/features/plugin-nprogress/package.json +++ b/plugins/features/plugin-nprogress/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-nprogress", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - nprogress", "keywords": [ "vuepress-plugin", @@ -36,10 +36,10 @@ "copy": "cpx \"src/**/*.css\" lib" }, "dependencies": { - "vue": "^3.4.27" + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/features/plugin-nprogress/src/client/config.ts b/plugins/features/plugin-nprogress/src/client/config.ts index 68b719bd52..d758d133db 100644 --- a/plugins/features/plugin-nprogress/src/client/config.ts +++ b/plugins/features/plugin-nprogress/src/client/config.ts @@ -1,4 +1,3 @@ -import type { ClientConfig } from 'vuepress/client' import { defineClientConfig } from 'vuepress/client' import { useNprogress } from './composables/index.js' @@ -6,4 +5,4 @@ export default defineClientConfig({ setup() { useNprogress() }, -}) as ClientConfig +}) diff --git a/plugins/features/plugin-photo-swipe/CHANGELOG.md b/plugins/features/plugin-photo-swipe/CHANGELOG.md index 3946dc1d6e..b36d4d3260 100644 --- a/plugins/features/plugin-photo-swipe/CHANGELOG.md +++ b/plugins/features/plugin-photo-swipe/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-photo-swipe + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-photo-swipe + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-photo-swipe + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-photo-swipe + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) ### Features diff --git a/plugins/features/plugin-photo-swipe/package.json b/plugins/features/plugin-photo-swipe/package.json index d35c57211a..03068a9baa 100644 --- a/plugins/features/plugin-photo-swipe/package.json +++ b/plugins/features/plugin-photo-swipe/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-photo-swipe", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - photo-swipe", "keywords": [ "vuepress-plugin", @@ -44,12 +44,12 @@ }, "dependencies": { "@vuepress/helper": "workspace:*", - "@vueuse/core": "^10.10.0", + "@vueuse/core": "^10.11.0", "photoswipe": "^5.4.4", - "vue": "^3.4.27" + "vue": "^3.4.32" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/features/plugin-photo-swipe/src/client/config.ts b/plugins/features/plugin-photo-swipe/src/client/config.ts index d57909f6db..4507cb8c91 100644 --- a/plugins/features/plugin-photo-swipe/src/client/config.ts +++ b/plugins/features/plugin-photo-swipe/src/client/config.ts @@ -1,4 +1,3 @@ -import type { ClientConfig } from 'vuepress/client' import { defineClientConfig } from 'vuepress/client' import type { PhotoSwipePluginLocaleData } from '../shared/index.js' import { usePhotoSwipe } from './composables/index.js' @@ -38,4 +37,4 @@ export default defineClientConfig({ scrollToClose, }) }, -}) as ClientConfig +}) diff --git a/plugins/features/plugin-watermark/CHANGELOG.md b/plugins/features/plugin-watermark/CHANGELOG.md index 7d1a95ab37..f13e1f026f 100644 --- a/plugins/features/plugin-watermark/CHANGELOG.md +++ b/plugins/features/plugin-watermark/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-watermark + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-watermark + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-watermark + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-watermark + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-watermark diff --git a/plugins/features/plugin-watermark/package.json b/plugins/features/plugin-watermark/package.json index f7a141615d..e6e4bb532b 100644 --- a/plugins/features/plugin-watermark/package.json +++ b/plugins/features/plugin-watermark/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-watermark", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - watermark", "keywords": [ "vuepress-plugin", @@ -36,11 +36,11 @@ }, "dependencies": { "@vuepress/helper": "workspace:*", - "vue": "^3.4.27", - "watermark-js-plus": "^1.5.1" + "vue": "^3.4.32", + "watermark-js-plus": "^1.5.2" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/features/plugin-watermark/src/client/config.ts b/plugins/features/plugin-watermark/src/client/config.ts index c4a95b23ec..f03bc46e17 100644 --- a/plugins/features/plugin-watermark/src/client/config.ts +++ b/plugins/features/plugin-watermark/src/client/config.ts @@ -1,7 +1,6 @@ import { isPlainObject } from '@vuepress/helper/client' import { computed } from 'vue' import { defineClientConfig, usePageFrontmatter } from 'vuepress/client' -import type { ClientConfig } from 'vuepress/client' import type { WatermarkPluginFrontmatter } from '../shared/options.js' import { setupWatermark } from './composables/index.js' import { injectWatermarkConfig, useWatermarkOptions } from './helper/index.js' @@ -35,4 +34,4 @@ export default defineClientConfig({ setupWatermark(watermarkOptions, enabled, __WM_DELAY__) }, -}) as ClientConfig +}) diff --git a/plugins/markdown/plugin-append-date/CHANGELOG.md b/plugins/markdown/plugin-append-date/CHANGELOG.md index 92a9ca5264..2868fce099 100644 --- a/plugins/markdown/plugin-append-date/CHANGELOG.md +++ b/plugins/markdown/plugin-append-date/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-append-date + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-append-date + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-append-date + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-append-date + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-append-date diff --git a/plugins/markdown/plugin-append-date/package.json b/plugins/markdown/plugin-append-date/package.json index 973be8365c..1af23392fa 100644 --- a/plugins/markdown/plugin-append-date/package.json +++ b/plugins/markdown/plugin-append-date/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-append-date", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - append date", "keywords": [ "vuepress-plugin", @@ -42,7 +42,7 @@ }, "peerDependencies": { "@vuepress/plugin-git": "workspace:*", - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/markdown/plugin-append-date/src/node/checkGitPlugin.ts b/plugins/markdown/plugin-append-date/src/node/checkGitPlugin.ts index 5d3c0b3d0a..c18a7915f4 100644 --- a/plugins/markdown/plugin-append-date/src/node/checkGitPlugin.ts +++ b/plugins/markdown/plugin-append-date/src/node/checkGitPlugin.ts @@ -17,7 +17,7 @@ export const isGitPluginEnabled = (app: App): boolean => { logger.info(`${colors.magenta(GIT_PLUGIN_NAME)} is not enabled.`) return false - } catch (err) { + } catch { logger.error( `${colors.magenta( GIT_PLUGIN_NAME, diff --git a/plugins/markdown/plugin-links-check/CHANGELOG.md b/plugins/markdown/plugin-links-check/CHANGELOG.md index a9567e2b3f..bb9d191e6d 100644 --- a/plugins/markdown/plugin-links-check/CHANGELOG.md +++ b/plugins/markdown/plugin-links-check/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-links-check + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-links-check + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-links-check + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-links-check + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-links-check diff --git a/plugins/markdown/plugin-links-check/package.json b/plugins/markdown/plugin-links-check/package.json index 5a06957e09..edf61a92d3 100644 --- a/plugins/markdown/plugin-links-check/package.json +++ b/plugins/markdown/plugin-links-check/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-links-check", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - links-check", "keywords": [ "vuepress-plugin", @@ -41,7 +41,7 @@ "@vuepress/helper": "workspace:*" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/markdown/plugin-markdown-container/CHANGELOG.md b/plugins/markdown/plugin-markdown-container/CHANGELOG.md index 067e3c0212..39458c4229 100644 --- a/plugins/markdown/plugin-markdown-container/CHANGELOG.md +++ b/plugins/markdown/plugin-markdown-container/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-markdown-container + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-markdown-container diff --git a/plugins/markdown/plugin-markdown-container/package.json b/plugins/markdown/plugin-markdown-container/package.json index 93c9fe2479..f667787f78 100644 --- a/plugins/markdown/plugin-markdown-container/package.json +++ b/plugins/markdown/plugin-markdown-container/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-markdown-container", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.37", "description": "VuePress plugin - markdown container", "keywords": [ "vuepress-plugin", @@ -39,7 +39,7 @@ "markdown-it-container": "^4.0.0" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "devDependencies": { "markdown-it": "^14.1.0" diff --git a/plugins/markdown/plugin-markdown-image/CHANGELOG.md b/plugins/markdown/plugin-markdown-image/CHANGELOG.md index d9957c4307..06a6300850 100644 --- a/plugins/markdown/plugin-markdown-image/CHANGELOG.md +++ b/plugins/markdown/plugin-markdown-image/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-markdown-image + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-markdown-image + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-markdown-image + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-markdown-image + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-markdown-image diff --git a/plugins/markdown/plugin-markdown-image/package.json b/plugins/markdown/plugin-markdown-image/package.json index bcb734a518..36e81b00c4 100644 --- a/plugins/markdown/plugin-markdown-image/package.json +++ b/plugins/markdown/plugin-markdown-image/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-markdown-image", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - markdown image", "keywords": [ "vuepress-plugin", @@ -53,7 +53,7 @@ "@vuepress/helper": "workspace:*" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/markdown/plugin-markdown-math/CHANGELOG.md b/plugins/markdown/plugin-markdown-math/CHANGELOG.md index 65980d12f6..3c410dd1a2 100644 --- a/plugins/markdown/plugin-markdown-math/CHANGELOG.md +++ b/plugins/markdown/plugin-markdown-math/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +**Note:** Version bump only for package @vuepress/plugin-markdown-math + +# [2.0.0-rc.38](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.37...v2.0.0-rc.38) (2024-07-13) + +**Note:** Version bump only for package @vuepress/plugin-markdown-math + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-markdown-math + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +**Note:** Version bump only for package @vuepress/plugin-markdown-math + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) **Note:** Version bump only for package @vuepress/plugin-markdown-math diff --git a/plugins/markdown/plugin-markdown-math/package.json b/plugins/markdown/plugin-markdown-math/package.json index 79be773559..490465bc4a 100644 --- a/plugins/markdown/plugin-markdown-math/package.json +++ b/plugins/markdown/plugin-markdown-math/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-markdown-math", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - markdown math", "keywords": [ "vuepress-plugin", @@ -44,12 +44,12 @@ "@mdit/plugin-mathjax-slim": "^0.12.0", "@types/markdown-it": "^14.1.1", "@vuepress/helper": "workspace:*", - "vue": "^3.4.27" + "vue": "^3.4.32" }, "peerDependencies": { "katex": "^0.16.10", "mathjax-full": "^3.2.2", - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "peerDependenciesMeta": { "katex": { diff --git a/plugins/markdown/plugin-markdown-math/src/client/styles/katex.scss b/plugins/markdown/plugin-markdown-math/src/client/styles/katex.scss index 982f56806d..8f8c5da654 100644 --- a/plugins/markdown/plugin-markdown-math/src/client/styles/katex.scss +++ b/plugins/markdown/plugin-markdown-math/src/client/styles/katex.scss @@ -6,11 +6,12 @@ .katex-display { overflow: auto hidden; - -webkit-overflow-scrolling: touch; padding-top: 0.2em; padding-bottom: 0.2em; + -webkit-overflow-scrolling: touch; + scrollbar-width: thin; &::-webkit-scrollbar { diff --git a/plugins/markdown/plugin-prismjs/CHANGELOG.md b/plugins/markdown/plugin-prismjs/CHANGELOG.md index e66141787c..2fdea33292 100644 --- a/plugins/markdown/plugin-prismjs/CHANGELOG.md +++ b/plugins/markdown/plugin-prismjs/CHANGELOG.md @@ -3,6 +3,28 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-rc.39](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.38...v2.0.0-rc.39) (2024-07-19) + +### Bug Fixes + +- **plugin-prismjs:** fix scss variable ([f9dcfcf](https://github.com/vuepress/ecosystem/commit/f9dcfcf90fc85974fb86ba70409ca8be8d9da941)) +- **plugin-prismjs:** unify word highlight option name ([6b48402](https://github.com/vuepress/ecosystem/commit/6b48402a3ec501238e4f77a6db186298a8791185)) + +### Features + +- make styles built-in for highlighter plugins ([#217](https://github.com/vuepress/ecosystem/issues/217)) ([25e1ea2](https://github.com/vuepress/ecosystem/commit/25e1ea2c755bb7858b397a93982d6b92ec8d18c5)) + +# [2.0.0-rc.37](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.36...v2.0.0-rc.37) (2024-06-21) + +**Note:** Version bump only for package @vuepress/plugin-prismjs + +# [2.0.0-rc.36](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.35...v2.0.0-rc.36) (2024-06-18) + +### Features + +- add support for highlight whitespace ([#204](https://github.com/vuepress/ecosystem/issues/204)) ([b91d04e](https://github.com/vuepress/ecosystem/commit/b91d04e5cc44adcff7405f2cdc14c4b9a6d9834d)) +- add support for word highlight ([#201](https://github.com/vuepress/ecosystem/issues/201)) ([6f37277](https://github.com/vuepress/ecosystem/commit/6f372774488f79e8570e1d8b4b1e26a5744be807)) + # [2.0.0-rc.34](https://github.com/vuepress/ecosystem/compare/v2.0.0-rc.33...v2.0.0-rc.34) (2024-06-04) ### Features diff --git a/plugins/markdown/plugin-prismjs/package.json b/plugins/markdown/plugin-prismjs/package.json index 9a969207ae..fbd7d3145e 100644 --- a/plugins/markdown/plugin-prismjs/package.json +++ b/plugins/markdown/plugin-prismjs/package.json @@ -1,6 +1,6 @@ { "name": "@vuepress/plugin-prismjs", - "version": "2.0.0-rc.34", + "version": "2.0.0-rc.39", "description": "VuePress plugin - prismjs", "keywords": [ "vuepress-plugin", @@ -23,6 +23,7 @@ "type": "module", "exports": { ".": "./lib/node/index.js", + "./styles/*": "./lib/client/styles/*", "./package.json": "./package.json" }, "main": "./lib/node/index.js", @@ -32,9 +33,11 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json", - "clean": "rimraf --glob ./lib ./*.tsbuildinfo" + "clean": "rimraf --glob ./lib ./*.tsbuildinfo", + "style": "tsx scripts/generateThemeFiles.ts" }, "dependencies": { + "@vuepress/helper": "workspace:*", "@vuepress/highlighter-helper": "workspace:*", "prismjs": "^1.29.0" }, @@ -44,7 +47,7 @@ "markdown-it": "^14.1.0" }, "peerDependencies": { - "vuepress": "2.0.0-rc.13" + "vuepress": "2.0.0-rc.14" }, "publishConfig": { "access": "public" diff --git a/plugins/markdown/plugin-prismjs/scripts/generateThemeFiles.ts b/plugins/markdown/plugin-prismjs/scripts/generateThemeFiles.ts new file mode 100644 index 0000000000..66603192dd --- /dev/null +++ b/plugins/markdown/plugin-prismjs/scripts/generateThemeFiles.ts @@ -0,0 +1,79 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { compileString } from 'sass' +import { fs, getDirname, path } from 'vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +const styleDir = path.resolve(__dirname, '../src/client/styles') +const themeDir = path.resolve(styleDir, 'themes') +const outputDir = path.resolve(__dirname, '../lib/client/styles') + +const themeFiles = fs.readdirSync(themeDir) + +fs.ensureDirSync(outputDir) + +themeFiles.forEach((file) => { + const filename = path.basename(file, '.scss') + const themeContent = ` +@use 'mixins'; +@use 'themes/${filename}'; + +:root { + @include mixins.color( + $code-text-color: ${filename}.$code-text-color, + $code-bg-color: ${filename}.$code-bg-color + ); +} + +@include ${filename}.style; +` + + const lightThemeContent = ` +@use 'mixins'; +@use 'themes/${filename}'; + +[data-theme='light'] { + @include mixins.color( + $code-text-color: ${filename}.$code-text-color, + $code-bg-color: ${filename}.$code-bg-color + ); + @include ${filename}.style; +} +` + + const darkThemeContent = ` +@use 'mixins'; +@use 'themes/${filename}'; + +[data-theme='dark'] { + @include mixins.color( + $code-text-color: ${filename}.$code-text-color, + $code-bg-color: ${filename}.$code-bg-color + ); + @include ${filename}.style; +} +` + + const themeCss = compileString(themeContent, { + loadPaths: [styleDir], + }).css + + const lightThemeCss = compileString(lightThemeContent, { + loadPaths: [styleDir], + }).css + + const darkThemeCss = compileString(darkThemeContent, { + loadPaths: [styleDir], + }).css + + fs.writeFileSync(path.resolve(outputDir, `${filename}.css`), themeCss) + fs.writeFileSync( + path.resolve(outputDir, `${filename}.light.css`), + lightThemeCss, + ) + + fs.writeFileSync( + path.resolve(outputDir, `${filename}.dark.css`), + darkThemeCss, + ) +}) diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/_mixins.scss b/plugins/markdown/plugin-prismjs/src/client/styles/_mixins.scss new file mode 100644 index 0000000000..7644440675 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/_mixins.scss @@ -0,0 +1,17 @@ +@use 'sass:color'; + +@mixin color($code-text-color, $code-bg-color) { + // base + --code-c-text: #{$code-text-color}; + --code-c-bg: #{$code-bg-color}; + + // highlight + --code-highlight-bg-color: #{color.scale( + $code-bg-color, + $saturation: if(color.whiteness($code-bg-color) < 50%, 5%, 10%), + $lightness: if(color.whiteness($code-bg-color) < 50%, 5%, -5%) + )}; + + // line-number + --code-line-number-color: #{color.scale($code-text-color, $alpha: -33%)}; +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/ateliersulphurpool-light.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/ateliersulphurpool-light.scss new file mode 100644 index 0000000000..8dfa23b347 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/ateliersulphurpool-light.scss @@ -0,0 +1,111 @@ +/* + * Name: Base16 Atelier Sulphurpool Light + * Author: Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/sulphurpool) + * Prism template by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/prism/) + * Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-base16-ateliersulphurpool.light.css + */ + +$code-text-color: #5e6687; +$code-bg-color: #f5f7ff; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #dfe2f1; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #898ea4; + } + + .token.punctuation { + color: #5e6687; + } + + .token.namespace { + opacity: 0.7; + } + + .token.operator, + .token.boolean, + .token.number { + color: #c76b29; + } + + .token.property { + color: #c08b30; + } + + .token.tag { + color: #3d8fd1; + } + + .token.string { + color: #22a2c9; + } + + .token.selector { + color: #6679cc; + } + + .token.attr-name { + color: #c76b29; + } + + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string { + color: #22a2c9; + } + + .token.attr-value, + .token.keyword, + .token.control, + .token.directive, + .token.unit { + color: #ac9739; + } + + .token.statement, + .token.regex, + .token.atrule { + color: #22a2c9; + } + + .token.placeholder, + .token.variable { + color: #3d8fd1; + } + + .token.deleted { + text-decoration: line-through; + } + + .token.inserted { + border-bottom: 1px dotted #202746; + text-decoration: none; + } + + .token.italic { + font-style: italic; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.important { + color: #c94922; + } + + .token.entity { + cursor: help; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/atom-dark.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/atom-dark.scss new file mode 100644 index 0000000000..69e550e7eb --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/atom-dark.scss @@ -0,0 +1,108 @@ +/** + * atom-dark theme for `prism.js` + * Based on Atom's `atom-dark` theme: https://github.com/atom/atom-dark-syntax + * @author Joe Gibson (@gibsjose) + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-atom-dark.css + */ + +$code-text-color: #c5c8c6; +$code-bg-color: #1d1f21; + +@mixin style { + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #7c7c7c; + } + + .token.punctuation { + color: #c5c8c6; + } + + .namespace { + opacity: 0.7; + } + + .token.property, + .token.keyword, + .token.tag { + color: #96cbfe; + } + + .token.class-name { + color: #ffffb6; + text-decoration: underline; + } + + .token.boolean, + .token.constant { + color: #9c9; + } + + .token.symbol, + .token.deleted { + color: #f92672; + } + + .token.number { + color: #ff73fd; + } + + .token.selector, + .token.attr-name, + .token.string, + .token.char, + .token.builtin, + .token.inserted { + color: #a8ff60; + } + + .token.variable { + color: #c6c5fe; + } + + .token.operator { + color: #ededed; + } + + .token.entity { + color: #ffffb6; + cursor: help; + } + + .token.url { + color: #96cbfe; + } + + .language-css .token.string, + .style .token.string { + color: #87c38a; + } + + .token.atrule, + .token.attr-value { + color: #f9ee98; + } + + .token.function { + color: #dad085; + } + + .token.regex { + color: #e9c062; + } + + .token.important { + color: #fd971f; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/cb.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/cb.scss new file mode 100644 index 0000000000..dffcde9dc0 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/cb.scss @@ -0,0 +1,85 @@ +/* + * Based on Plugin: Syntax Highlighter CB + * Plugin URI: http://wp.tutsplus.com/tutorials/plugins/adding-a-syntax-highlighter-shortcode-using-prism-js + * Description: Highlight your code snippets with an easy to use shortcode based on Lea Verou's Prism.js. + * Version: 1.0.0 + * Author: c.bavota + * Author URI: http://bavotasan.comhttp://wp.tutsplus.com/tutorials/plugins/adding-a-syntax-highlighter-shortcode-using-prism-js/ + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-night-owl.css + */ + +/* http://cbavota.bitbucket.org/syntax-highlighter/ */ + +$code-text-color: #fff; +$code-bg-color: #222; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: rgb(29 59 83 / 99%); + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #797979; + } + + .token.selector, + .token.operator, + .token.punctuation { + color: #fff; + } + + .token.namespace { + opacity: 0.7; + } + + .token.tag, + .token.boolean { + color: #ffd893; + } + + .token.atrule, + .token.attr-value, + .token.hex, + .token.string { + color: #b0c975; + } + + .token.property, + .token.entity, + .token.url, + .token.attr-name, + .token.keyword { + color: #c27628; + } + + .token.regex { + color: #9b71c6; + } + + .token.entity { + cursor: help; + } + + .token.function, + .token.constant { + color: #e5a638; + } + + .token.variable { + color: #fdfba8; + } + + .token.number { + color: #8799b0; + } + + .token.important, + .token.deliminator { + color: #e45734; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/coldark-cold.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/coldark-cold.scss new file mode 100644 index 0000000000..33536b637a --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/coldark-cold.scss @@ -0,0 +1,160 @@ +/** + * Coldark Theme for Prism.js + * Theme variation: Cold + * Tested with HTML, CSS, JS, JSON, PHP, YAML, Bash script + * @author Armand Philippot + * @homepage https://github.com/ArmandPhilippot/coldark-prism + * @license MIT + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-coldark-cold.css + */ + +$code-text-color: #111b27; +$code-bg-color: #e3eaf2; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #8da1b9; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #3c526d; + } + + .token.punctuation { + color: #111b27; + } + + .token.delimiter.important, + .token.selector .parent, + .token.tag, + .token.tag .token.punctuation { + color: #006d6d; + } + + .token.attr-name, + .token.boolean, + .token.boolean.important, + .token.number, + .token.constant, + .token.selector .token.attribute { + color: #755f00; + } + + .token.class-name, + .token.key, + .token.parameter, + .token.property, + .token.property-access, + .token.variable { + color: #005a8e; + } + + .token.attr-value, + .token.inserted, + .token.color, + .token.selector .token.value, + .token.string, + .token.string .token.url-link { + color: #116b00; + } + + .token.builtin, + .token.keyword-array, + .token.package, + .token.regex { + color: #af00af; + } + + .token.function, + .token.selector .token.class, + .token.selector .token.id { + color: #7c00aa; + } + + .token.atrule .token.rule, + .token.combinator, + .token.keyword, + .token.operator, + .token.pseudo-class, + .token.pseudo-element, + .token.selector, + .token.unit { + color: #a04900; + } + + .token.deleted, + .token.important { + color: #c22f2e; + } + + .token.keyword-this, + .token.this { + color: #005a8e; + } + + .token.important, + .token.keyword-this, + .token.this, + .token.bold { + font-weight: bold; + } + + .token.delimiter.important { + font-weight: inherit; + } + + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } + + .language-markdown .token.title, + .language-markdown .token.title .token.punctuation { + color: #005a8e; + font-weight: bold; + } + + .language-markdown .token.blockquote.punctuation { + color: #af00af; + } + + .language-markdown .token.code { + color: #006d6d; + } + + .language-markdown .token.hr.punctuation { + color: #005a8e; + } + + .language-markdown .token.url > .token.content { + color: #116b00; + } + + .language-markdown .token.url-link { + color: #755f00; + } + + .language-markdown .token.list.punctuation { + color: #af00af; + } + + .language-markdown .token.table-header { + color: #111b27; + } + + .language-json .token.operator { + color: #111b27; + } + + .language-scss .token.variable { + color: #006d6d; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/coldark-dark.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/coldark-dark.scss new file mode 100644 index 0000000000..302c565e58 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/coldark-dark.scss @@ -0,0 +1,162 @@ +/** + * Coldark Theme for Prism.js + * Theme variation: Dark + * Tested with HTML, CSS, JS, JSON, PHP, YAML, Bash script + * @author Armand Philippot + * @homepage https://github.com/ArmandPhilippot/coldark-prism + * @license MIT + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-coldark-dark.css + */ + +$code-text-color: #e3eaf2; +$code-bg-color: #111b27; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #3c526d; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #8da1b9; + } + + .token.punctuation { + color: #e3eaf2; + } + + .token.delimiter.important, + .token.selector .parent, + .token.tag, + .token.tag .token.punctuation { + color: #6cc; + } + + .token.attr-name, + .token.boolean, + .token.boolean.important, + .token.number, + .token.constant, + .token.selector .token.attribute { + color: #e6d37a; + } + + .token.class-name, + .token.key, + .token.parameter, + .token.property, + .token.property-access, + .token.variable { + color: #6cb8e6; + } + + .token.attr-value, + .token.inserted, + .token.color, + .token.selector .token.value, + .token.string, + .token.string .token.url-link { + color: #91d076; + } + + .token.builtin, + .token.keyword-array, + .token.package, + .token.regex { + color: #f4adf4; + } + + .token.function, + .token.selector .token.class, + .token.selector .token.id { + color: #c699e3; + } + + .token.atrule .token.rule, + .token.combinator, + .token.keyword, + .token.operator, + .token.pseudo-class, + .token.pseudo-element, + .token.selector, + .token.unit { + color: #e9ae7e; + } + + .token.deleted, + .token.important { + color: #cd6660; + } + + .token.keyword-this, + .token.this { + color: #6cb8e6; + } + + .token.important, + .token.keyword-this, + .token.this, + .token.bold { + font-weight: bold; + } + + .token.delimiter.important { + font-weight: inherit; + } + + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } + + .language-markdown { + .token.title, + .token.title .token.punctuation { + color: #6cb8e6; + font-weight: bold; + } + + .token.code { + color: #6cc; + } + + .token.url-link { + color: #e6d37a; + } + + .token.table-header { + color: #e3eaf2; + } + + .token.blockquote.punctuation { + color: #f4adf4; + } + + .token.hr.punctuation { + color: #6cb8e6; + } + + .token.list.punctuation { + color: #f4adf4; + } + + .token.url .token.content { + color: #91d076; + } + } + + .language-json .token.operator { + color: #e3eaf2; + } + + .language-scss .token.variable { + color: #6cc; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/coy.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/coy.scss new file mode 100644 index 0000000000..620044d6f1 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/coy.scss @@ -0,0 +1,95 @@ +/** + * 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 + */ + +$code-text-color: #000; +$code-bg-color: #fdfdfd; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #b3d4fc; + } + } + + .token.comment, + .token.block-comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #7d8b99; + } + + .token.punctuation { + color: #5f6364; + } + + .token.property, + .token.tag, + .token.boolean, + .token.number, + .token.function-name, + .token.constant, + .token.symbol, + .token.deleted { + color: #c92c2c; + } + + .token.selector, + .token.attr-name, + .token.string, + .token.char, + .token.function, + .token.builtin, + .token.inserted { + color: #2f9c0a; + } + + .token.operator, + .token.entity, + .token.url, + .token.variable { + background: rgb(255 255 255 / 50%); + color: #a67f59; + } + + .token.atrule, + .token.attr-value, + .token.keyword, + .token.class-name { + color: #1990b8; + } + + .token.regex, + .token.important { + color: #e90; + } + + .language-css .token.string, + .style .token.string { + background: rgb(255 255 255 / 50%); + color: #a67f59; + } + + .token.important { + font-weight: normal; + } + + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } + + .token.namespace { + opacity: 0.7; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/dark.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/dark.scss new file mode 100644 index 0000000000..f6c46f6b2a --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/dark.scss @@ -0,0 +1,94 @@ +/** + * prism.js Dark theme for JavaScript, CSS and HTML + * Based on the slides of the talk “/Reg(exp){2}lained/” + * @author Lea Verou + * Copied from https://github.com/PrismJS/prism/blob/master/themes/prism-dark.css + */ + +$code-text-color: #fff; +$code-bg-color: #4d4033; + +@mixin style { + div[class*='language-'] pre { + text-shadow: 0 -0.1em 0.2em #000; + + @media print { + text-shadow: none; + } + + ::selection { + background: rgb(29 59 83 / 99%); + text-shadow: none; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: hsl(30deg 20% 50%); + } + + .token.punctuation { + opacity: 0.7; + } + + .token.namespace { + opacity: 0.7; + } + + .token.property, + .token.tag, + .token.boolean, + .token.number, + .token.constant, + .token.symbol { + color: hsl(350deg 40% 70%); + } + + .token.selector, + .token.attr-name, + .token.string, + .token.char, + .token.builtin, + .token.inserted { + color: hsl(75deg 70% 60%); + } + + .token.operator, + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string, + .token.variable { + color: hsl(40deg 90% 60%); + } + + .token.atrule, + .token.attr-value, + .token.keyword { + color: hsl(350deg 40% 70%); + } + + .token.regex, + .token.important { + color: #e90; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } + + .token.deleted { + color: #f00; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/dracula.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/dracula.scss new file mode 100644 index 0000000000..8835a443b6 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/dracula.scss @@ -0,0 +1,95 @@ +/** + * Dracula Theme originally by Zeno Rocha [@zenorocha] + * https://draculatheme.com/ + * + * Ported for PrismJS by Albert Vallverdu [@byverdu] + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-dracula.css + */ + +$code-text-color: #f8f8f2; +$code-bg-color: #282a36; + +@mixin style { + div[class*='language-'] pre { + text-shadow: 0 1px rgb(0 0 0 / 30%); + + @media print { + text-shadow: none; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #6272a4; + } + + .token.punctuation { + color: #f8f8f2; + } + + .namespace { + opacity: 0.7; + } + + .token.property, + .token.tag, + .token.constant, + .token.symbol, + .token.deleted { + color: #ff79c6; + } + + .token.boolean, + .token.number { + color: #bd93f9; + } + + .token.selector, + .token.attr-name, + .token.string, + .token.char, + .token.builtin, + .token.inserted { + color: #50fa7b; + } + + .token.operator, + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string, + .token.variable { + color: #f8f8f2; + } + + .token.atrule, + .token.attr-value, + .token.function, + .token.class-name { + color: #f1fa8c; + } + + .token.keyword { + color: #8be9fd; + } + + .token.regex, + .token.important { + color: #ffb86c; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-dark.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-dark.scss new file mode 100644 index 0000000000..f790830564 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-dark.scss @@ -0,0 +1,106 @@ +/* + * Name: Duotone Forest + * Author: by Simurai, adapted from DuoTone themes for Atom (http://simurai.com/projects/2016/01/01/duotone-themes) + * Conversion: Bram de Haan (http://atelierbram.github.io/Base2Tone-prism/output/prism/prism-base2tone-forest-dark.css) + * Generated with Base16 Builder (https://github.com/base16-builder/base16-builder) + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-duotone-dark.css + */ + +$code-text-color: #9a86fd; +$code-bg-color: #2a2734; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #6a51e6; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #6c6783; + } + + .token.punctuation { + color: #6c6783; + } + + .token.namespace { + opacity: 0.7; + } + + .token.tag, + .token.operator, + .token.number { + color: #e09142; + } + + .token.property, + .token.function { + color: #9a86fd; + } + + .token.tag-id, + .token.selector, + .token.atrule-id { + color: #eeebff; + } + + .language-javascript, + .token.attr-name { + color: #c4b9fe; + } + + .language-css, + .language-scss, + .token.boolean, + .token.string, + .token.entity, + .token.url, + .language-css .token.string, + .language-scss .token.string, + .style .token.string, + .token.attr-value, + .token.keyword, + .token.control, + .token.directive, + .token.unit, + .token.statement, + .token.regex, + .token.atrule { + color: #fc9; + } + + .token.placeholder, + .token.variable { + color: #fc9; + } + + .token.deleted { + text-decoration: line-through; + } + + .token.inserted { + border-bottom: 1px dotted #eeebff; + text-decoration: none; + } + + .token.italic { + font-style: italic; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.important { + color: #c4b9fe; + } + + .token.entity { + cursor: help; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-earth.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-earth.scss new file mode 100644 index 0000000000..1d0ee7fc9d --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-earth.scss @@ -0,0 +1,106 @@ +/* + * Name: Duotone Forest + * Author: by Simurai, adapted from DuoTone themes for Atom (http://simurai.com/projects/2016/01/01/duotone-themes) + * Conversion: Bram de Haan (http://atelierbram.github.io/Base2Tone-prism/output/prism/prism-base2tone-forest-dark.css) + * Generated with Base16 Builder (https://github.com/base16-builder/base16-builder) + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-duotone-earth.css + */ + +$code-text-color: #88786d; +$code-bg-color: #322d29; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #6f5849; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #6a5f58; + } + + .token.punctuation { + color: #6a5f58; + } + + .token.namespace { + opacity: 0.7; + } + + .token.tag, + .token.operator, + .token.number { + color: #bfa05a; + } + + .token.property, + .token.function { + color: #88786d; + } + + .token.tag-id, + .token.selector, + .token.atrule-id { + color: #fff3eb; + } + + .language-javascript, + .token.attr-name { + color: #a48774; + } + + .language-css, + .language-scss, + .token.boolean, + .token.string, + .token.entity, + .token.url, + .language-css .token.string, + .language-scss .token.string, + .style .token.string, + .token.attr-value, + .token.keyword, + .token.control, + .token.directive, + .token.unit, + .token.statement, + .token.regex, + .token.atrule { + color: #fcc440; + } + + .token.placeholder, + .token.variable { + color: #fcc440; + } + + .token.deleted { + text-decoration: line-through; + } + + .token.inserted { + border-bottom: 1px dotted #fff3eb; + text-decoration: none; + } + + .token.italic { + font-style: italic; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.important { + color: #a48774; + } + + .token.entity { + cursor: help; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-forest.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-forest.scss new file mode 100644 index 0000000000..ee8e237c6b --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-forest.scss @@ -0,0 +1,106 @@ +/* + * Name: Duotone Forest + * Author: by Simurai, adapted from DuoTone themes for Atom (http://simurai.com/projects/2016/01/01/duotone-themes) + * Conversion: Bram de Haan (http://atelierbram.github.io/Base2Tone-prism/output/prism/prism-base2tone-forest-dark.css) + * Generated with Base16 Builder (https://github.com/base16-builder/base16-builder) + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-duotone-forest.css + */ + +$code-text-color: #687d68; +$code-bg-color: #2a2d2a; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #435643; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #535f53; + } + + .token.punctuation { + color: #535f53; + } + + .token.namespace { + opacity: 0.7; + } + + .token.tag, + .token.operator, + .token.number { + color: #a2b34d; + } + + .token.property, + .token.function { + color: #687d68; + } + + .token.tag-id, + .token.selector, + .token.atrule-id { + color: #f0fff0; + } + + .language-javascript, + .token.attr-name { + color: #b3d6b3; + } + + .language-css, + .language-scss, + .token.boolean, + .token.string, + .token.entity, + .token.url, + .language-css .token.string, + .language-scss .token.string, + .style .token.string, + .token.attr-value, + .token.keyword, + .token.control, + .token.directive, + .token.unit, + .token.statement, + .token.regex, + .token.atrule { + color: #e5fb79; + } + + .token.placeholder, + .token.variable { + color: #e5fb79; + } + + .token.deleted { + text-decoration: line-through; + } + + .token.inserted { + border-bottom: 1px dotted #f0fff0; + text-decoration: none; + } + + .token.italic { + font-style: italic; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.important { + color: #b3d6b3; + } + + .token.entity { + cursor: help; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-light.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-light.scss new file mode 100644 index 0000000000..9f38b1c5d9 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-light.scss @@ -0,0 +1,106 @@ +/* + * Name: Duotone Light + * Author: Simurai, adapted from DuoTone themes for Atom (http://simurai.com/projects/2016/01/01/duotone-themes) + * Conversion: Bram de Haan (http://atelierbram.github.io/Base2Tone-prism/output/prism/prism-base2tone-morning-light.css) + * Generated with Base16 Builder (https://github.com/base16-builder/base16-builder) + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-duotone-light.css +*/ + +$code-text-color: #728fcb; +$code-bg-color: #faf8f5; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #faf8f5; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #b6ad9a; + } + + .token.punctuation { + color: #b6ad9a; + } + + .token.namespace { + opacity: 0.7; + } + + .token.tag, + .token.operator, + .token.number { + color: #063289; + } + + .token.property, + .token.function { + color: #b29762; + } + + .token.tag-id, + .token.selector, + .token.atrule-id { + color: #2d2006; + } + + .language-javascript, + .token.attr-name { + color: #896724; + } + + .language-css, + .language-scss, + .token.boolean, + .token.string, + .token.entity, + .token.url, + .language-css .token.string, + .language-scss .token.string, + .style .token.string, + .token.attr-value, + .token.keyword, + .token.control, + .token.directive, + .token.unit, + .token.statement, + .token.regex, + .token.atrule { + color: #728fcb; + } + + .token.placeholder, + .token.variable { + color: #93abdc; + } + + .token.deleted { + text-decoration: line-through; + } + + .token.inserted { + border-bottom: 1px dotted #2d2006; + text-decoration: none; + } + + .token.italic { + font-style: italic; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.important { + color: #896724; + } + + .token.entity { + cursor: help; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-sea.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-sea.scss new file mode 100644 index 0000000000..8acc119426 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-sea.scss @@ -0,0 +1,106 @@ +/* + * Name: Duotone Forest + * Author: by Simurai, adapted from DuoTone themes for Atom (http://simurai.com/projects/2016/01/01/duotone-themes) + * Conversion: Bram de Haan (http://atelierbram.github.io/Base2Tone-prism/output/prism/prism-base2tone-forest-dark.css) + * Generated with Base16 Builder (https://github.com/base16-builder/base16-builder) + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-duotone-sea.css + */ + +$code-text-color: #57718e; +$code-bg-color: #1d262f; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #004a9e; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #4a5f78; + } + + .token.punctuation { + color: #4a5f78; + } + + .token.namespace { + opacity: 0.7; + } + + .token.tag, + .token.operator, + .token.number { + color: #0aa370; + } + + .token.property, + .token.function { + color: #57718e; + } + + .token.tag-id, + .token.selector, + .token.atrule-id { + color: #ebf4ff; + } + + .language-javascript, + .token.attr-name { + color: #7eb6f6; + } + + .language-css, + .language-scss, + .token.boolean, + .token.string, + .token.entity, + .token.url, + .language-css .token.string, + .language-scss .token.string, + .style .token.string, + .token.attr-value, + .token.keyword, + .token.control, + .token.directive, + .token.unit, + .token.statement, + .token.regex, + .token.atrule { + color: #47ebb4; + } + + .token.placeholder, + .token.variable { + color: #47ebb4; + } + + .token.deleted { + text-decoration: line-through; + } + + .token.inserted { + border-bottom: 1px dotted #ebf4ff; + text-decoration: none; + } + + .token.italic { + font-style: italic; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.important { + color: #7eb6f6; + } + + .token.entity { + cursor: help; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-space.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-space.scss new file mode 100644 index 0000000000..93ad1cb0b7 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/duotone-space.scss @@ -0,0 +1,106 @@ +/* + * Name: Duotone Forest + * Author: by Simurai, adapted from DuoTone themes for Atom (http://simurai.com/projects/2016/01/01/duotone-themes) + * Conversion: Bram de Haan (http://atelierbram.github.io/Base2Tone-prism/output/prism/prism-base2tone-forest-dark.css) + * Generated with Base16 Builder (https://github.com/base16-builder/base16-builder) + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-duotone-space.css + */ + +$code-text-color: #767693; +$code-bg-color: #24242e; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #5151e6; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #5b5b76; + } + + .token.punctuation { + color: #5b5b76; + } + + .token.namespace { + opacity: 0.7; + } + + .token.tag, + .token.operator, + .token.number { + color: #dd672c; + } + + .token.property, + .token.function { + color: #767693; + } + + .token.tag-id, + .token.selector, + .token.atrule-id { + color: #ebebff; + } + + .language-javascript, + .token.attr-name { + color: #aaaaca; + } + + .language-css, + .language-scss, + .token.boolean, + .token.string, + .token.entity, + .token.url, + .language-css .token.string, + .language-scss .token.string, + .style .token.string, + .token.attr-value, + .token.keyword, + .token.control, + .token.directive, + .token.unit, + .token.statement, + .token.regex, + .token.atrule { + color: #fe8c52; + } + + .token.placeholder, + .token.variable { + color: #fe8c52; + } + + .token.deleted { + text-decoration: line-through; + } + + .token.inserted { + border-bottom: 1px dotted #ebebff; + text-decoration: none; + } + + .token.italic { + font-style: italic; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.important { + color: #aaaaca; + } + + .token.entity { + cursor: help; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/ghcolors.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/ghcolors.scss new file mode 100644 index 0000000000..cb9e34dd22 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/ghcolors.scss @@ -0,0 +1,91 @@ +/** + * GHColors theme by Avi Aryan (http://aviaryan.in) + * Inspired by GitHub syntax coloring + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-ghcolors.css + */ + +$code-text-color: #393a34; +$code-bg-color: #f8f8f8; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #b3d4fc; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #998; + font-style: italic; + } + + .token.namespace { + opacity: 0.7; + } + + .token.string, + .token.attr-value { + color: #e3116c; + } + + .token.punctuation, + .token.operator { + color: #393a34; /* no highlight */ + } + + .token.entity, + .token.url, + .token.symbol, + .token.number, + .token.boolean, + .token.variable, + .token.constant, + .token.property, + .token.regex, + .token.inserted { + color: #36acaa; + } + + .token.atrule, + .token.keyword, + .token.attr-name { + color: #00a4db; + } + + .token.function, + .token.deleted { + color: #9a050f; + } + + .token.tag, + .token.selector { + color: #00009f; + } + + .token.important, + .token.function, + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .language-autohotkey { + .token.selector { + color: #00a4db; + } + + .token.tag { + color: #9a050f; + } + + .token.keyword { + color: #00009f; + } + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/gruvbox-dark.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/gruvbox-dark.scss new file mode 100644 index 0000000000..3b3f0007a2 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/gruvbox-dark.scss @@ -0,0 +1,101 @@ +/** + * Gruvbox dark theme + * + * Adapted from a theme based on: + * Vim Gruvbox dark Theme (https://github.com/morhetz/gruvbox) + * + * @author Azat S. + * @version 1.0 + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-gruvbox-dark.css + */ + +$code-text-color: #ebdbb2; +$code-bg-color: #1d2021; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #7c6f64; + color: #fbf1c7; + } + } + + .token.comment, + .token.prolog, + .token.cdata { + color: #a89984; + } + + .token.delimiter, + .token.boolean, + .token.keyword, + .token.selector, + .token.important, + .token.atrule { + color: #fb4934; + } + + .token.operator, + .token.punctuation, + .token.attr-name { + color: #a89984; + } + + .token.tag, + .token.tag .punctuation, + .token.doctype, + .token.builtin { + color: #fabd2f; + } + + .token.entity, + .token.number, + .token.symbol { + color: #d3869b; + } + + .token.property, + .token.constant, + .token.variable { + color: #fb4934; + } + + .token.string, + .token.char { + color: #b8bb26; + } + + .token.attr-value, + .token.attr-value .punctuation { + color: #a89984; + } + + .token.url { + color: #b8bb26; + text-decoration: underline; + } + + .token.function { + color: #fabd2f; + } + + .token.regex { + background: #b8bb26; + } + + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .token.inserted { + background: #a89984; + } + + .token.deleted { + background: #fb4934; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/gruvbox-light.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/gruvbox-light.scss new file mode 100644 index 0000000000..5cdd949e25 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/gruvbox-light.scss @@ -0,0 +1,101 @@ +/** + * Gruvbox light theme + * + * Based on Gruvbox: https://github.com/morhetz/gruvbox + * Adapted from PrismJS gruvbox-dark theme: https://github.com/schnerring/prism-themes/blob/master/themes/prism-gruvbox-dark.css + * + * @author Michael Schnerring (https://schnerring.net) + * @version 1.0 + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-gruvbox-light.css + */ + +$code-text-color: #3c3836; +$code-bg-color: #f9f5d7; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #a89984; + color: #282828; + } + } + + .token.comment, + .token.prolog, + .token.cdata { + color: #7c6f64; + } + + .token.delimiter, + .token.boolean, + .token.keyword, + .token.selector, + .token.important, + .token.atrule { + color: #9d0006; + } + + .token.operator, + .token.punctuation, + .token.attr-name { + color: #7c6f64; + } + + .token.tag, + .token.tag .punctuation, + .token.doctype, + .token.builtin { + color: #b57614; + } + + .token.entity, + .token.number, + .token.symbol { + color: #8f3f71; + } + + .token.property, + .token.constant, + .token.variable { + color: #9d0006; + } + + .token.string, + .token.char { + color: #797403; + } + + .token.attr-value, + .token.attr-value .punctuation { + color: #7c6f64; + } + + .token.url { + color: #797403; + text-decoration: underline; + } + + .token.function { + color: #b57614; + } + + .token.regex { + background: #797403; + } + + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .token.inserted { + background: #7c6f64; + } + + .token.deleted { + background: #9d0006; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/holi.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/holi.scss new file mode 100644 index 0000000000..3b7e75016e --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/holi.scss @@ -0,0 +1,79 @@ +/** + * MIT License + * Copyright (c) 2021 Ayush Saini + * Holi Theme for prism.js + * @author Ayush Saini <@AyushCodes on Twitter> + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-holi-theme.css + */ + +$code-text-color: #d6e7ff; +$code-bg-color: #2a4555; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #1d3b54; + color: inherit; + text-shadow: none; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #446e69; + } + + .token.punctuation { + color: #d6b007; + } + + .token.property, + .token.tag, + .token.boolean, + .token.number, + .token.constant, + .token.symbol, + .token.deleted { + color: #d6e7ff; + } + + .token.selector, + .token.attr-name, + .token.builtin, + .token.inserted { + color: #e60067; + } + + .token.string, + .token.char { + color: #49c6ec; + } + + .token.operator, + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string { + background: transparent; + color: #ec8e01; + } + + .token.atrule, + .token.attr-value, + .token.keyword { + color: #0fe468; + } + + .token.function, + .token.class-name { + color: #78f3e9; + } + + .token.regex, + .token.important, + .token.variable { + color: #d6e7ff; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/hopscotch.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/hopscotch.scss new file mode 100644 index 0000000000..35f5c548bf --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/hopscotch.scss @@ -0,0 +1,90 @@ +/* + * Hopscotch + * by Jan T. Sott + * https://github.com/idleberg/Hopscotch + * + * This work is licensed under the Creative Commons CC0 1.0 Universal License + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-hopscotch.css + */ + +$code-text-color: #b9b5b8; +$code-bg-color: #322931; + +@mixin style { + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #797379; + } + + .token.punctuation { + color: #b9b5b8; + } + + .namespace { + opacity: 0.7; + } + + .token.null, + .token.operator, + .token.boolean, + .token.number { + color: #fd8b19; + } + + .token.property { + color: #fdcc59; + } + + .token.tag { + color: #1290bf; + } + + .token.string { + color: #149b93; + } + + .token.selector { + color: #c85e7c; + } + + .token.attr-name { + color: #fd8b19; + } + + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string { + color: #149b93; + } + + .token.attr-value, + .token.keyword, + .token.control, + .token.directive, + .token.unit { + color: #8fc13e; + } + + .token.statement, + .token.regex, + .token.atrule { + color: #149b93; + } + + .token.placeholder, + .token.variable { + color: #1290bf; + } + + .token.important { + color: #dd464c; + font-weight: bold; + } + + .token.entity { + cursor: help; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/lucario.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/lucario.scss new file mode 100644 index 0000000000..2339cb228b --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/lucario.scss @@ -0,0 +1,91 @@ +/** + * Lucario Theme originally by Raphael Amorim [@raphamorim] + * https://github.com/raphamorim/lucario + * + * Ported for PrismJS by Christopher Kapic [@christopher-kapic] + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-lucario.css + */ + +$code-text-color: #f8f8f2; +$code-bg-color: #263e52; + +@mixin style { + div[class*='language-'] pre { + text-shadow: 0 1px rgb(0 0 0 / 30%); + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #5c98cd; + } + + .token.punctuation { + color: #f8f8f2; + } + + .namespace { + opacity: 0.7; + } + + .token.property, + .token.tag, + .token.constant, + .token.symbol, + .token.deleted { + color: #f05e5d; + } + + .token.boolean, + .token.number { + color: #bc94f9; + } + + .token.selector, + .token.attr-name, + .token.string, + .token.char, + .token.builtin, + .token.inserted { + color: #fcfcd6; + } + + .token.operator, + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string, + .token.variable { + color: #f8f8f2; + } + + .token.atrule, + .token.attr-value, + .token.function, + .token.class-name { + color: #66d8ef; + } + + .token.keyword { + color: #6eb26e; + } + + .token.regex, + .token.important { + color: #f05e5d; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/material-dark.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/material-dark.scss new file mode 100644 index 0000000000..bb6b3c46aa --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/material-dark.scss @@ -0,0 +1,170 @@ +/** + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-material-dark.css + */ + +$code-text-color: #eee; +$code-bg-color: #2f2f2f; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #363636; + } + } + + .language-css > code, + .language-sass > code, + .language-scss > code { + color: #fd9170; + } + + [class*='language-'] .namespace { + opacity: 0.7; + } + + .token.atrule { + color: #c792ea; + } + + .token.attr-name { + color: #ffcb6b; + } + + .token.attr-value { + color: #a5e844; + } + + .token.attribute { + color: #a5e844; + } + + .token.boolean { + color: #c792ea; + } + + .token.builtin { + color: #ffcb6b; + } + + .token.cdata { + color: #80cbc4; + } + + .token.char { + color: #80cbc4; + } + + .token.class { + color: #ffcb6b; + } + + .token.class-name { + color: #f2ff00; + } + + .token.comment { + color: #616161; + } + + .token.constant { + color: #c792ea; + } + + .token.deleted { + color: #f66; + } + + .token.doctype { + color: #616161; + } + + .token.entity { + color: #f66; + } + + .token.function { + color: #c792ea; + } + + .token.hexcode { + color: #f2ff00; + } + + .token.id { + color: #c792ea; + font-weight: bold; + } + + .token.important { + color: #c792ea; + font-weight: bold; + } + + .token.inserted { + color: #80cbc4; + } + + .token.keyword { + color: #c792ea; + } + + .token.number { + color: #fd9170; + } + + .token.operator { + color: #89ddff; + } + + .token.prolog { + color: #616161; + } + + .token.property { + color: #80cbc4; + } + + .token.pseudo-class { + color: #a5e844; + } + + .token.pseudo-element { + color: #a5e844; + } + + .token.punctuation { + color: #89ddff; + } + + .token.regex { + color: #f2ff00; + } + + .token.selector { + color: #f66; + } + + .token.string { + color: #a5e844; + } + + .token.symbol { + color: #c792ea; + } + + .token.tag { + color: #f66; + } + + .token.unit { + color: #fd9170; + } + + .token.url { + color: #f66; + } + + .token.variable { + color: #f66; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/material-light.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/material-light.scss new file mode 100644 index 0000000000..225daabc87 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/material-light.scss @@ -0,0 +1,171 @@ +/** + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-material-light.css + */ + +$code-text-color: #90a4ae; +$code-bg-color: #fafafa; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #cceae7; + color: #263238; + } + } + + .language-css > code, + .language-sass > code, + .language-scss > code { + color: #f76d47; + } + + [class*='language-'] .namespace { + opacity: 0.7; + } + + .token.atrule { + color: #7c4dff; + } + + .token.attr-name { + color: #39adb5; + } + + .token.attr-value { + color: #f6a434; + } + + .token.attribute { + color: #f6a434; + } + + .token.boolean { + color: #7c4dff; + } + + .token.builtin { + color: #39adb5; + } + + .token.cdata { + color: #39adb5; + } + + .token.char { + color: #39adb5; + } + + .token.class { + color: #39adb5; + } + + .token.class-name { + color: #6182b8; + } + + .token.comment { + color: #aabfc9; + } + + .token.constant { + color: #7c4dff; + } + + .token.deleted { + color: #e53935; + } + + .token.doctype { + color: #aabfc9; + } + + .token.entity { + color: #e53935; + } + + .token.function { + color: #7c4dff; + } + + .token.hexcode { + color: #f76d47; + } + + .token.id { + color: #7c4dff; + font-weight: bold; + } + + .token.important { + color: #7c4dff; + font-weight: bold; + } + + .token.inserted { + color: #39adb5; + } + + .token.keyword { + color: #7c4dff; + } + + .token.number { + color: #f76d47; + } + + .token.operator { + color: #39adb5; + } + + .token.prolog { + color: #aabfc9; + } + + .token.property { + color: #39adb5; + } + + .token.pseudo-class { + color: #f6a434; + } + + .token.pseudo-element { + color: #f6a434; + } + + .token.punctuation { + color: #39adb5; + } + + .token.regex { + color: #6182b8; + } + + .token.selector { + color: #e53935; + } + + .token.string { + color: #f6a434; + } + + .token.symbol { + color: #7c4dff; + } + + .token.tag { + color: #e53935; + } + + .token.unit { + color: #f76d47; + } + + .token.url { + color: #e53935; + } + + .token.variable { + color: #e53935; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/material-oceanic.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/material-oceanic.scss new file mode 100644 index 0000000000..316982b6ba --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/material-oceanic.scss @@ -0,0 +1,175 @@ +/** + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-material-oceanic.css + */ + +$code-text-color: #c3cee3; +$code-bg-color: #263238; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #363636; + } + } + + .language-css > code, + .language-sass > code, + .language-scss > code { + color: #fd9170; + } + + [class*='language-'] .namespace { + opacity: 0.7; + } + + .token.atrule { + color: #c792ea; + } + + .token.attr-name { + color: #ffcb6b; + } + + .token.attr-value { + color: #c3e88d; + } + + .token.attribute { + color: #c3e88d; + } + + .token.boolean { + color: #c792ea; + } + + .token.builtin { + color: #ffcb6b; + } + + .token.cdata { + color: #80cbc4; + } + + .token.char { + color: #80cbc4; + } + + .token.class { + color: #ffcb6b; + } + + .token.class-name { + color: #f2ff00; + } + + .token.color { + color: #f2ff00; + } + + .token.comment { + color: #546e7a; + } + + .token.constant { + color: #c792ea; + } + + .token.deleted { + color: #f07178; + } + + .token.doctype { + color: #546e7a; + } + + .token.entity { + color: #f07178; + } + + .token.function { + color: #c792ea; + } + + .token.hexcode { + color: #f2ff00; + } + + .token.id { + color: #c792ea; + font-weight: bold; + } + + .token.important { + color: #c792ea; + font-weight: bold; + } + + .token.inserted { + color: #80cbc4; + } + + .token.keyword { + color: #c792ea; + font-style: italic; + } + + .token.number { + color: #fd9170; + } + + .token.operator { + color: #89ddff; + } + + .token.prolog { + color: #546e7a; + } + + .token.property { + color: #80cbc4; + } + + .token.pseudo-class { + color: #c3e88d; + } + + .token.pseudo-element { + color: #c3e88d; + } + + .token.punctuation { + color: #89ddff; + } + + .token.regex { + color: #f2ff00; + } + + .token.selector { + color: #f07178; + } + + .token.string { + color: #c3e88d; + } + + .token.symbol { + color: #c792ea; + } + + .token.tag { + color: #f07178; + } + + .token.unit { + color: #f07178; + } + + .token.url { + color: #fd9170; + } + + .token.variable { + color: #f07; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/night-owl.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/night-owl.scss new file mode 100644 index 0000000000..4643ea373d --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/night-owl.scss @@ -0,0 +1,106 @@ +/** + * MIT License + * Copyright (c) 2018 Sarah Drasner + * Sarah Drasner's[@sdras] Night Owl + * Ported by Sara vieria [@SaraVieira] + * Added by Souvik Mandal [@SimpleIndian] + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-night-owl.css + */ + +$code-text-color: #fff; +$code-bg-color: #011627; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: rgb(29 59 83 / 99%); + } + } + + .token.comment, + .token.prolog, + .token.cdata { + color: rgb(99 119 119); + font-style: italic; + } + + .token.punctuation { + color: rgb(199 146 234); + } + + .namespace { + color: rgb(178 204 214); + } + + .token.deleted { + color: rgb(239 83 80 / 56%); + font-style: italic; + } + + .token.symbol, + .token.property { + color: rgb(128 203 196); + } + + .token.tag, + .token.operator, + .token.keyword { + color: rgb(127 219 202); + } + + .token.boolean { + color: rgb(255 88 116); + } + + .token.number { + color: rgb(247 140 108); + } + + .token.constant, + .token.function, + .token.builtin, + .token.char { + color: rgb(130 170 255); + } + + .token.selector, + .token.doctype { + color: rgb(199 146 234); + font-style: italic; + } + + .token.attr-name, + .token.inserted { + color: rgb(173 219 103); + font-style: italic; + } + + .token.string, + .token.url, + .token.entity, + .language-css .token.string, + .style .token.string { + color: rgb(173 219 103); + } + + .token.class-name, + .token.atrule, + .token.attr-value { + color: rgb(255 203 139); + } + + .token.regex, + .token.important, + .token.variable { + color: rgb(214 222 235); + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/nord.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/nord.scss new file mode 100644 index 0000000000..d2ea512e42 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/nord.scss @@ -0,0 +1,90 @@ +/** + * Nord Theme Originally by Arctic Ice Studio + * https://nordtheme.com + * + * Ported for PrismJS by Zane Hitchcoxc (@zwhitchcox) and Gabriel Ramos (@gabrieluizramos) + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-nord.css + */ + +$code-text-color: #f8f8f2; +$code-bg-color: #2e3440; + +@mixin style { + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #636f88; + } + + .token.punctuation { + color: #81a1c1; + } + + .namespace { + opacity: 0.7; + } + + .token.property, + .token.tag, + .token.constant, + .token.symbol, + .token.deleted { + color: #81a1c1; + } + + .token.number { + color: #b48ead; + } + + .token.boolean { + color: #81a1c1; + } + + .token.selector, + .token.attr-name, + .token.string, + .token.char, + .token.builtin, + .token.inserted { + color: #a3be8c; + } + + .token.operator, + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string, + .token.variable { + color: #81a1c1; + } + + .token.atrule, + .token.attr-value, + .token.function, + .token.class-name { + color: #88c0d0; + } + + .token.keyword { + color: #81a1c1; + } + + .token.regex, + .token.important { + color: #ebcb8b; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/one-dark.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/one-dark.scss new file mode 100644 index 0000000000..efeb85a698 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/one-dark.scss @@ -0,0 +1,192 @@ +/** + * One Light theme for prism.js + * Based on Atom's One Light theme: https://github.com/atom/atom/tree/master/packages/one-light-syntax + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-one-dark.css + */ + +$code-text-color: #abb2bf; +$code-bg-color: #282c34; + +@mixin style { + div[class*='language-'] pre { + text-shadow: 0 1px rgb(0 0 0 / 30%); + + // tab size + tab-size: 2; + + /* Print */ + @media print { + text-shadow: none; + } + + ::selection { + background: #3e4451; + color: inherit; + text-shadow: none; + } + } + + .token.comment, + .token.prolog, + .token.cdata { + color: #5c6370; + } + + .token.doctype, + .token.punctuation, + .token.entity { + color: #abb2bf; + } + + .token.attr-name, + .token.class-name, + .token.boolean, + .token.constant, + .token.number, + .token.atrule { + color: #d19a66; + } + + .token.keyword { + color: #c678dd; + } + + .token.property, + .token.tag, + .token.symbol, + .token.deleted, + .token.important { + color: #e06c75; + } + + .token.selector, + .token.string, + .token.char, + .token.builtin, + .token.inserted, + .token.regex, + .token.attr-value, + .token.attr-value > .token.punctuation { + color: #98c379; + } + + .token.variable, + .token.operator, + .token.function { + color: #61afef; + } + + .token.url { + color: #56b6c2; + } + + /* HTML overrides */ + .token.attr-value > .token.punctuation.attr-equals, + .token.special-attr > .token.attr-value > .token.value.css { + color: #abb2bf; + } + + /* CSS overrides */ + .language-css .token.selector { + color: #e06c75; + } + + .language-css .token.property { + color: #abb2bf; + } + + .language-css .token.function, + .language-css .token.url > .token.function { + color: #56b6c2; + } + + .language-css .token.url > .token.string.url { + color: #98c379; + } + + .language-css .token.important, + .language-css .token.atrule .token.rule { + color: #c678dd; + } + + /* JS overrides */ + .language-javascript .token.operator { + color: #c678dd; + } + + // stylelint-disable-next-line selector-max-compound-selectors + .language-javascript + .token.template-string + > .token.interpolation + > .token.interpolation-punctuation.punctuation { + color: #be5046; + } + + /* JSON overrides */ + .language-json .token.operator { + color: #abb2bf; + } + + .language-json .token.null.keyword { + color: #d19a66; + } + + /* MD overrides */ + .language-markdown .token.url, + .language-markdown .token.url > .token.operator, + .language-markdown .token.url-reference.url > .token.string { + color: #abb2bf; + } + + .language-markdown .token.url > .token.content { + color: #61afef; + } + + .language-markdown .token.url > .token.url, + .language-markdown .token.url-reference.url { + color: #56b6c2; + } + + .language-markdown .token.blockquote.punctuation, + .language-markdown .token.hr.punctuation { + color: #5c6370; + font-style: italic; + } + + .language-markdown .token.code-snippet { + color: #98c379; + } + + .language-markdown .token.bold .token.content { + color: #d19a66; + } + + .language-markdown .token.italic .token.content { + color: #c678dd; + } + + .language-markdown .token.strike .token.content, + .language-markdown .token.strike .token.punctuation, + .language-markdown .token.list.punctuation, + .language-markdown .token.title.important > .token.punctuation { + color: #e06c75; + } + + /* General */ + .token.bold { + font-weight: bold; + } + + .token.comment, + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } + + .token.namespace { + opacity: 0.8; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/one-light.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/one-light.scss new file mode 100644 index 0000000000..d0b3e771d0 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/one-light.scss @@ -0,0 +1,184 @@ +/** + * One Light theme for prism.js + * Based on Atom's One Light theme: https://github.com/atom/atom/tree/master/packages/one-light-syntax + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-one-light.css + */ + +$code-text-color: #383a42; +$code-bg-color: #ecf4fa; + +@mixin style { + div[class*='language-'] pre { + // tab size + tab-size: 2; + + ::selection { + background: #e5e5e6; + color: inherit; + } + } + + .token.comment, + .token.prolog, + .token.cdata { + color: #a0a1a7; + } + + .token.doctype, + .token.punctuation, + .token.entity { + color: #383a42; + } + + .token.attr-name, + .token.class-name, + .token.boolean, + .token.constant, + .token.number, + .token.atrule { + color: #b76b01; + } + + .token.keyword { + color: #a626a4; + } + + .token.property, + .token.tag, + .token.symbol, + .token.deleted, + .token.important { + color: #e45649; + } + + .token.selector, + .token.string, + .token.char, + .token.builtin, + .token.inserted, + .token.regex, + .token.attr-value, + .token.attr-value > .token.punctuation { + color: #50a14f; + } + + .token.variable, + .token.operator, + .token.function { + color: #4078f2; + } + + .token.url { + color: #0184bc; + } + + /* HTML overrides */ + .token.attr-value > .token.punctuation.attr-equals, + .token.special-attr > .token.attr-value > .token.value.css { + color: #383a42; + } + + /* CSS overrides */ + .language-css .token.selector { + color: #e45649; + } + + .language-css .token.property { + color: #383a42; + } + + .language-css .token.function, + .language-css .token.url > .token.function { + color: #0184bc; + } + + .language-css .token.url > .token.string.url { + color: #50a14f; + } + + .language-css .token.important, + .language-css .token.atrule .token.rule { + color: #a626a4; + } + + /* JS overrides */ + .language-javascript .token.operator { + color: #a626a4; + } + + // stylelint-disable-next-line selector-max-compound-selectors + .language-javascript + .token.template-string + > .token.interpolation + > .token.interpolation-punctuation.punctuation { + color: #ca1243; + } + + /* JSON overrides */ + .language-json .token.operator { + color: #383a42; + } + + .language-json .token.null.keyword { + color: #b76b01; + } + + /* MD overrides */ + .language-markdown .token.url, + .language-markdown .token.url > .token.operator, + .language-markdown .token.url-reference.url > .token.string { + color: #383a42; + } + + .language-markdown .token.url > .token.content { + color: #4078f2; + } + + .language-markdown .token.url > .token.url, + .language-markdown .token.url-reference.url { + color: #0184bc; + } + + .language-markdown .token.blockquote.punctuation, + .language-markdown .token.hr.punctuation { + color: #a0a1a7; + font-style: italic; + } + + .language-markdown .token.code-snippet { + color: #50a14f; + } + + .language-markdown .token.bold .token.content { + color: #b76b01; + } + + .language-markdown .token.italic .token.content { + color: #a626a4; + } + + .language-markdown .token.strike .token.content, + .language-markdown .token.strike .token.punctuation, + .language-markdown .token.list.punctuation, + .language-markdown .token.title.important > .token.punctuation { + color: #e45649; + } + + /* General */ + .token.bold { + font-weight: bold; + } + + .token.comment, + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } + + .token.namespace { + opacity: 0.8; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/pojoaque.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/pojoaque.scss new file mode 100644 index 0000000000..c6d7281e3e --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/pojoaque.scss @@ -0,0 +1,99 @@ +/** + * Pojoaque Style by Jason Tate + * http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html + * Based on Solarized Style from http://ethanschoonover.com/solarized + * http://softwaremaniacs.org/media/soft/highlight/test.html + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-pojoaque.css + */ + +$code-text-color: #dccf8f; +$code-bg-color: #181914; + +@mixin style { + .token.namespace { + opacity: 0.7; + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #586e75; + font-style: italic; + } + + .token.number, + .token.string, + .token.char, + .token.builtin, + .token.inserted { + color: #468966; + } + + .token.attr-name { + color: #b89859; + } + + .token.operator, + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string { + color: #dccf8f; + } + + .token.selector, + .token.regex { + color: #859900; + } + + .token.atrule, + .token.keyword { + color: #cb4b16; + } + + .token.attr-value { + color: #468966; + } + + .token.function, + .token.variable, + .token.placeholder { + color: #b58900; + } + + .token.property, + .token.tag, + .token.boolean, + .token.number, + .token.constant, + .token.symbol { + color: #b89859; + } + + .token.tag { + color: #ffb03b; + } + + .token.important, + .token.statement, + .token.deleted { + color: #dc322f; + } + + .token.punctuation { + color: #dccf8f; + } + + .token.entity { + cursor: help; + } + + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/shades-of-purple.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/shades-of-purple.scss new file mode 100644 index 0000000000..1d85654071 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/shades-of-purple.scss @@ -0,0 +1,142 @@ +/** + * Shades of Purple Theme for Prism.js + * + * @author Ahmad Awais + * @support Follow/tweet at https://twitter.com/MrAhmadAwais/ + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-shades-of-purple.css + */ + +$code-text-color: #9efeff; +$code-bg-color: #1e1e3f; + +@mixin style { + div[class*='language-'] pre { + letter-spacing: 0.5px; + text-shadow: 0 1px #222245; + + ::selection { + background: #a599e9; + color: inherit; + } + } + + .token.comment, + .token.prolog, + .token.cdata { + color: #b362ff; + } + + .token.delimiter, + .token.keyword, + .token.selector, + .token.important, + .token.atrule { + color: #ff9d00; + } + + .token.operator, + .token.attr-name { + color: rgb(255 180 84); + } + + .token.punctuation { + color: #fff; + } + + .token.boolean { + color: rgb(255 98 140); + } + + .token.tag, + .token.tag .punctuation, + .token.doctype, + .token.builtin { + color: rgb(255 157 0); + } + + .token.entity, + .token.symbol { + color: #6897bb; + } + + .token.number { + color: #ff628c; + } + + .token.property, + .token.constant, + .token.variable { + color: #ff628c; + } + + .token.string, + .token.char { + color: #a5ff90; + } + + .token.attr-value, + .token.attr-value .punctuation { + color: #a5c261; + } + + .token.attr-value .punctuation:first-child { + color: #a9b7c6; + } + + .token.url { + color: #287bde; + text-decoration: underline; + } + + .token.function { + color: rgb(250 208 0); + } + + .token.regex { + background: #364135; + } + + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .token.inserted { + background: #0f0; + } + + .token.deleted { + background: #ff000d; + } + + .language-css .token.property, + .language-css .token.property + .token.punctuation { + color: #a9b7c6; + } + + .language-css .token.id { + color: #ffc66d; + } + + .language-css .token.selector > .token.class, + .language-css .token.selector > .token.attribute, + .language-css .token.selector > .token.pseudo-class, + .language-css .token.selector > .token.pseudo-element { + color: #ffc66d; + } + + .token.class-name { + color: #fb94ff; + } + + .token.operator, + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string { + background: none; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/solarized-dark-atom.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/solarized-dark-atom.scss new file mode 100644 index 0000000000..bf2104d46b --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/solarized-dark-atom.scss @@ -0,0 +1,117 @@ +/** + * Solarized dark atom theme for `prism.js` + * Based on Atom's `atom-dark` theme: https://github.com/atom/atom-dark-syntax + * @author Pranay Chauhan (@PranayChauhan2516) + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-solarized-dark-atom.css + */ + +$code-text-color: #839496; +$code-bg-color: #002b36; + +@mixin style { + div[class*='language-'] pre { + text-shadow: 0 1px rgb(0 0 0 / 30%); + + /* Print */ + @media print { + text-shadow: none; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #586e75; + } + + .token.punctuation { + color: #93a1a1; + } + + .namespace { + opacity: 0.7; + } + + .token.property, + .token.keyword, + .token.tag { + color: #268bd2; + } + + .token.class-name { + color: #ffffb6; + text-decoration: underline; + } + + .token.boolean, + .token.constant { + color: #b58900; + } + + .token.symbol, + .token.deleted { + color: #dc322f; + } + + .token.number { + color: #859900; + } + + .token.selector, + .token.attr-name, + .token.string, + .token.char, + .token.builtin, + .token.inserted { + color: #859900; + } + + .token.variable { + color: #268bd2; + } + + .token.operator { + color: #ededed; + } + + .token.function { + color: #268bd2; + } + + .token.regex { + color: #e9c062; + } + + .token.important { + color: #fd971f; + } + + .token.entity { + color: #ffffb6; + cursor: help; + } + + .token.url { + color: #96cbfe; + } + + .language-css .token.string, + .style .token.string { + color: #87c38a; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .token.atrule, + .token.attr-value { + color: #f9ee98; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/tomorrow.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/tomorrow.scss new file mode 100644 index 0000000000..39f14910b5 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/tomorrow.scss @@ -0,0 +1,85 @@ +/** + * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML + * Based on https://github.com/chriskempson/tomorrow-theme + * @author Rose Pritchard + */ + +$code-text-color: #ccc; +$code-bg-color: #2d2d2d; + +@mixin style { + .token.comment, + .token.block-comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #999; + } + + .token.punctuation { + color: #ccc; + } + + .token.tag, + .token.attr-name, + .token.namespace, + .token.deleted { + color: #e2777a; + } + + .token.function-name { + color: #6196cc; + } + + .token.boolean, + .token.number, + .token.function { + color: #f08d49; + } + + .token.property, + .token.class-name, + .token.constant, + .token.symbol { + color: #f8c555; + } + + .token.selector, + .token.important, + .token.atrule, + .token.keyword, + .token.builtin { + color: #cc99cd; + } + + .token.string, + .token.char, + .token.attr-value, + .token.regex, + .token.variable { + color: #7ec699; + } + + .token.operator, + .token.entity, + .token.url { + color: #67cdcc; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } + + .token.inserted { + color: #008000; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/vs.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/vs.scss new file mode 100644 index 0000000000..6fdaa41e61 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/vs.scss @@ -0,0 +1,128 @@ +/** + * VS theme by Andrew Lock (https://andrewlock.net) + * Inspired by Visual Studio syntax coloring + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-vs.css + */ + +$code-text-color: #393a34; +$code-bg-color: #fff; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #c1def1; + } + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #008000; + font-style: italic; + } + + .token.namespace { + opacity: 0.7; + } + + .token.string { + color: #a31515; + } + + .token.punctuation, + .token.operator { + color: #393a34; /* no highlight */ + } + + .token.url, + .token.symbol, + .token.number, + .token.boolean, + .token.variable, + .token.constant, + .token.inserted { + color: #36acaa; + } + + .token.atrule, + .token.keyword, + .token.attr-value { + color: #00f; + } + + .token.function { + color: #393a34; + } + + .token.deleted { + color: #9a050f; + } + + .token.selector { + color: #00009f; + } + + .token.important { + color: #e90; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } + + .token.class-name { + color: #2b91af; + } + + .token.tag, + .token.selector { + color: #800000; + } + + .token.attr-name, + .token.property, + .token.regex, + .token.entity { + color: #f00; + } + + .token.directive.tag .tag { + background: #ff0; + color: #393a34; + } + + code[class*='language-css'] { + color: #00f; + } + + .language-autohotkey { + .token.tag { + color: #9a050f; + } + + .token.keyword { + color: #00009f; + } + + .token.selector { + color: #00f; + } + } + + .language-json { + .token.boolean, + .token.number { + color: #00f; + } + + .token.property { + color: #2b91af; + } + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/vsc-dark-plus.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/vsc-dark-plus.scss new file mode 100644 index 0000000000..2bf3e37df6 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/vsc-dark-plus.scss @@ -0,0 +1,219 @@ +/* + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-vsc-dark-plus.css + */ + +$code-text-color: #d4d4d4; +$code-bg-color: #1e1e1e; + +@mixin style { + div[class*='language-'] pre { + ::selection { + background: #264f78; + } + } + + .namespace { + opacity: 0.7; + } + + .token.doctype { + .token.doctype-tag { + color: #569cd6; + } + + .token.name { + color: #9cdcfe; + } + } + + .token.comment, + .token.prolog { + color: #6a9955; + } + + .token.punctuation { + &, + .language-html .language-css &, + .language-html .language-javascript & { + color: #d4d4d4; + } + + &.interpolation-punctuation { + color: #569cd6; + } + } + + .token.number, + .token.symbol, + .token.inserted, + .token.unit { + color: #b5cea8; + } + + .token.string, + .token.char, + .token.builtin, + .token.deleted { + color: #ce9178; + } + + .token.operator { + color: #d4d4d4; + + &.arrow { + color: #569cd6; + } + } + + .token.atrule { + color: #ce9178; + + .token.rule { + color: #c586c0; + } + + .token.url { + color: #9cdcfe; + + .token.function { + color: #dcdcaa; + } + + .token.punctuation { + color: #d4d4d4; + } + } + } + + .token.keyword { + color: #569cd6; + + &.module, + &.control-flow { + color: #c586c0; + } + } + + .token.function, + .token.function .token.maybe-class-name { + color: #dcdcaa; + } + + .token.regex { + color: #d16969; + } + + .token.important { + color: #569cd6; + } + + .token.italic { + font-style: italic; + } + + .token.constant { + color: #9cdcfe; + } + + .token.class-name, + .token.maybe-class-name { + color: #4ec9b0; + } + + .token.console { + color: #9cdcfe; + } + + .token.parameter { + color: #9cdcfe; + } + + .token.interpolation { + color: #9cdcfe; + } + + .token.boolean { + color: #569cd6; + } + + .token.property, + .token.variable, + .token.imports .token.maybe-class-name, + .token.exports .token.maybe-class-name { + color: #9cdcfe; + } + + .token.selector { + color: #d7ba7d; + } + + .token.escape { + color: #d7ba7d; + } + + .token.tag { + color: #569cd6; + + .token.punctuation { + color: #808080; + } + } + + .token.cdata { + color: #808080; + } + + .token.attr-name { + color: #9cdcfe; + } + + .token.attr-value, + .token.attr-value .token.punctuation { + color: #ce9178; + } + + .token.attr-value .token.punctuation.attr-equals { + color: #d4d4d4; + } + + .token.entity { + color: #569cd6; + } + + .token.namespace { + color: #4ec9b0; + } + + pre[class*='language-javascript'], + code[class*='language-javascript'], + pre[class*='language-jsx'], + code[class*='language-jsx'], + pre[class*='language-typescript'], + code[class*='language-typescript'], + pre[class*='language-tsx'], + code[class*='language-tsx'] { + color: #9cdcfe; + } + + pre[class*='language-css'], + code[class*='language-css'] { + color: #ce9178; + } + + pre[class*='language-html'], + code[class*='language-html'] { + color: #d4d4d4; + } + + .language-regex .token.anchor { + color: #dcdcaa; + } + + .language-html .token.punctuation { + color: #808080; + } + + .language-css .token.string.url { + text-decoration: underline; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/xonokai.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/xonokai.scss new file mode 100644 index 0000000000..591505a922 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/xonokai.scss @@ -0,0 +1,117 @@ +/** + * xonokai theme for JavaScript, CSS and HTML + * based on: https://github.com/MoOx/sass-prism-theme-base by Maxime Thirouin ~ MoOx --> http://moox.fr/ , which is Loosely based on Monokai textmate theme by http://www.monokai.nl/ + * license: MIT; http://moox.mit-license.org/ + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-duotone-forest.css + */ + +$code-text-color: #76d9e6; +$code-bg-color: #2a2a2a; + +@mixin style { + div[class*='language-'] pre { + box-shadow: 1px 1px 0.3em -0.1em #000 inset; + + // tab size + tab-size: 2; + + ::selection { + background: #435643; + } + } + + .token.namespace { + opacity: 0.7; + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #6f705e; + } + + .token.operator, + .token.boolean, + .token.number { + color: #a77afe; + } + + .token.attr-name, + .token.string { + color: #e6d06c; + } + + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string { + color: #e6d06c; + } + + .token.selector, + .token.inserted { + color: #a6e22d; + } + + .token.atrule, + .token.attr-value, + .token.keyword, + .token.important, + .token.deleted { + color: #ef3b7d; + } + + .token.regex, + .token.statement { + color: #76d9e6; + } + + .token.placeholder, + .token.variable { + color: #fff; + } + + .token.important, + .token.statement, + .token.bold { + font-weight: bold; + } + + .token.punctuation { + color: #bebec5; + } + + .token.entity { + cursor: help; + } + + .token.italic { + font-style: italic; + } + + .language-markup { + color: #f9f9f9; + } + + .language-markup .token.tag { + color: #ef3b7d; + } + + .language-markup .token.attr-name { + color: #a6e22d; + } + + .language-markup .token.attr-value { + color: #e6d06c; + } + + .language-markup .token.style, + .language-markup .token.script { + color: #76d9e6; + } + + .language-markup .token.script .token.keyword { + color: #76d9e6; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/client/styles/themes/z-touch.scss b/plugins/markdown/plugin-prismjs/src/client/styles/themes/z-touch.scss new file mode 100644 index 0000000000..eeed66585a --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/client/styles/themes/z-touch.scss @@ -0,0 +1,112 @@ +/* + * Z-Touch + * by Zeel Codder + * https://github.com/zeel-codder + * Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-solarized-dark-atom.css + */ + +$code-text-color: #fff; +$code-bg-color: #0a143c; + +@mixin style { + div[class*='language-'] pre { + text-shadow: 0 1px rgb(0 0 0 / 30%); + + /* Print */ + @media print { + text-shadow: none; + } + + ::selection { + background: rgb(29 59 83 / 99%); + text-shadow: none; + } + } + + .token.comment, + .token.prolog, + .token.cdata { + color: #637777; + font-style: italic; + } + + .token.punctuation { + color: #c792ea; + } + + .namespace { + color: #b2ccd6; + } + + .token.deleted { + color: rgb(239 83 80 / 56%); + font-style: italic; + } + + .token.symbol, + .token.property { + color: #80cbc4; + } + + .token.tag, + .token.operator, + .token.keyword { + color: #7fdbca; + } + + .token.boolean { + color: #ff5874; + } + + .token.number { + color: #f78c6c; + } + + .token.constant, + .token.function, + .token.builtin, + .token.char { + color: #22b7c7; + } + + .token.selector, + .token.doctype { + color: #c792ea; + font-style: italic; + } + + .token.attr-name, + .token.inserted { + color: #addb67; + font-style: italic; + } + + .token.string, + .token.url, + .token.entity, + .language-css .token.string, + .style .token.string { + color: #addb67; + } + + .token.class-name, + .token.atrule, + .token.attr-value { + color: #ffcb8b; + } + + .token.regex, + .token.important, + .token.variable { + color: #d6deeb; + } + + .token.important, + .token.bold { + font-weight: bold; + } + + .token.italic { + font-style: italic; + } +} diff --git a/plugins/markdown/plugin-prismjs/src/node/getTheme.ts b/plugins/markdown/plugin-prismjs/src/node/getTheme.ts new file mode 100644 index 0000000000..463815a4ab --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/node/getTheme.ts @@ -0,0 +1,58 @@ +import type { PrismjsPluginOptions, PrismjsTheme } from './options.js' + +const PRISMJS_THEMES: PrismjsTheme[] = [ + 'ateliersulphurpool-light', + 'coldark-cold', + 'coy', + 'duotone-light', + 'ghcolors', + 'gruvbox-light', + 'material-light', + 'one-light', + 'vs', + 'atom-dark', + 'cb', + 'coldark-dark', + 'dark', + 'dracula', + 'duotone-dark', + 'duotone-earth', + 'duotone-forest', + 'duotone-sea', + 'duotone-space', + 'gruvbox-dark', + 'holi', + 'hopscotch', + 'lucario', + 'material-dark', + 'material-oceanic', + 'night-owl', + 'nord', + 'one-dark', + 'pojoaque', + 'shades-of-purple', + 'solarized-dark-atom', + 'tomorrow', + 'vsc-dark-plus', + 'xonokai', + 'z-touch', +] + +const isValidTheme = (theme?: string): theme is PrismjsTheme => + // @ts-expect-error: Actual assertion here + PRISMJS_THEMES.includes(theme) + +export const getTheme = ( + options: PrismjsPluginOptions, +): { light: PrismjsTheme; dark: PrismjsTheme } => ({ + light: isValidTheme(options.themes?.light) + ? options.themes?.light + : isValidTheme(options.theme) + ? options.theme + : 'nord', + dark: isValidTheme(options.themes?.dark) + ? options.themes?.dark + : isValidTheme(options.theme) + ? options.theme + : 'nord', +}) diff --git a/plugins/markdown/plugin-prismjs/src/node/index.ts b/plugins/markdown/plugin-prismjs/src/node/index.ts index be9b98d491..8145d1f16e 100644 --- a/plugins/markdown/plugin-prismjs/src/node/index.ts +++ b/plugins/markdown/plugin-prismjs/src/node/index.ts @@ -1,6 +1,7 @@ import { prismjsPlugin } from './prismjsPlugin.js' export * from './loadLanguages.js' +export * from './options.js' export * from './prismjsPlugin.js' export * from './resolveHighlighter.js' export * from './markdown/index.js' diff --git a/plugins/markdown/plugin-prismjs/src/node/markdown/highlightPlugin.ts b/plugins/markdown/plugin-prismjs/src/node/markdown/highlightPlugin.ts index 722f12533f..6fadb8fc53 100644 --- a/plugins/markdown/plugin-prismjs/src/node/markdown/highlightPlugin.ts +++ b/plugins/markdown/plugin-prismjs/src/node/markdown/highlightPlugin.ts @@ -3,10 +3,13 @@ import { getCodeParser, getHighlightLinesRange, highlightCodeLines, + metaWhitespace, + metaWordHighlight, notationDiff, notationErrorLevel, notationFocus, notationHighlight, + notationWordHighlight, } from '../parser/index.js' import type { HighlightOptions } from '../types.js' import { resolveLanguage } from '../utils/index.js' @@ -19,6 +22,8 @@ export const highlightPlugin = ( notationErrorLevel: enabledErrorLevel, notationFocus: enabledFocus, notationHighlight: enabledHighlight, + notationWordHighlight: enabledWordHighlight, + whitespace: whitespacePosition = false, }: HighlightOptions = {}, ): void => { const rawFence = md.renderer.rules.fence! @@ -55,6 +60,13 @@ export const highlightPlugin = ( notationHighlight(parser) } + if (enabledWordHighlight) { + notationWordHighlight(parser) + metaWordHighlight(parser, info) + } + + metaWhitespace(parser, info, whitespacePosition) + parser.pre.classList.push(languageClass) return parser.stringify() diff --git a/plugins/markdown/plugin-prismjs/src/node/markdown/preWrapperPlugin.ts b/plugins/markdown/plugin-prismjs/src/node/markdown/preWrapperPlugin.ts index 66491feffd..e658797fde 100644 --- a/plugins/markdown/plugin-prismjs/src/node/markdown/preWrapperPlugin.ts +++ b/plugins/markdown/plugin-prismjs/src/node/markdown/preWrapperPlugin.ts @@ -30,6 +30,6 @@ export const preWrapperPlugin = ( /** * Add information to dataset for current code block. */ - return `
${result}
` + return `
${result.replace(` class="${languageClass}"`, '')}
` } } diff --git a/plugins/markdown/plugin-prismjs/src/node/options.ts b/plugins/markdown/plugin-prismjs/src/node/options.ts new file mode 100644 index 0000000000..cf1f5d05b9 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/node/options.ts @@ -0,0 +1,76 @@ +import type { MarkdownItLineNumbersOptions } from '@vuepress/highlighter-helper' +import type { HighlightOptions, PreWrapperOptions } from './types.js' + +export type PrismjsLightTheme = + | 'ateliersulphurpool-light' + | 'coldark-cold' + | 'coy' + | 'duotone-light' + | 'ghcolors' + | 'gruvbox-light' + | 'material-light' + | 'one-light' + | 'vs' + +export type PrismjsDarkTheme = + | 'atom-dark' + | 'cb' + | 'coldark-dark' + | 'dark' + | 'dracula' + | 'duotone-dark' + | 'duotone-earth' + | 'duotone-forest' + | 'duotone-sea' + | 'duotone-space' + | 'gruvbox-dark' + | 'holi' + | 'hopscotch' + | 'lucario' + | 'material-dark' + | 'material-oceanic' + | 'night-owl' + | 'nord' + | 'one-dark' + | 'pojoaque' + | 'shades-of-purple' + | 'solarized-dark-atom' + | 'tomorrow' + | 'vsc-dark-plus' + | 'xonokai' + | 'z-touch' + +export type PrismjsTheme = PrismjsDarkTheme | PrismjsLightTheme + +/** + * Options of @vuepress/plugin-prismjs + */ +export interface PrismjsPluginOptions + extends Pick, + PreWrapperOptions, + HighlightOptions { + /** + * Single theme + * + * @default 'nord' + */ + theme?: PrismjsTheme + + /** + * Dual themes + */ + themes?: { + light: PrismjsTheme + dark: PrismjsTheme + } + + /** + * Languages to preload + * + * Workaround for prismjs language reloading issue + * + * @default ['markdown', 'jsdoc', 'yaml'] + * @see https://github.com/PrismJS/prism/issues/2716 + */ + preloadLanguages?: string[] +} diff --git a/plugins/markdown/plugin-prismjs/src/node/parser/createNotationRule.ts b/plugins/markdown/plugin-prismjs/src/node/parser/createNotationRule.ts new file mode 100644 index 0000000000..e0d6f26c17 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/node/parser/createNotationRule.ts @@ -0,0 +1,31 @@ +import type { CodeParser, OpenTag } from './getCodeParser.js' + +// prismjs comments +const COMMENT_EMPTY_TAG = /\s*?<\/span>/ + +export const createNotationRule = ( + parser: CodeParser, + pattern: RegExp, + onMatch: (match: string[], index: number) => boolean, +): void => { + const nodeRemove: OpenTag[] = [] + + parser.lines.forEach((node, index) => { + let replaced = false + node.content = node.content.replace(pattern, (...match) => { + if (onMatch(match, index)) { + replaced = true + return '' + } + return match[0] + }) + if ( + replaced && + !(node.content = node.content.replace(COMMENT_EMPTY_TAG, '')).trim() + ) { + nodeRemove.push(node) + } + }) + for (const node of nodeRemove) + parser.lines.splice(parser.lines.indexOf(node), 1) +} diff --git a/plugins/markdown/plugin-prismjs/src/node/parser/highlightWord.ts b/plugins/markdown/plugin-prismjs/src/node/parser/highlightWord.ts new file mode 100644 index 0000000000..a4d9564b48 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/node/parser/highlightWord.ts @@ -0,0 +1,49 @@ +import type { CodeParser, OpenTag } from './getCodeParser.js' + +const SPLIT_REGEXP = /(<[^>]+>)/ +const META_WORD_REGEXP = /\/((?:\\.|[^/])+)\//g + +const WORD_BEFORE = '' +const WORD_AFTER = '' + +export const highlightWordInLine = ( + node: OpenTag, + pattern: string | RegExp, +): void => { + node.content = node.content + .split(SPLIT_REGEXP) + .map((text) => { + if (!text || text[0] === '<') { + return text + } + return text.replaceAll( + pattern, + (word) => `${WORD_BEFORE}${word}${WORD_AFTER}`, + ) + }) + .join('') +} + +export const parseMetaHighlightWords = (meta: string): string[] => { + if (!meta) return [] + + const match = Array.from(meta.matchAll(META_WORD_REGEXP)) + + return ( + match + // Escape backslashes + .map((v) => v[1].replace(/\\(.)/g, '$1')) + ) +} + +/** + * ```js /Hello|Hi/ + */ +export const metaWordHighlight = (parser: CodeParser, meta: string): void => { + const words = parseMetaHighlightWords(meta) + + if (words.length) { + const pattern = new RegExp(`${words.join('|')}`, 'g') + parser.line((line) => highlightWordInLine(line, pattern)) + } +} diff --git a/plugins/markdown/plugin-prismjs/src/node/parser/index.ts b/plugins/markdown/plugin-prismjs/src/node/parser/index.ts index 810cedafe6..1bd6c1a285 100644 --- a/plugins/markdown/plugin-prismjs/src/node/parser/index.ts +++ b/plugins/markdown/plugin-prismjs/src/node/parser/index.ts @@ -1,3 +1,6 @@ export * from './getCodeParser.js' +export * from './createNotationRule.js' export * from './notation.js' export * from './highlightLines.js' +export * from './highlightWord.js' +export * from './whitespace.js' diff --git a/plugins/markdown/plugin-prismjs/src/node/parser/notation.ts b/plugins/markdown/plugin-prismjs/src/node/parser/notation.ts index e41216ca67..01199335d5 100644 --- a/plugins/markdown/plugin-prismjs/src/node/parser/notation.ts +++ b/plugins/markdown/plugin-prismjs/src/node/parser/notation.ts @@ -8,6 +8,7 @@ * - line focus: `// [!code focus]` * - line warning: `// [!code warning]` * - line error: `// [!code error]` + * - highlight word: `// [!code word:xxx]` `xxx` can be any word * * You can also add `:\d` to achieve the same effect for the following `number` lines: * @@ -16,64 +17,42 @@ * - ...more */ import { escapeRegExp } from '../utils/index.js' -import type { CodeParser, OpenTag } from './getCodeParser.js' - -const COMMENT_EMPTY_TAG = /\s*?<\/span>/ +import { createNotationRule } from './createNotationRule.js' +import type { CodeParser } from './getCodeParser.js' +import { highlightWordInLine } from './highlightWord.js' const toArray = (value: T | T[]): T[] => Array.isArray(value) ? value : [value] -export interface NotationOption { +export interface NotationCommentMarkerOption { classMap: Record classPre?: string } -export const createNotationRule = ( +const createNotationCommentMarkerRule = ( parser: CodeParser, - options: NotationOption, + { classMap, classPre }: NotationCommentMarkerOption, ): void => { - const { classMap, classPre } = options - - const pattern = new RegExp( - `\\s*(?://|/\\*|)?`, - ) - - const nodeRemove: OpenTag[] = [] - - const onMatch = ( - [, match, range = ':1']: string[], - index: number, - ): boolean => { - const lineNum = Number.parseInt(range.slice(1), 10) - - parser.lines.slice(index, index + lineNum).forEach((node) => { - node.classList.push(...toArray(classMap[match])) - }) - if (classPre) { - parser.pre.classList.push(classPre) - } + const marker = Object.keys(classMap).map(escapeRegExp).join('|') + createNotationRule( + parser, + new RegExp( + // comment-begin | marker | range | comment-end + `\\s*(?://|/\\*|)?`, + ), + ([, match, range = ':1'], index): boolean => { + const lineNum = Number.parseInt(range.slice(1), 10) - return true - } - - parser.lines.forEach((node, index) => { - let replaced = false - node.content = node.content.replace(pattern, (...match) => { - if (onMatch(match, index)) { - replaced = true - return '' + parser.lines.slice(index, index + lineNum).forEach((node) => { + node.classList.push(...toArray(classMap[match])) + }) + if (classPre) { + parser.pre.classList.push(classPre) } - return match[0] - }) - if ( - replaced && - !(node.content = node.content.replace(COMMENT_EMPTY_TAG, '')).trim() - ) { - nodeRemove.push(node) - } - }) - for (const node of nodeRemove) - parser.lines.splice(parser.lines.indexOf(node), 1) + + return true + }, + ) } /** @@ -82,7 +61,7 @@ export const createNotationRule = ( * `// [!code highlight]`, or `// [!code hl]` */ export const notationHighlight = (parser: CodeParser): void => { - createNotationRule(parser, { + createNotationCommentMarkerRule(parser, { classMap: { highlight: 'highlighted', hl: 'highlighted', @@ -97,7 +76,7 @@ export const notationHighlight = (parser: CodeParser): void => { * `// [!code focus]` */ export const notationFocus = (parser: CodeParser): void => { - createNotationRule(parser, { + createNotationCommentMarkerRule(parser, { classMap: { focus: 'has-focus', }, @@ -111,7 +90,7 @@ export const notationFocus = (parser: CodeParser): void => { * `// [!code ++]` and `// [!code --]` */ export const notationDiff = (parser: CodeParser): void => { - createNotationRule(parser, { + createNotationCommentMarkerRule(parser, { classMap: { '++': 'diff add', '--': 'diff remove', @@ -126,7 +105,7 @@ export const notationDiff = (parser: CodeParser): void => { * `// [!code warning]` and `// [!code error]` */ export const notationErrorLevel = (parser: CodeParser): void => { - createNotationRule(parser, { + createNotationCommentMarkerRule(parser, { classMap: { error: ['highlighted', 'error'], warning: ['highlighted', 'warning'], @@ -134,3 +113,32 @@ export const notationErrorLevel = (parser: CodeParser): void => { classPre: 'has-highlighted', }) } + +/** + * highlight word + * + * `// [!code word:xxx]`: `xxx` can be any word. + * @param parser + */ +export const notationWordHighlight = (parser: CodeParser): void => { + createNotationRule( + parser, + // comment-begin | marker |word | range | comment-end + /\s*(?:\/\/|\/\*|)?/, + ([, word, range], index): boolean => { + const lineNum = range + ? Number.parseInt(range.slice(1), 10) + : parser.lines.length - 1 + + // escape backslashes + word = word.replace(/\\(.)/g, '$1') + + parser.lines + // start from the next line after the comment + .slice(index + 1, index + 1 + lineNum) + .forEach((line) => highlightWordInLine(line, word)) + + return true + }, + ) +} diff --git a/plugins/markdown/plugin-prismjs/src/node/parser/whitespace.ts b/plugins/markdown/plugin-prismjs/src/node/parser/whitespace.ts new file mode 100644 index 0000000000..daa94f33e6 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/node/parser/whitespace.ts @@ -0,0 +1,99 @@ +import { resolveWhitespacePosition } from '@vuepress/highlighter-helper' +import type { WhitespacePosition } from '@vuepress/highlighter-helper' +import type { CodeParser, OpenTag } from './getCodeParser.js' + +const SPLIT_REGEXP = /(<[^>]+>)/ +const SPACE_REGEXP = /[\s\t]/g + +const classMap = { + ' ': 'space', + '\t': 'tab', +} + +const isSpace = (char: string): boolean => char === ' ' || char === '\t' + +const renderSpace = (text: string): string => + text.replaceAll( + SPACE_REGEXP, + (space) => `${space}`, + ) + +export const renderWhitespaceInLine = ( + node: OpenTag, + position: WhitespacePosition, +): void => { + let snippets = node.content.split(SPLIT_REGEXP) + + // match all whitespace + if (position === 'all') { + snippets = snippets.map((text) => + !text || text[0] === '<' ? text : renderSpace(text), + ) + } + // match whitespace at the beginning of the line + if (position === 'boundary') { + let has = true + for (let i = 0; i < snippets.length; i++) { + const snippet = snippets[i] + if (snippet && snippet[0] !== '<') { + let j = 0 + while (snippet[j] && j < snippet.length) { + if (!isSpace(snippet[j])) { + has = false + break + } + j++ + } + snippets[i] = renderSpace(snippet.slice(0, j)) + snippet.slice(j) + } + if (!has) { + break + } + } + } + + // match whitespace at the end of the line + if (position === 'boundary' || position === 'trailing') { + let has = true + for (let i = snippets.length - 1; i >= 0; i--) { + const snippet = snippets[i] + let j = snippet.length - 1 + if (snippet && snippet[j] !== '>') { + while (snippet[j] && j >= 0) { + if (!isSpace(snippet[j])) { + has = false + break + } + j-- + } + snippets[i] = + j === snippet.length - 1 + ? snippet + : j > 0 + ? snippet.slice(0, j) + renderSpace(snippet.slice(j)) + : renderSpace(snippet) + } + if (!has) { + break + } + } + } + + node.content = snippets.join('') +} + +/** + * type: 'all' | 'boundary' | 'trailing' + * + * ```js :whitespace[=type] + */ +export const metaWhitespace = ( + parser: CodeParser, + meta: string, + defaultPosition?: boolean | WhitespacePosition, +): void => { + const position = resolveWhitespacePosition(meta, defaultPosition) + if (position === false) return + + parser.line((line) => renderWhitespaceInLine(line, position)) +} diff --git a/plugins/markdown/plugin-prismjs/src/node/prepareConfigFile.ts b/plugins/markdown/plugin-prismjs/src/node/prepareConfigFile.ts new file mode 100644 index 0000000000..c12b03eaf1 --- /dev/null +++ b/plugins/markdown/plugin-prismjs/src/node/prepareConfigFile.ts @@ -0,0 +1,66 @@ +import { getRealPath } from '@vuepress/helper' +import type { App } from 'vuepress' +import { getTheme } from './getTheme.js' +import type { PrismjsPluginOptions } from './options.js' + +const { url } = import.meta + +export const prepareConfigFile = ( + app: App, + options: PrismjsPluginOptions, +): Promise => { + const { light, dark } = getTheme(options) + + const imports: string[] = [ + `import "${getRealPath('@vuepress/highlighter-helper/styles/base.css', url)}"`, + ] + + if (light === dark) { + imports.push( + `import "${getRealPath(`@vuepress/plugin-prismjs/styles/${light}.css`, url)}"`, + ) + } else { + imports.push( + `import "${getRealPath(`@vuepress/plugin-prismjs/styles/${light}.light.css`, url)}"`, + `import "${getRealPath(`@vuepress/plugin-prismjs/styles/${dark}.dark.css`, url)}"`, + ) + } + + if (options.notationDiff) { + imports.push( + `import "${getRealPath('@vuepress/highlighter-helper/styles/notation-diff.css', url)}"`, + ) + } + + if (options.notationErrorLevel) { + imports.push( + `import "${getRealPath('@vuepress/highlighter-helper/styles/notation-error-level.css', url)}"`, + ) + } + + if (options.notationFocus) { + imports.push( + `import "${getRealPath('@vuepress/highlighter-helper/styles/notation-focus.css', url)}"`, + ) + } + + if (options.notationHighlight) { + imports.push( + `import "${getRealPath('@vuepress/highlighter-helper/styles/notation-highlight.css', url)}"`, + ) + } + + if (options.notationWordHighlight) { + imports.push( + `import "${getRealPath('@vuepress/highlighter-helper/styles/notation-word-highlight.css', url)}"`, + ) + } + + if (options.whitespace) { + imports.push( + `import "${getRealPath('@vuepress/highlighter-helper/styles/whitespace.css', url)}"`, + ) + } + + return app.writeTemp('prismjs/config.js', imports.join('\n')) +} diff --git a/plugins/markdown/plugin-prismjs/src/node/prismjsPlugin.ts b/plugins/markdown/plugin-prismjs/src/node/prismjsPlugin.ts index 600fead7db..8e84b9da80 100644 --- a/plugins/markdown/plugin-prismjs/src/node/prismjsPlugin.ts +++ b/plugins/markdown/plugin-prismjs/src/node/prismjsPlugin.ts @@ -1,29 +1,12 @@ import { lineNumbers as lineNumbersPlugin } from '@vuepress/highlighter-helper' -import type { MarkdownItLineNumbersOptions } from '@vuepress/highlighter-helper' import type { Plugin } from 'vuepress/core' import { loadLanguages } from './loadLanguages.js' import { highlightPlugin, preWrapperPlugin } from './markdown/index.js' +import type { PrismjsPluginOptions } from './options.js' +import { prepareConfigFile } from './prepareConfigFile.js' import { resolveHighlighter } from './resolveHighlighter.js' import type { HighlightOptions, PreWrapperOptions } from './types.js' -/** - * Options of @vuepress/plugin-prismjs - */ -export interface PrismjsPluginOptions - extends Pick, - PreWrapperOptions, - HighlightOptions { - /** - * Languages to preload - * - * Workaround for prismjs language reloading issue - * - * @default ['markdown', 'jsdoc', 'yaml'] - * @see https://github.com/PrismJS/prism/issues/2716 - */ - preloadLanguages?: string[] -} - export const prismjsPlugin = ({ preloadLanguages = ['markdown', 'jsdoc', 'yaml'], preWrapper = true, @@ -48,4 +31,6 @@ export const prismjsPlugin = ({ md.use(lineNumbersPlugin, { lineNumbers, removeLastLine: true }) } }, + + clientConfigFile: (app) => prepareConfigFile(app, options), }) diff --git a/plugins/markdown/plugin-prismjs/src/node/types.ts b/plugins/markdown/plugin-prismjs/src/node/types.ts index 2d4b3766d9..08df44929d 100644 --- a/plugins/markdown/plugin-prismjs/src/node/types.ts +++ b/plugins/markdown/plugin-prismjs/src/node/types.ts @@ -1,3 +1,5 @@ +import type { WhitespacePosition } from '@vuepress/highlighter-helper' + export interface PreWrapperOptions { /** * Wrap the `
` tag with an extra `
` or not. Do not disable it unless you @@ -64,4 +66,31 @@ export interface HighlightOptions { * @see https://shiki.style/packages/transformers#transformernotationerrorlevel */ notationErrorLevel?: boolean + + /** + * Enable notation word highlight + * + * @default false + * + * @see https://shiki.style/packages/transformers#transformernotationwordhighlight + */ + notationWordHighlight?: boolean + + /** + * Enable render whitespace + * - true: enable render whitespace, same of `all` + * - false: disable render whitespace + * - 'all': render all whitespace + * - 'boundary': render leading and trailing whitespace of each line. + * - 'trailing': render trailing whitespace of each line + * + * you are able to use `:whitespace` or `:no-whitespace` or `:whitespace=position` to set single code block + * + * position: 'all' | 'boundary' | 'trailing' + * + * @default false + * + * @see https://shiki.style/packages/transformers#transformerrenderwhitespace + */ + whitespace?: boolean | WhitespacePosition } diff --git a/plugins/markdown/plugin-prismjs/tests/__snapshots__/getCodeParser.spec.ts.snap b/plugins/markdown/plugin-prismjs/tests/__snapshots__/getCodeParser.spec.ts.snap index 7bc2b805d4..56512f8624 100644 --- a/plugins/markdown/plugin-prismjs/tests/__snapshots__/getCodeParser.spec.ts.snap +++ b/plugins/markdown/plugin-prismjs/tests/__snapshots__/getCodeParser.spec.ts.snap @@ -25,6 +25,11 @@ exports[`@vuepress/plugin-prismjs > parser > parse highlight lines 1`] = `
" `; +exports[`@vuepress/plugin-prismjs > parser > parse multiple words highlight within meta 1`] = ` +"
const message = 'Hello Foo'
+console.log(message) // prints Hello Bar
" +`; + exports[`@vuepress/plugin-prismjs > parser > parse notation diff ++:number 1`] = ` "
const a = 1
 const b = 2
@@ -121,9 +126,142 @@ exports[`@vuepress/plugin-prismjs > parser > parse notation highlight:number 1`]
 
" `; +exports[`@vuepress/plugin-prismjs > parser > parse notation word highlight :number 1`] = ` +"
const message = 'Hello World'
+console.log(message) // prints Hello World
+console.log(message) // prints Hello World
" +`; + +exports[`@vuepress/plugin-prismjs > parser > parse notation word highlight 1`] = ` +"
const message = 'Hello World'
+console.log(message) // prints Hello World
" +`; + +exports[`@vuepress/plugin-prismjs > parser > parse word highlight within meta 1`] = ` +"
const message = 'Hello World'
+console.log(message) // prints Hello World
" +`; + exports[`@vuepress/plugin-prismjs > parser > should not remove // [\\!code xxx] 1`] = `"
const a = 1 // [!code focus]
"`; exports[`@vuepress/plugin-prismjs > parser > should remove single line // [!code xxx] 1`] = ` "
const a = 1
 const b = 2
" `; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with \`all\` / \`true\` options > \`all\` and \`:whitespace\` 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with \`all\` / \`true\` options > \`true\` and \`:whitespace=boundary\` 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with \`all\` / \`true\` options > \`true\` and \`:whitespace\` 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with \`all\` / \`true\` options > \`true\` and \`:whitespace=trailing\` 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with \`boundary\` options > \`boundary\` and \`:whitespace=all 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with \`boundary\` options > \`boundary\` and \`:whitespace=trailing\` 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with \`boundary\` options > \`boundary\` and \`:whitespace\` 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with \`false\` > disabled global 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with \`false\` > disabled global and :whitespace 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with default options > :whitespace / :whitespace=all 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with default options > :whitespace=boundary 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with default options > :whitespace=trailing 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; + +exports[`@vuepress/plugin-prismjs > parser > should work \`metaWhitespace\` with default options > no render whitespace without meta 1`] = ` +"
function foo(bar: string, baz: string) {
+  console.log('hello world')  
+  console.log('hello world')
+		console.log('hello world')
+console.log('hello world)	
+}
" +`; diff --git a/plugins/markdown/plugin-prismjs/tests/__snapshots__/prismjs-preWrapper.spec.ts.snap b/plugins/markdown/plugin-prismjs/tests/__snapshots__/prismjs-preWrapper.spec.ts.snap index fc526d3678..dfe5bd8817 100644 --- a/plugins/markdown/plugin-prismjs/tests/__snapshots__/prismjs-preWrapper.spec.ts.snap +++ b/plugins/markdown/plugin-prismjs/tests/__snapshots__/prismjs-preWrapper.spec.ts.snap @@ -1,43 +1,43 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > :line-numbers / :no-line-numbers > should work properly if \`lineNumbers\` is disabled by default 1`] = ` -"
Raw text
+"
Raw text
 
-
Raw text
+
Raw text
 
-
Raw text
+
Raw text
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
@@ -47,43 +47,43 @@ exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > :line-numbers /
 `;
 
 exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > :line-numbers / :no-line-numbers > should work properly if \`lineNumbers\` is enabled by default 1`] = `
-"
Raw text
+"
Raw text
 
-
Raw text
+
Raw text
 
-
Raw text
+
Raw text
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
@@ -93,43 +93,43 @@ exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > :line-numbers /
 `;
 
 exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > :line-numbers / :no-line-numbers > should work properly if \`lineNumbers\` is set to a number by default 1`] = `
-"
Raw text
+"
Raw text
 
-
Raw text
+
Raw text
 
-
Raw text
+
Raw text
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
@@ -139,42 +139,42 @@ exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > :line-numbers /
 `;
 
 exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > :line-numbers=number > should work properly if \`lineNumbers\` is disabled by default 1`] = `
-"
const line2 = 'line 2'
+"
const line2 = 'line 2'
 const line3 = 'line 3'
 
-
const line3 = 'line 3'
+
const line3 = 'line 3'
 const line4 = 'line 4'
 const line5 = 'line 5'
 
-
const line10 = 'line 10'
+
const line10 = 'line 10'
 const line11 = 'line 11'
 
" `; exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > :line-numbers=number > should work properly if \`lineNumbers\` is enabled by default 1`] = ` -"
const line2 = 'line 2'
+"
const line2 = 'line 2'
 const line3 = 'line 3'
 
-
const line3 = 'line 3'
+
const line3 = 'line 3'
 const line4 = 'line 4'
 const line5 = 'line 5'
 
-
const line10 = 'line 10'
+
const line10 = 'line 10'
 const line11 = 'line 11'
 
" `; exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > :line-numbers=number > should work properly if \`lineNumbers\` is set to a number by default 1`] = ` -"
const line2 = 'line 2'
+"
const line2 = 'line 2'
 const line3 = 'line 3'
 
-
const line3 = 'line 3'
+
const line3 = 'line 3'
 const line4 = 'line 4'
 const line5 = 'line 5'
 
-
const line10 = 'line 10'
+
const line10 = 'line 10'
 const line11 = 'line 11'
 
" @@ -187,26 +187,27 @@ exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > highlight notati const qux = 'qux' const quux = 'quux' const corge = 'corge' +const grault = 'foo'
-
" +
" `; exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > plugin options > should disable \`highlightLines\` 1`] = ` -"
Raw text
+"
Raw text
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
@@ -221,21 +222,21 @@ exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > plugin options >
 `;
 
 exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > plugin options > should disable \`lineNumbers\` 1`] = `
-"
Raw text
+"
Raw text
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
@@ -279,21 +280,21 @@ exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > plugin options >
 `;
 
 exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > plugin options > should enable \`lineNumbers\` according to number of code lines 1`] = `
-"
Raw text
+"
Raw text
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
@@ -308,21 +309,21 @@ exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > plugin options >
 `;
 
 exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > plugin options > should process code fences with default options 1`] = `
-"
Raw text
+"
Raw text
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
 }
 
-
const foo = 'foo'
+
const foo = 'foo'
 
 function bar () {
   return 1024
@@ -336,22 +337,177 @@ exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > plugin options >
 "
 `;
 
+exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > render whitespace > should work whitespace with \`all\` option 1`] = `
+"
function foo () {  return 'foo'  
+}
+
+
function foo () {
+	const foo = 'foo'
+	if (foo === 'foo') {
+		return 'bar'
+	}
+	return 'foo'
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'  
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'  
+}
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'
+}
+
+
" +`; + +exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > render whitespace > should work whitespace with \`boundary\` option 1`] = ` +"
function foo () {  return 'foo'  
+}
+
+
function foo () {
+	const foo = 'foo'
+	if (foo === 'foo') {
+		return 'bar'
+	}
+	return 'foo'
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'  
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'  
+}
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'
+}
+
+
" +`; + +exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > render whitespace > should work whitespace with \`false\` option 1`] = ` +"
function foo () {  return 'foo'  
+}
+
+
function foo () {
+	const foo = 'foo'
+	if (foo === 'foo') {
+		return 'bar'
+	}
+	return 'foo'
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'  
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'  
+}
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'
+}
+
+
" +`; + +exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > render whitespace > should work whitespace with \`trailing\` option 1`] = ` +"
function foo () {  return 'foo'  
+}
+
+
function foo () {
+	const foo = 'foo'
+	if (foo === 'foo') {
+		return 'bar'
+	}
+	return 'foo'
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'  
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'  
+}
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'
+}
+
+
" +`; + +exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > render whitespace > should work whitespace with default options 1`] = ` +"
function foo () {  return 'foo'  
+}
+
+
function foo () {
+	const foo = 'foo'
+	if (foo === 'foo') {
+		return 'bar'
+	}
+	return 'foo'
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'  
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'  
+}
+}
+
+
function foo () {
+  const foo = 'foo'  
+  return 'foo'
+}
+
+
" +`; + exports[`@vuepress/plugin-prismjs > markdown fence preWrapper > syntax highlighting > should work if highlighted code is not wrapped with \`
\` 1`] = `
-"
highlighted code: Raw text
+"
highlighted code: Raw text
 , lang: 
-
highlighted code: const foo = 'foo'
+
highlighted code: const foo = 'foo'
 
 function bar () {
   return 1024
 }
 , lang: js
-
highlighted code: const foo: string = 'foo'
+
highlighted code: const foo: string = 'foo'
 
 function bar (): number {
   return 1024
 }
 , lang: ts
-
highlighted code: