diff --git a/docs/.vitepress/components/EntrypointPatterns.vue b/docs/.vitepress/components/EntrypointPatterns.vue new file mode 100644 index 00000000..0600a066 --- /dev/null +++ b/docs/.vitepress/components/EntrypointPatterns.vue @@ -0,0 +1,40 @@ + + + + + + + Input Pattern + + Output Path + + + + + + entrypoints/{{ pattern[0] }} + + + + + + + + /{{ pattern[1] }} + + + + + diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 9c81e018..f6920b64 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -61,6 +61,7 @@ export default defineConfig({ { text: 'Options', link: '/guide/options.md' }, { text: 'Popup', link: '/guide/popup.md' }, { text: 'Sandbox', link: '/guide/sandbox.md' }, + { text: 'Sidepanel', link: '/guide/sidepanel.md' }, { text: 'Unlisted Pages', link: '/guide/unlisted-pages.md' }, { text: 'Unlisted Scripts', link: '/guide/unlisted-scripts.md' }, ], diff --git a/docs/.vitepress/theme/custom.css b/docs/.vitepress/theme/custom.css index 3af1ad30..4ac36d45 100644 --- a/docs/.vitepress/theme/custom.css +++ b/docs/.vitepress/theme/custom.css @@ -48,3 +48,11 @@ --vp-code-copy-code-bg: #212321; --vp-code-copy-code-hover-bg: #292d29; } + +.vp-doc .no-vertical-dividers th, +.vp-doc .no-vertical-dividers td { + border: none; +} +.vp-doc .no-vertical-dividers tr { + border: 1px solid var(--vp-c-divider); +} diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index 04520a29..dbf9d480 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -1,10 +1,12 @@ import DefaultTheme from 'vitepress/theme'; import Icon from '../components/Icon.vue'; +import EntrypointPatterns from '../components/EntrypointPatterns.vue'; import './custom.css'; export default { extends: DefaultTheme, enhanceApp(ctx) { ctx.app.component('Icon', Icon); + ctx.app.component('EntrypointPatterns', EntrypointPatterns); }, }; diff --git a/docs/guide/background.md b/docs/guide/background.md index 52adced2..65d28b14 100644 --- a/docs/guide/background.md +++ b/docs/guide/background.md @@ -6,7 +6,11 @@ For MV2, the background is added as a script to the background page. For MV3, th ## Filenames -`entrypoints/background.ts` is the only recoginzed filename for the background script. + ## Definition diff --git a/docs/guide/bookmarks.md b/docs/guide/bookmarks.md index b0ecad74..545bab41 100644 --- a/docs/guide/bookmarks.md +++ b/docs/guide/bookmarks.md @@ -4,8 +4,12 @@ ## Filenames -- `entrypoints/bookmarks.html` -- `entrypoints/bookmarks/index.html` + ## Definition diff --git a/docs/guide/content-scripts.md b/docs/guide/content-scripts.md index 61f365dd..9b604667 100644 --- a/docs/guide/content-scripts.md +++ b/docs/guide/content-scripts.md @@ -2,14 +2,18 @@ [Chrome Docs](https://developer.chrome.com/docs/extensions/mv3/content_scripts/) • [Firefox Docs](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts) +When creating content script entrypoints, they are automatically included in the `manifest.json` along with any CSS they import. + ## Filenames -When a filename matches the pattern below, it is added as a content script in the `manifest.json`. - -- `entrypoints/content.tsx?` -- `entrypoints/.content.tsx?` -- `entrypoints/content/index.tsx?` -- `entrypoints/.content/index.tsx?` + ## Definition diff --git a/docs/guide/css.md b/docs/guide/css.md index 5dc2ddb2..f711ffce 100644 --- a/docs/guide/css.md +++ b/docs/guide/css.md @@ -10,13 +10,16 @@ If the recommended approach doesn't work for your use case, you can use any of t ## Filenames -When a filename matches the pattern below, WXT will transform it and output it with the rest of your extension. - -- `entrypoints/content.(css|scss|sass|less|styl|stylus)` -- `entrypoints/.(css|scss|sass|less|styl|stylus)` -- `entrypoints//index.(css|scss|sass|less|styl|stylus)` -- `entrypoints/.content.(css|scss|sass|less|styl|stylus)` -- `entrypoints/.content/index.(css|scss|sass|less|styl|stylus)` + ## Definition diff --git a/docs/guide/devtools.md b/docs/guide/devtools.md index 68ad8fa0..9a948999 100644 --- a/docs/guide/devtools.md +++ b/docs/guide/devtools.md @@ -4,8 +4,12 @@ ## Filenames -- `entrypoints/devtools.html` -- `entrypoints/devtools/index.html` + ## Definition diff --git a/docs/guide/history.md b/docs/guide/history.md index 4b2e141b..0c80504f 100644 --- a/docs/guide/history.md +++ b/docs/guide/history.md @@ -4,8 +4,12 @@ ## Filenames -- `entrypoints/history.html` -- `entrypoints/history/index.html` + ## Definition diff --git a/docs/guide/newtab.md b/docs/guide/newtab.md index 19d10f62..1a1ed084 100644 --- a/docs/guide/newtab.md +++ b/docs/guide/newtab.md @@ -4,8 +4,12 @@ ## Filenames -- `entrypoints/newtab.html` -- `entrypoints/newtab/index.html` + ## Definition diff --git a/docs/guide/options.md b/docs/guide/options.md index 44e6c253..67b2b4d2 100644 --- a/docs/guide/options.md +++ b/docs/guide/options.md @@ -4,8 +4,12 @@ ## Filenames -- `entrypoints/options.html` -- `entrypoints/options/index.html` + ## Definition diff --git a/docs/guide/popup.md b/docs/guide/popup.md index 6a877ea5..5db380e1 100644 --- a/docs/guide/popup.md +++ b/docs/guide/popup.md @@ -4,8 +4,12 @@ ## Filenames -- `entrypoints/popup.html` -- `entrypoints/popup/index.html` + ## Definition diff --git a/docs/guide/sandbox.md b/docs/guide/sandbox.md index beec40f3..46a4314b 100644 --- a/docs/guide/sandbox.md +++ b/docs/guide/sandbox.md @@ -8,10 +8,14 @@ Firefox does not support sandboxed pages. ## Filenames -- `entrypoints/sandbox.html` -- `entrypoints/.sandbox.html` -- `entrypoints/sandbox/index.html` -- `entrypoints/.sandbox/index.html` + ## Definition diff --git a/docs/guide/sidepanel.md b/docs/guide/sidepanel.md index c79243ad..b60eceda 100644 --- a/docs/guide/sidepanel.md +++ b/docs/guide/sidepanel.md @@ -8,10 +8,14 @@ Firefox does not support sandboxed pages. ## Filenames -- `entrypoints/sidepanel.html` -- `entrypoints/.sidepanel.html` -- `entrypoints/sidepanel/index.html` -- `entrypoints/.sidepanel/index.html` + ## Definition diff --git a/docs/guide/unlisted-pages.md b/docs/guide/unlisted-pages.md index a00aba3b..0565af36 100644 --- a/docs/guide/unlisted-pages.md +++ b/docs/guide/unlisted-pages.md @@ -12,8 +12,12 @@ HTML pages that are built by Vite, but are not included in the manifest. ## Filenames -- `entrypoints/.html` -- `entrypoints//index.html` + Pages are accessible at `'/.html'`: diff --git a/docs/guide/unlisted-scripts.md b/docs/guide/unlisted-scripts.md index 342335df..8efa2dea 100644 --- a/docs/guide/unlisted-scripts.md +++ b/docs/guide/unlisted-scripts.md @@ -4,12 +4,16 @@ TypeScript files that are built, but are not included in the manifest. ## Filenames -- `entrypoints/.tsx?` -- `entrypoints//index.tsx?` + ## Definition -Unlike the background and content scripts, you can define this script's logic in the main scope. +Unlike the background or content scripts, you can define this script's logic in the top level scope. ```ts // Code goes here
entrypoints/{{ pattern[0] }}
/{{ pattern[1] }}