diff --git a/.eslintignore b/.eslintignore index 53c37a1..5a6a90e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ -dist \ No newline at end of file +dist +.svelte-kit \ No newline at end of file diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index c9c1775..842d40c 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-node@v3 - uses: pnpm/action-setup@v2 with: - version: 6 + version: 8 - name: Install dependendencies run: pnpm i diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index eb4a0a7..731c3a1 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-node@v3 - uses: pnpm/action-setup@v2 with: - version: 6 + version: 8 - name: Install dependencies run: pnpm i @@ -25,12 +25,12 @@ jobs: - name: Build packages run: pnpm run build - - name: Build demo + - name: Build docs run: pnpm run build - working-directory: demo + working-directory: docs - name: Deploy pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./demo/build + publish_dir: ./docs/build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be810b1..84a2e6e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/setup-node@v3 - uses: pnpm/action-setup@v2 with: - version: 6 + version: 8 - name: Install dependendencies run: pnpm i @@ -45,7 +45,7 @@ jobs: - uses: actions/setup-node@v3 - uses: pnpm/action-setup@v2 with: - version: 6 + version: 8 - name: Install dependendencies run: pnpm i @@ -53,9 +53,6 @@ jobs: - name: Build all packages run: pnpm build - - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies - run: npm audit signatures - - name: Release run: npm run publish env: diff --git a/.prettierrc b/.prettierrc index a77fdde..8bc6e86 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,7 +3,6 @@ "singleQuote": true, "trailingComma": "none", "printWidth": 100, - "plugins": ["prettier-plugin-svelte"], - "pluginSearchDirs": ["."], + "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 0c2fc2b..85e3f0d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,26 @@ { - "cSpell.words": ["Carta", "cartamd", "Katex", "tikzjax", "tikz"], + "cSpell.words": [ + "Carta", + "cartamd", + "coldark", + "dompurify", + "flexsearch", + "Gemoji", + "gruvbox", + "iconify", + "Katex", + "mdsvex", + "oldschool", + "rehype", + "shiki", + "shikijs", + "tikz", + "tikzjax", + "typeof" + ], "typescript.tsdk": "node_modules\\typescript\\lib", "[svelte]": { "editor.defaultFormatter": "svelte.svelte-vscode" - } + }, + "css.customData": [".vscode/tailwind.json"] } diff --git a/.vscode/tailwind.json b/.vscode/tailwind.json new file mode 100644 index 0000000..a45bccc --- /dev/null +++ b/.vscode/tailwind.json @@ -0,0 +1,55 @@ +{ + "version": 1.1, + "atDirectives": [ + { + "name": "@tailwind", + "description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.", + "references": [ + { + "name": "Tailwind Documentation", + "url": "https://tailwindcss.com/docs/functions-and-directives#tailwind" + } + ] + }, + { + "name": "@apply", + "description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that youโ€™d like to extract to a new component.", + "references": [ + { + "name": "Tailwind Documentation", + "url": "https://tailwindcss.com/docs/functions-and-directives#apply" + } + ] + }, + { + "name": "@responsive", + "description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n", + "references": [ + { + "name": "Tailwind Documentation", + "url": "https://tailwindcss.com/docs/functions-and-directives#responsive" + } + ] + }, + { + "name": "@screen", + "description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\nโ€ฆgets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n", + "references": [ + { + "name": "Tailwind Documentation", + "url": "https://tailwindcss.com/docs/functions-and-directives#screen" + } + ] + }, + { + "name": "@variants", + "description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n", + "references": [ + { + "name": "Tailwind Documentation", + "url": "https://tailwindcss.com/docs/functions-and-directives#variants" + } + ] + } + ] +} diff --git a/README.md b/README.md index 5be5154..38235d5 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,88 @@ +
+ + npm + + + bundle + + + license + + + docs + +
+ +[![Carta.png](https://i.postimg.cc/nV6DMXKM/Carta.png)](https://beartocode.github.io/carta/) + +

Carta

+
Modern, lightweight, powerful Markdown Editor.
+
- logo +๐Ÿ“š Documentation + ยท +GitHub

-
- npm - bundle - license - demo -
+# Introduction -
+> [!NOTE] +> Carta has recently been updated to `v4`, which features numerous major changes. +> +> Follow the [Migration Guide](http://beartocode.github.io/carta/migration) to update your project. -Carta is a **lightweight**, **fast** and **extensible** Svelte Markdown editor and viewer, based on [Marked](https://github.com/markedjs/marked). Check out the [demo](http://beartocode.github.io/carta/) to see it in action. -Differently from most editors, Carta includes neither ProseMirror nor CodeMirror, allowing for an extremely small bundle size and fast loading time. +Carta is a **lightweight**, **fast** and **extensible** Svelte Markdown editor and viewer. It is powered by [unified](https://github.com/unifiedjs/unified), [remark](https://github.com/remarkjs/remark) and [rehype](https://github.com/rehypejs/rehype). Check out the [examples](http://beartocode.github.io/carta/examples) to see it in action. +Differently from most editors, Carta does not include a code editor, but it is _just_ a textarea with syntax highlighting, shortcuts and more. ## Features -- Keyboard **shortcuts** (extensible); -- Toolbar (extensible); -- Markdown syntax highlighting; -- Scroll sync; -- **SSR** compatible; -- **Katex** support (plugin); -- **Slash** commands (plugin); -- **Emojis**, with included search (plugin); -- **Tikz** support(plugin); -- **Attachment** support(plugin); -- Code blocks **syntax highlighting** (plugin). +- ๐ŸŒˆ Markdown syntax highlighting ([Shiki](https://shiki.style/)); +- ๐Ÿ› ๏ธ Toolbar (extensible); +- โŒจ๏ธ Keyboard **shortcuts** (extensible); +- ๐Ÿ“ฆ Supports **[150+ plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins)** thanks to remark; +- ๐Ÿ”€ Scroll sync; +- โœ… Accessibility friendly; +- ๐Ÿ–ฅ๏ธ **SSR** compatible; +- โš—๏ธ **KaTeX** support (plugin); +- ๐Ÿ”จ **Slash** commands (plugin); +- ๐Ÿ˜„ **Emojis**, with included search (plugin); +- โœ๏ธ **TikZ** support (plugin); +- ๐Ÿ“‚ **Attachment** support (plugin); +- โš“ **Anchor** links in headings (plugin); +- ๐ŸŒˆ Code blocks **syntax highlighting** (plugin). -## Getting started +## Packages -> **Warning** +| Package | Status | Docs | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| [carta-md](https://www.npmjs.com/package/carta-md) | ![carta-md](https://img.shields.io/npm/v/carta-md) | [/](https://beartocode.github.io/carta/introduction) | +| [plugin-math](https://www.npmjs.com/package/@cartamd/plugin-math) | ![plugin-math](https://img.shields.io/npm/v/@cartamd/plugin-math) | [/plugins/math](https://beartocode.github.io/carta/plugins/math) | +| [plugin-code](https://www.npmjs.com/package/@cartamd/plugin-code) | ![plugin-code](https://img.shields.io/npm/v/@cartamd/plugin-code) | [/plugins/code](https://beartocode.github.io/carta/plugins/code) | +| [plugin-emoji](https://www.npmjs.com/package/@cartamd/plugin-emoji) | ![plugin-emoji](https://img.shields.io/npm/v/@cartamd/plugin-emoji) | [/plugins/emoji](https://beartocode.github.io/carta/plugins/emoji) | +| [plugin-slash](https://www.npmjs.com/package/@cartamd/plugin-slash) | ![plugin-slash](https://img.shields.io/npm/v/@cartamd/plugin-slash) | [/plugins/slash](https://beartocode.github.io/carta/plugins/slash) | +| [plugin-tikz](https://www.npmjs.com/package/@cartamd/plugin-tikz) | ![plugin-tikz](https://img.shields.io/npm/v/@cartamd/plugin-tikz) | [/plugins/tikz](https://beartocode.github.io/carta/plugins/tikz) | +| [plugin-attachment](https://www.npmjs.com/package/@cartamd/plugin-attachment) | ![plugin-attachment](https://img.shields.io/npm/v/@cartamd/plugin-attachment) | [/plugins/attachment](https://beartocode.github.io/carta/plugins/attachment) | +| [plugin-anchor](https://www.npmjs.com/package/@cartamd/plugin-anchor) | ![plugin-anchor](https://img.shields.io/npm/v/@cartamd/plugin-anchor) | [/plugins/anchor](https://beartocode.github.io/carta/plugins/anchor) | + +## Community plugins + +| Plugin | Description | +| ----------------------------------------------------------------------------- | ---------------------------------- | +| [carta-plugin-video](https://github.com/maisonsmd/carta-plugin-video) | Render online videos | +| [carta-plugin-imsize](https://github.com/maisonsmd/carta-plugin-imsize) | Render images in specific sizes | +| [carta-plugin-subscript](https://github.com/maisonsmd/carta-plugin-subscript) | Render subscripts and superscripts | +| [carta-plugin-ins-del](https://github.com/maisonsmd/carta-plugin-ins-del) | `` and `` tags support | + +# Getting started + +> [!WARNING] > Sanitization is not dealt with by Carta. You need to provide a `sanitizer` in the options. > Common sanitizers are [isomorphic-dompurify](https://www.npmjs.com/package/isomorphic-dompurify) (suggested) and [sanitize-html](https://www.npmjs.com/package/sanitize-html). +> Checkout the documentation for an example. -### Installation +## Installation Core package: @@ -50,15 +96,13 @@ Plugins: npm i @cartamd/plugin-name ``` -### Basic configuration +## Basic configuration ```svelte - + ``` -Editor component exported properties: +# Documentation -| Name | Type | Description | -| ---------------- | ----------------------------- | ----------------------------------------- | -| `carta` | `Carta` | Carta Editor | -| `theme` | `string` | For custom css themes, see below for more | -| `value` | `string` | Markdown input | -| `placeholder` | `string` | Placeholder text for textarea | -| `mode` | `'tabs' \| 'split' \| 'auto'` | Tabs settings | -| `disableToolbar` | `boolean` | Option to disable the toolbar | +For the full documentation, examples, guides and more checkout the [website](https://beartocode.github.io/carta/). -### Plugins +- [Introduction](https://beartocode.github.io/carta/introduction) +- [Examples](https://beartocode.github.io/carta/examples) +- [Getting Started](https://beartocode.github.io/carta/getting-started) +- [Editing Styles](https://beartocode.github.io/carta/editing-styles) +- Plugins: + - [Math](https://beartocode.github.io/carta/plugins/math) + - [Code](https://beartocode.github.io/carta/plugins/code) + - [Emoji](https://beartocode.github.io/carta/plugins/emoji) + - [Slash](https://beartocode.github.io/carta/plugins/slash) + - [TikZ](https://beartocode.github.io/carta/plugins/tikz) + - [Attachment](https://beartocode.github.io/carta/plugins/attachment) + - [Anchor](https://beartocode.github.io/carta/plugins/anchor) +- API: + - [Utilities](https://beartocode.github.io/carta/api/utilities) + - [Core](https://beartocode.github.io/carta/api/core) + - [Extension](https://beartocode.github.io/carta/api/extension) -Each plugin's _readme_ includes a guide on its use. - -| Name | Description | -| ----------------------------------------------------------------------------------------------- | --------------------------------------- | -| [plugin-math](https://github.com/BearToCode/carta/tree/master/packages/plugin-math) | Katex support | -| [plugin-slash](https://github.com/BearToCode/carta/tree/master/packages/plugin-slash) | Slash commands support | -| [plugin-emoji](https://github.com/BearToCode/carta/tree/master/packages/plugin-emoji) | Emojis support, including inline search | -| [plugin-code](https://github.com/BearToCode/carta/tree/master/packages/plugin-code) | Code blocks syntax highlighting | -| [plugin-tikz](https://github.com/BearToCode/carta/tree/master/packages/plugin-tikz) | TikZ support using TikZJax | -| [plugin-attachment](https://github.com/BearToCode/carta/tree/master/packages/plugin-attachment) | Attachments support | - -## Themes customization - -By using the `theme` property in `CartaEditor` and `CartaPreview` you can change their classes to `carta-editor__{theme}` and `carta-viewer__{theme}`. - -Check out the [default theme](https://github.com/BearToCode/carta/blob/master/packages/carta-md/src/lib/default.css) to customize it. - -If you are using a plugin, look at its _readme_ for its customization. - -Markdown highlighting is done using **Speed Highlight JS**, [here](https://github.com/speed-highlight/core/tree/main/src/themes) you can find more themes. - -You can find complete Markdown stylesheet online. For example [github-markdown-css](https://github.com/sindresorhus/github-markdown-css)(used in the demo), or [tailwind-typography](https://tailwindcss.com/docs/typography-plugin). - -## Extensibility - -### Options - -Carta options: - -| Name | Type | Description | -| ------------------ | ------------------------------ | ----------------------------------------------- | -| `extensions` | `CartaExtension[]` | Editor/viewer extensions | -| `rendererDebounce` | `number` | Renderer debouncing timeout, in ms (def. 300ms) | -| `disableShortcuts` | `DefaultShortcutId[] \| true` | Remove default shortcuts by ids | -| `disableIcons` | `DefaultIconId[] \| true` | Remove default icons by ids | -| `disablePrefixes` | `DefaultPrefixId[] \| true` | Remove default prefixes by ids | -| `historyOptions` | `Partial` | History (Undo/Redo) options | -| `sanitizer` | `(html: string) => string` | HTML sanitizer | - -You can easily extend Carta by creating custom plugins. Here are all the `CartaExtension` properties: - -| Name | Type | Description | -| ------------------ | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `markedExtensions` | `marked.MarkedExtension[]` | Marked extensions, more on that [here](https://marked.js.org/using_advanced) | -| `shortcuts` | `KeyboardShortcut[]` | Additional keyboard shortcuts | -| `icons` | `CartaIcon[]` | Additional icons | -| `prefixes` | `Prefix[]` | Additional prefixes | -| `listeners` | `CartaListener[]` | Textarea event listeners | -| `components` | `CartaExtensionComponents` | Additional components, that will be put after the editor. All components are given a `carta: Carta`. prop The editor has a `relative` position, so you can position elements absolutely | -| `highlightRules` | `HighlightRule[]` | Custom markdown highlight rules. See [Speed-Highlight Wiki](https://github.com/speed-highlight/core/wiki/Create-or-suggest-new-languages). | -| `onLoad` | `(data: { carta:Carta, ... }) => void` | Use this callback to execute code when one Carta instance loads the extension. | - -If you created a plugin and want to share it, you can open an _issue_ and we will consider sponsoring it on this guide. - -## Contributions +# Contributing & Development Every contribution is well accepted. If you have a feature request you can open a new issue. @@ -159,3 +158,12 @@ npm run commit # or, if you have commitizen installed globally git cz ``` + +### Running docs + +If you want to preview the docs: + +``` +cd docs +npm run dev +``` diff --git a/demo/.npmrc b/demo/.npmrc deleted file mode 100644 index 0c05da4..0000000 --- a/demo/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -engine-strict=true -resolution-mode=highest diff --git a/demo/src/routes/+page.svelte b/demo/src/routes/+page.svelte deleted file mode 100644 index 879c4ad..0000000 --- a/demo/src/routes/+page.svelte +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - -
-
-
- Scroll - - - -
- -
- Editor mode - -
- - -
- -
- - -
- -
- - -
-
-
- - -
- - diff --git a/demo/src/routes/+page.ts b/demo/src/routes/+page.ts deleted file mode 100644 index 189f71e..0000000 --- a/demo/src/routes/+page.ts +++ /dev/null @@ -1 +0,0 @@ -export const prerender = true; diff --git a/demo/src/routes/placeholder.ts b/demo/src/routes/placeholder.ts deleted file mode 100644 index 3731509..0000000 --- a/demo/src/routes/placeholder.ts +++ /dev/null @@ -1,122 +0,0 @@ -export const placeholderText = `# Carta Demo - -Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the **Galaxy** lies a small unregarded yellow sun. -Orbiting this at a distance of roughly _ninety-two million miles_ is an utterly insignificant little blue green planet :earth_africa: whose ape-descended life forms are so amazingly primitive that they still think digital watches are a pretty neat idea. - -\`\`\`tikz -\\usepackage{pgfplots} -\\pgfplotsset{compat=1.16} - -\\pgfplotsset{width=7cm,compat=1.8} -\\begin{document} -\\begin{tikzpicture}[thick,scale=1.2, every node/.style={scale=1.2}] - \\begin{axis} - \\addplot3[ - surf, - colormap/viridis, - samples=20, - domain=0:2*pi, - y domain=0:2*pi, - z buffer=sort - ] - ( {(2+cos(deg(x)))*cos(deg(y+pi/2))}, - {(2+cos(deg(x)))*sin(deg(y+pi/2))}, - {sin(deg(x))} - ); - \\end{axis} -\\end{tikzpicture} -\\end{document} -\`\`\` - -# Basic Markdown - -You can have different types of text: **bold**, _italic_, \`code\` and ~~strikethrough~~. This is a [link](http://beartocode.github.io/carta/) to the page you are currently viewing. - -Here is a quote: - -> Time is an illusion. Lunchtime doubly so. - -And then some lists: - -- This is a bulleted list -- Which does not have an order -- but only some dots - -1. And then that's one with numbers -2. That just keep going -3. and going - -- [ ] And finally this is a task list -- [ ] Where you can keep track of to-dos -- [x] by putting an _x_ inside the brackets - -You can also create tables, like so: - -| Item | Price | Origin | -| ------- | ----- | ------ | -| :apple: | 2.1 | Italy | -| :banana:| 42 | Brazil | -| :lemon: | 18 | Spain | - -# Official Plugins - -## \`plugin-code\` - -This plugin adds support for **syntax highlighting** on your code blocks: - -\`\`\`rs -fn visit_mars() { - let spaceship = get_spaceship(); - - spaceship.liftoff(); - spaceship.head_to(Planet::Mars); - thread::sleep(Time::Month(6)); - spaceship.land(); -} -\`\`\` - -## \`plugin-math\` - - -With this plugin you can write beautiful Katex expressions, both _inline_ $\\underline{v}=A-\\lambda I_d$, and as _block_ equations: - -$$ -{\\displaystyle {\\boldsymbol {\\sigma }}=\\zeta (\\nabla \\cdot \\mathbf {u} )\\mathbf {I} +\\mu \\left[\\nabla \\mathbf {u} +(\\nabla \\mathbf {u} )^{\\mathrm {T} }-{\\tfrac {2}{3}}(\\nabla \\cdot \\mathbf {u} )\\mathbf {I} \\right]} -$$ - -## \`plugin-emoji\` - -Adds support for **emojis**, as well as an inline emoji search, that appears after typing a colon. :smile_cat: - -Try typing an icon to see the inline search. :alien: - -## \`plugin-slash\` - -Use a **slash** / to use commands while writing markdown. You can add your custom commands too. Also includes a inline command search. - -## \`plugin-tikz\` - - -\`\`\`tikz -\\usepackage{pgfplots} -\\pgfplotsset{compat=1.16} -\\pgfplotsset{width=7cm} - -\\begin{document} -\\begin{tikzpicture}[thick,scale=1.2, every node/.style={scale=1.2}] - \\begin{axis}[domain=-1:1,y domain=-1:1] - \\addplot3[ - surf, - colormap/viridis, - samples = 18 - ] - {x*y*exp(x+2*y-9*x^2-9*y^2)}; - \\end{axis} -\\end{tikzpicture} -\\end{document} -\`\`\` - -Adds support for **TikZ**, thanks to [TikZJax](https://tikzjax.com/). - - -`; diff --git a/demo/static/.nojekyll b/demo/static/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/demo/static/github-light-theme.css b/demo/static/github-light-theme.css deleted file mode 100644 index 45f073b..0000000 --- a/demo/static/github-light-theme.css +++ /dev/null @@ -1,1007 +0,0 @@ -.markdown-body { - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; - margin: 0; - color: #24292f; - background-color: #ffffff; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, - sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; - font-size: 16px; - line-height: 1.5; - word-wrap: break-word; -} - -.markdown-body .octicon { - display: inline-block; - fill: currentColor; - vertical-align: text-bottom; -} - -.markdown-body h1:hover .anchor .octicon-link:before, -.markdown-body h2:hover .anchor .octicon-link:before, -.markdown-body h3:hover .anchor .octicon-link:before, -.markdown-body h4:hover .anchor .octicon-link:before, -.markdown-body h5:hover .anchor .octicon-link:before, -.markdown-body h6:hover .anchor .octicon-link:before { - width: 16px; - height: 16px; - content: ' '; - display: inline-block; - background-color: currentColor; - -webkit-mask-image: url("data:image/svg+xml,"); - mask-image: url("data:image/svg+xml,"); -} - -.markdown-body details, -.markdown-body figcaption, -.markdown-body figure { - display: block; -} - -.markdown-body summary { - display: list-item; -} - -.markdown-body [hidden] { - display: none !important; -} - -.markdown-body a { - background-color: transparent; - color: #0969da; - text-decoration: none; -} - -.markdown-body abbr[title] { - border-bottom: none; - text-decoration: underline dotted; -} - -.markdown-body b, -.markdown-body strong { - font-weight: 600; -} - -.markdown-body dfn { - font-style: italic; -} - -.markdown-body h1 { - margin: 0.67em 0; - font-weight: 600; - padding-bottom: 0.3em; - font-size: 2em; - border-bottom: 1px solid hsla(210, 18%, 87%, 1); -} - -.markdown-body mark { - background-color: #fff8c5; - color: #24292f; -} - -.markdown-body small { - font-size: 90%; -} - -.markdown-body sub, -.markdown-body sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -.markdown-body sub { - bottom: -0.25em; -} - -.markdown-body sup { - top: -0.5em; -} - -.markdown-body img { - border-style: none; - max-width: 100%; - box-sizing: content-box; - background-color: #ffffff; -} - -.markdown-body code, -.markdown-body kbd, -.markdown-body pre, -.markdown-body samp { - font-family: monospace; - font-size: 1em; -} - -.markdown-body figure { - margin: 1em 40px; -} - -.markdown-body hr { - box-sizing: content-box; - overflow: hidden; - background: transparent; - border-bottom: 1px solid hsla(210, 18%, 87%, 1); - height: 0.25em; - padding: 0; - margin: 24px 0; - background-color: #d0d7de; - border: 0; -} - -.markdown-body input { - font: inherit; - margin: 0; - overflow: visible; - font-family: inherit; - font-size: inherit; - line-height: inherit; -} - -.markdown-body [type='button'], -.markdown-body [type='reset'], -.markdown-body [type='submit'] { - -webkit-appearance: button; -} - -.markdown-body [type='checkbox'], -.markdown-body [type='radio'] { - box-sizing: border-box; - padding: 0; -} - -.markdown-body [type='number']::-webkit-inner-spin-button, -.markdown-body [type='number']::-webkit-outer-spin-button { - height: auto; -} - -.markdown-body [type='search']::-webkit-search-cancel-button, -.markdown-body [type='search']::-webkit-search-decoration { - -webkit-appearance: none; -} - -.markdown-body ::-webkit-input-placeholder { - color: inherit; - opacity: 0.54; -} - -.markdown-body ::-webkit-file-upload-button { - -webkit-appearance: button; - font: inherit; -} - -.markdown-body a:hover { - text-decoration: underline; -} - -.markdown-body ::placeholder { - color: #6e7781; - opacity: 1; -} - -.markdown-body hr::before { - display: table; - content: ''; -} - -.markdown-body hr::after { - display: table; - clear: both; - content: ''; -} - -.markdown-body table { - border-spacing: 0; - border-collapse: collapse; - display: block; - width: max-content; - max-width: 100%; - overflow: auto; -} - -.markdown-body td, -.markdown-body th { - padding: 0; -} - -.markdown-body details summary { - cursor: pointer; -} - -.markdown-body details:not([open]) > *:not(summary) { - display: none !important; -} - -.markdown-body a:focus, -.markdown-body [role='button']:focus, -.markdown-body input[type='radio']:focus, -.markdown-body input[type='checkbox']:focus { - outline: 2px solid #0969da; - outline-offset: -2px; - box-shadow: none; -} - -.markdown-body a:focus:not(:focus-visible), -.markdown-body [role='button']:focus:not(:focus-visible), -.markdown-body input[type='radio']:focus:not(:focus-visible), -.markdown-body input[type='checkbox']:focus:not(:focus-visible) { - outline: solid 1px transparent; -} - -.markdown-body a:focus-visible, -.markdown-body [role='button']:focus-visible, -.markdown-body input[type='radio']:focus-visible, -.markdown-body input[type='checkbox']:focus-visible { - outline: 2px solid #0969da; - outline-offset: -2px; - box-shadow: none; -} - -.markdown-body a:not([class]):focus, -.markdown-body a:not([class]):focus-visible, -.markdown-body input[type='radio']:focus, -.markdown-body input[type='radio']:focus-visible, -.markdown-body input[type='checkbox']:focus, -.markdown-body input[type='checkbox']:focus-visible { - outline-offset: 0; -} - -.markdown-body kbd { - display: inline-block; - padding: 3px 5px; - font: 11px ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace; - line-height: 10px; - color: #24292f; - vertical-align: middle; - background-color: #f6f8fa; - border: solid 1px rgba(175, 184, 193, 0.2); - border-bottom-color: rgba(175, 184, 193, 0.2); - border-radius: 6px; - box-shadow: inset 0 -1px 0 rgba(175, 184, 193, 0.2); -} - -.markdown-body h1, -.markdown-body h2, -.markdown-body h3, -.markdown-body h4, -.markdown-body h5, -.markdown-body h6 { - margin-top: 24px; - margin-bottom: 16px; - font-weight: 600; - line-height: 1.25; -} - -.markdown-body h2 { - font-weight: 600; - padding-bottom: 0.3em; - font-size: 1.5em; - border-bottom: 1px solid hsla(210, 18%, 87%, 1); -} - -.markdown-body h3 { - font-weight: 600; - font-size: 1.25em; -} - -.markdown-body h4 { - font-weight: 600; - font-size: 1em; -} - -.markdown-body h5 { - font-weight: 600; - font-size: 0.875em; -} - -.markdown-body h6 { - font-weight: 600; - font-size: 0.85em; - color: #57606a; -} - -.markdown-body p { - margin-top: 0; - margin-bottom: 10px; -} - -.markdown-body blockquote { - margin: 0; - padding: 0 1em; - color: #57606a; - border-left: 0.25em solid #d0d7de; -} - -.markdown-body ul, -.markdown-body ol { - margin-top: 0; - margin-bottom: 0; - padding-left: 2em; -} - -.markdown-body ol ol, -.markdown-body ul ol { - list-style-type: lower-roman; -} - -.markdown-body ul ul ol, -.markdown-body ul ol ol, -.markdown-body ol ul ol, -.markdown-body ol ol ol { - list-style-type: lower-alpha; -} - -.markdown-body dd { - margin-left: 0; -} - -.markdown-body tt, -.markdown-body code, -.markdown-body samp { - font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace; - font-size: 12px; -} - -.markdown-body pre { - margin-top: 0; - margin-bottom: 0; - font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace; - font-size: 12px; - word-wrap: normal; -} - -.markdown-body .octicon { - display: inline-block; - overflow: visible !important; - vertical-align: text-bottom; - fill: currentColor; -} - -.markdown-body input::-webkit-outer-spin-button, -.markdown-body input::-webkit-inner-spin-button { - margin: 0; - -webkit-appearance: none; - appearance: none; -} - -.markdown-body::before { - display: table; - content: ''; -} - -.markdown-body::after { - display: table; - clear: both; - content: ''; -} - -.markdown-body > *:first-child { - margin-top: 0 !important; -} - -.markdown-body > *:last-child { - margin-bottom: 0 !important; -} - -.markdown-body a:not([href]) { - color: inherit; - text-decoration: none; -} - -.markdown-body .absent { - color: #cf222e; -} - -.markdown-body .anchor { - float: left; - padding-right: 4px; - margin-left: -20px; - line-height: 1; -} - -.markdown-body .anchor:focus { - outline: none; -} - -.markdown-body p, -.markdown-body blockquote, -.markdown-body ul, -.markdown-body ol, -.markdown-body dl, -.markdown-body table, -.markdown-body pre, -.markdown-body details { - margin-top: 0; - margin-bottom: 16px; -} - -.markdown-body blockquote > :first-child { - margin-top: 0; -} - -.markdown-body blockquote > :last-child { - margin-bottom: 0; -} - -.markdown-body h1 .octicon-link, -.markdown-body h2 .octicon-link, -.markdown-body h3 .octicon-link, -.markdown-body h4 .octicon-link, -.markdown-body h5 .octicon-link, -.markdown-body h6 .octicon-link { - color: #24292f; - vertical-align: middle; - visibility: hidden; -} - -.markdown-body h1:hover .anchor, -.markdown-body h2:hover .anchor, -.markdown-body h3:hover .anchor, -.markdown-body h4:hover .anchor, -.markdown-body h5:hover .anchor, -.markdown-body h6:hover .anchor { - text-decoration: none; -} - -.markdown-body h1:hover .anchor .octicon-link, -.markdown-body h2:hover .anchor .octicon-link, -.markdown-body h3:hover .anchor .octicon-link, -.markdown-body h4:hover .anchor .octicon-link, -.markdown-body h5:hover .anchor .octicon-link, -.markdown-body h6:hover .anchor .octicon-link { - visibility: visible; -} - -.markdown-body h1 tt, -.markdown-body h1 code, -.markdown-body h2 tt, -.markdown-body h2 code, -.markdown-body h3 tt, -.markdown-body h3 code, -.markdown-body h4 tt, -.markdown-body h4 code, -.markdown-body h5 tt, -.markdown-body h5 code, -.markdown-body h6 tt, -.markdown-body h6 code { - padding: 0 0.2em; - font-size: inherit; -} - -.markdown-body summary h1, -.markdown-body summary h2, -.markdown-body summary h3, -.markdown-body summary h4, -.markdown-body summary h5, -.markdown-body summary h6 { - display: inline-block; -} - -.markdown-body summary h1 .anchor, -.markdown-body summary h2 .anchor, -.markdown-body summary h3 .anchor, -.markdown-body summary h4 .anchor, -.markdown-body summary h5 .anchor, -.markdown-body summary h6 .anchor { - margin-left: -40px; -} - -.markdown-body summary h1, -.markdown-body summary h2 { - padding-bottom: 0; - border-bottom: 0; -} - -.markdown-body ul.no-list, -.markdown-body ol.no-list { - padding: 0; - list-style-type: none; -} - -.markdown-body ol[type='a'] { - list-style-type: lower-alpha; -} - -.markdown-body ol[type='A'] { - list-style-type: upper-alpha; -} - -.markdown-body ol[type='i'] { - list-style-type: lower-roman; -} - -.markdown-body ol[type='I'] { - list-style-type: upper-roman; -} - -.markdown-body ol[type='1'] { - list-style-type: decimal; -} - -.markdown-body div > ol:not([type]) { - list-style-type: decimal; -} - -.markdown-body ul ul, -.markdown-body ul ol, -.markdown-body ol ol, -.markdown-body ol ul { - margin-top: 0; - margin-bottom: 0; -} - -.markdown-body li > p { - margin-top: 16px; -} - -.markdown-body li + li { - margin-top: 0.25em; -} - -.markdown-body dl { - padding: 0; -} - -.markdown-body dl dt { - padding: 0; - margin-top: 16px; - font-size: 1em; - font-style: italic; - font-weight: 600; -} - -.markdown-body dl dd { - padding: 0 16px; - margin-bottom: 16px; -} - -.markdown-body table th { - font-weight: 600; -} - -.markdown-body table th, -.markdown-body table td { - padding: 6px 13px; - border: 1px solid #d0d7de; -} - -.markdown-body table tr { - background-color: #ffffff; - border-top: 1px solid hsla(210, 18%, 87%, 1); -} - -.markdown-body table tr:nth-child(2n) { - background-color: #f6f8fa; -} - -.markdown-body table img { - background-color: transparent; -} - -.markdown-body img[align='right'] { - padding-left: 20px; -} - -.markdown-body img[align='left'] { - padding-right: 20px; -} - -.markdown-body .emoji { - max-width: none; - vertical-align: text-top; - background-color: transparent; -} - -.markdown-body span.frame { - display: block; - overflow: hidden; -} - -.markdown-body span.frame > span { - display: block; - float: left; - width: auto; - padding: 7px; - margin: 13px 0 0; - overflow: hidden; - border: 1px solid #d0d7de; -} - -.markdown-body span.frame span img { - display: block; - float: left; -} - -.markdown-body span.frame span span { - display: block; - padding: 5px 0 0; - clear: both; - color: #24292f; -} - -.markdown-body span.align-center { - display: block; - overflow: hidden; - clear: both; -} - -.markdown-body span.align-center > span { - display: block; - margin: 13px auto 0; - overflow: hidden; - text-align: center; -} - -.markdown-body span.align-center span img { - margin: 0 auto; - text-align: center; -} - -.markdown-body span.align-right { - display: block; - overflow: hidden; - clear: both; -} - -.markdown-body span.align-right > span { - display: block; - margin: 13px 0 0; - overflow: hidden; - text-align: right; -} - -.markdown-body span.align-right span img { - margin: 0; - text-align: right; -} - -.markdown-body span.float-left { - display: block; - float: left; - margin-right: 13px; - overflow: hidden; -} - -.markdown-body span.float-left span { - margin: 13px 0 0; -} - -.markdown-body span.float-right { - display: block; - float: right; - margin-left: 13px; - overflow: hidden; -} - -.markdown-body span.float-right > span { - display: block; - margin: 13px auto 0; - overflow: hidden; - text-align: right; -} - -.markdown-body code, -.markdown-body tt { - padding: 0.2em 0.4em; - margin: 0; - font-size: 85%; - white-space: break-spaces; - background-color: rgba(175, 184, 193, 0.2); - border-radius: 6px; -} - -.markdown-body code br, -.markdown-body tt br { - display: none; -} - -.markdown-body del code { - text-decoration: inherit; -} - -.markdown-body samp { - font-size: 85%; -} - -.markdown-body pre code { - font-size: 100%; -} - -.markdown-body pre > code { - padding: 0; - margin: 0; - word-break: normal; - white-space: pre; - background: transparent; - border: 0; -} - -.markdown-body .highlight { - margin-bottom: 16px; -} - -.markdown-body .highlight pre { - margin-bottom: 0; - word-break: normal; -} - -.markdown-body .highlight pre, -.markdown-body pre { - padding: 16px; - overflow: auto; - font-size: 85%; - line-height: 1.45; - background-color: #f6f8fa; - border-radius: 6px; -} - -.markdown-body pre code, -.markdown-body pre tt { - display: inline; - max-width: auto; - padding: 0; - margin: 0; - overflow: visible; - line-height: inherit; - word-wrap: normal; - background-color: transparent; - border: 0; -} - -.markdown-body .csv-data td, -.markdown-body .csv-data th { - padding: 5px; - overflow: hidden; - font-size: 12px; - line-height: 1; - text-align: left; - white-space: nowrap; -} - -.markdown-body .csv-data .blob-num { - padding: 10px 8px 9px; - text-align: right; - background: #ffffff; - border: 0; -} - -.markdown-body .csv-data tr { - border-top: 0; -} - -.markdown-body .csv-data th { - font-weight: 600; - background: #f6f8fa; - border-top: 0; -} - -.markdown-body [data-footnote-ref]::before { - content: '['; -} - -.markdown-body [data-footnote-ref]::after { - content: ']'; -} - -.markdown-body .footnotes { - font-size: 12px; - color: #57606a; - border-top: 1px solid #d0d7de; -} - -.markdown-body .footnotes ol { - padding-left: 16px; -} - -.markdown-body .footnotes ol ul { - display: inline-block; - padding-left: 16px; - margin-top: 16px; -} - -.markdown-body .footnotes li { - position: relative; -} - -.markdown-body .footnotes li:target::before { - position: absolute; - top: -8px; - right: -8px; - bottom: -8px; - left: -24px; - pointer-events: none; - content: ''; - border: 2px solid #0969da; - border-radius: 6px; -} - -.markdown-body .footnotes li:target { - color: #24292f; -} - -.markdown-body .footnotes .data-footnote-backref g-emoji { - font-family: monospace; -} - -.markdown-body .pl-c { - color: #6e7781; -} - -.markdown-body .pl-c1, -.markdown-body .pl-s .pl-v { - color: #0550ae; -} - -.markdown-body .pl-e, -.markdown-body .pl-en { - color: #8250df; -} - -.markdown-body .pl-smi, -.markdown-body .pl-s .pl-s1 { - color: #24292f; -} - -.markdown-body .pl-ent { - color: #116329; -} - -.markdown-body .pl-k { - color: #cf222e; -} - -.markdown-body .pl-s, -.markdown-body .pl-pds, -.markdown-body .pl-s .pl-pse .pl-s1, -.markdown-body .pl-sr, -.markdown-body .pl-sr .pl-cce, -.markdown-body .pl-sr .pl-sre, -.markdown-body .pl-sr .pl-sra { - color: #0a3069; -} - -.markdown-body .pl-v, -.markdown-body .pl-smw { - color: #953800; -} - -.markdown-body .pl-bu { - color: #82071e; -} - -.markdown-body .pl-ii { - color: #f6f8fa; - background-color: #82071e; -} - -.markdown-body .pl-c2 { - color: #f6f8fa; - background-color: #cf222e; -} - -.markdown-body .pl-sr .pl-cce { - font-weight: bold; - color: #116329; -} - -.markdown-body .pl-ml { - color: #3b2300; -} - -.markdown-body .pl-mh, -.markdown-body .pl-mh .pl-en, -.markdown-body .pl-ms { - font-weight: bold; - color: #0550ae; -} - -.markdown-body .pl-mi { - font-style: italic; - color: #24292f; -} - -.markdown-body .pl-mb { - font-weight: bold; - color: #24292f; -} - -.markdown-body .pl-md { - color: #82071e; - background-color: #ffebe9; -} - -.markdown-body .pl-mi1 { - color: #116329; - background-color: #dafbe1; -} - -.markdown-body .pl-mc { - color: #953800; - background-color: #ffd8b5; -} - -.markdown-body .pl-mi2 { - color: #eaeef2; - background-color: #0550ae; -} - -.markdown-body .pl-mdr { - font-weight: bold; - color: #8250df; -} - -.markdown-body .pl-ba { - color: #57606a; -} - -.markdown-body .pl-sg { - color: #8c959f; -} - -.markdown-body .pl-corl { - text-decoration: underline; - color: #0a3069; -} - -.markdown-body g-emoji { - display: inline-block; - min-width: 1ch; - font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; - font-size: 1em; - font-style: normal !important; - font-weight: 400; - line-height: 1; - vertical-align: -0.075em; -} - -.markdown-body g-emoji img { - width: 1em; - height: 1em; -} - -.markdown-body .task-list-item { - list-style-type: none; -} - -.markdown-body .task-list-item label { - font-weight: 400; -} - -.markdown-body .task-list-item.enabled label { - cursor: pointer; -} - -.markdown-body .task-list-item + .task-list-item { - margin-top: 4px; -} - -.markdown-body .task-list-item .handle { - display: none; -} - -.markdown-body .task-list-item-checkbox { - margin: 0 0.2em 0.25em -1.4em; - vertical-align: middle; -} - -.markdown-body .contains-task-list:dir(rtl) .task-list-item-checkbox { - margin: 0 -1.6em 0.25em 0.2em; -} - -.markdown-body .contains-task-list { - position: relative; -} - -.markdown-body .contains-task-list:hover .task-list-item-convert-container, -.markdown-body .contains-task-list:focus-within .task-list-item-convert-container { - display: block; - width: auto; - height: 24px; - overflow: visible; - clip: auto; -} - -.markdown-body ::-webkit-calendar-picker-indicator { - filter: invert(50%); -} diff --git a/demo/.gitignore b/docs/.gitignore similarity index 95% rename from demo/.gitignore rename to docs/.gitignore index 6635cf5..ac7211b 100644 --- a/demo/.gitignore +++ b/docs/.gitignore @@ -1,6 +1,7 @@ .DS_Store node_modules /build +/dist /.svelte-kit /package .env diff --git a/docs/components.json b/docs/components.json new file mode 100644 index 0000000..849ec61 --- /dev/null +++ b/docs/components.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://shadcn-svelte.com/schema.json", + "style": "new-york", + "tailwind": { + "config": "tailwind.config.js", + "css": "src/app.postcss", + "baseColor": "neutral" + }, + "aliases": { + "components": "$lib/components", + "utils": "$lib/utils" + } +} diff --git a/docs/mdsvex.config.js b/docs/mdsvex.config.js new file mode 100644 index 0000000..93d975b --- /dev/null +++ b/docs/mdsvex.config.js @@ -0,0 +1,16 @@ +import { defineMDSveXConfig as defineConfig } from 'mdsvex'; +import rehypeSlug from 'rehype-slug'; +import rehypeAutolinkHeadings from 'rehype-autolink-headings'; + +const config = defineConfig({ + extensions: ['.svelte.md', '.md', '.svx'], + + smartypants: { + dashes: 'oldschool' + }, + + remarkPlugins: [], + rehypePlugins: [rehypeSlug, [rehypeAutolinkHeadings, { behavior: 'wrap' }]] +}); + +export default config; diff --git a/demo/package.json b/docs/package.json similarity index 53% rename from demo/package.json rename to docs/package.json index 892ece0..7a24ff5 100644 --- a/demo/package.json +++ b/docs/package.json @@ -1,5 +1,5 @@ { - "name": "demo", + "name": "docs", "version": "0.0.1", "private": true, "license": "MIT", @@ -15,24 +15,40 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" }, "devDependencies": { - "@sveltejs/adapter-auto": "^2.0.0", - "@sveltejs/adapter-static": "1.0.0-next.50", - "@sveltejs/kit": "^1.5.0", + "@sveltejs/adapter-auto": "^3.1.1", + "@sveltejs/adapter-static": "3.0.1", + "@sveltejs/kit": "^2.5.4", + "@sveltejs/package": "^2.3.0", + "@sveltejs/vite-plugin-svelte": "^3.0.2", + "@types/flexsearch": "^0.7.6", "@types/katex": "^0.16.0", - "svelte": "^3.54.0 || ^4.0.0", - "svelte-check": "^3.0.1", + "autoprefixer": "^10.4.16", + "mdsvex": "^0.11.0", + "rehype-autolink-headings": "^7.1.0", + "rehype-slug": "^6.0.0", + "sass": "^1.69.5", + "svelte": "^4.2.12", + "svelte-check": "^3.6.7", + "tailwindcss": "^3.3.5", "tslib": "^2.4.1", "typescript": "^5.0.0", - "vite": "^4.3.9" + "vite": "^5.1.6" }, "type": "module", "dependencies": { + "@cartamd/plugin-attachment": "workspace:^", "@cartamd/plugin-code": "workspace:^", "@cartamd/plugin-emoji": "workspace:^", "@cartamd/plugin-math": "workspace:^", "@cartamd/plugin-slash": "workspace:^", "@cartamd/plugin-tikz": "workspace:^", + "bits-ui": "^0.9.1", "carta-md": "workspace:^", - "katex": "^0.16.7" + "clsx": "^2.0.0", + "cmdk-sv": "^0.0.6", + "flexsearch": "0.7.21", + "iconify-icon": "^2.0.0", + "katex": "^0.16.10", + "tailwind-merge": "^2.0.0" } } diff --git a/docs/postcss.config.cjs b/docs/postcss.config.cjs new file mode 100644 index 0000000..4eb987c --- /dev/null +++ b/docs/postcss.config.cjs @@ -0,0 +1,8 @@ +const tailwindcss = require('tailwindcss'); +const autoprefixer = require('autoprefixer'); + +const config = { + plugins: [tailwindcss(), autoprefixer] +}; + +module.exports = config; diff --git a/demo/src/app.d.ts b/docs/src/app.d.ts similarity index 100% rename from demo/src/app.d.ts rename to docs/src/app.d.ts diff --git a/docs/src/app.html b/docs/src/app.html new file mode 100644 index 0000000..e9a46db --- /dev/null +++ b/docs/src/app.html @@ -0,0 +1,25 @@ + + + + + + + %sveltekit.head% + + + + + + + + + +
%sveltekit.body%
+ + diff --git a/docs/src/app.postcss b/docs/src/app.postcss new file mode 100644 index 0000000..5c9e7a3 --- /dev/null +++ b/docs/src/app.postcss @@ -0,0 +1,84 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer base { + :root { + --background: 0 0% 100%; + --foreground: 0 0% 3.9%; + + --muted: 0 0% 96.1%; + --muted-foreground: 0 0% 45.1%; + + --popover: 0 0% 100%; + --popover-foreground: 0 0% 3.9%; + + --card: 0 0% 100%; + --card-foreground: 0 0% 3.9%; + + --border: 0 0% 89.8%; + --input: 0 0% 89.8%; + + --primary: 0 0% 9%; + --primary-foreground: 0 0% 98%; + + --secondary: 0 0% 96.1%; + --secondary-foreground: 0 0% 9%; + + --accent: 0 0% 96.1%; + --accent-foreground: 0 0% 9%; + + --destructive: 0 84.2% 60.2%; + --destructive-foreground: 0 0% 98%; + + --ring: 0 0% 3.9%; + + --radius: 0.5rem; + + font-family: 'Inter', sans-serif; + } + + .dark { + --background: 0 0% 3.9%; + --foreground: 0 0% 98%; + + --muted: 0 0% 14.9%; + --muted-foreground: 0 0% 63.9%; + + --popover: 0 0% 3.9%; + --popover-foreground: 0 0% 98%; + + --card: 0 0% 3.9%; + --card-foreground: 0 0% 98%; + + --border: 0 0% 14.9%; + --input: 0 0% 14.9%; + + --primary: 0 0% 98%; + --primary-foreground: 0 0% 9%; + + --secondary: 0 0% 14.9%; + --secondary-foreground: 0 0% 98%; + + --accent: 0 0% 14.9%; + --accent-foreground: 0 0% 98%; + + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 0 0% 98%; + + --ring: 0 0% 83.1%; + } +} + +@layer base { + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; + } +} + +nav div[data-portal] { + display: none; +} diff --git a/docs/src/lib/components/code/Code.svelte b/docs/src/lib/components/code/Code.svelte new file mode 100644 index 0000000..8be7d1f --- /dev/null +++ b/docs/src/lib/components/code/Code.svelte @@ -0,0 +1,20 @@ + + +
+ + + +
diff --git a/docs/src/lib/components/footer/Footer.svelte b/docs/src/lib/components/footer/Footer.svelte new file mode 100644 index 0000000..c1725e0 --- /dev/null +++ b/docs/src/lib/components/footer/Footer.svelte @@ -0,0 +1,9 @@ +
+ Handmade by Davide +
diff --git a/docs/src/lib/components/header-tracker/HeaderTracker.svelte b/docs/src/lib/components/header-tracker/HeaderTracker.svelte new file mode 100644 index 0000000..d584c97 --- /dev/null +++ b/docs/src/lib/components/header-tracker/HeaderTracker.svelte @@ -0,0 +1,66 @@ + + + { + throttledHighlightHeader(); + debouncedHighlightHeader(); // So it is called at the end of the scroll event + }} +/> + +
+ {#each headers as header, i} + {@const margin = Number(header.tagName.split('')[1]) - 1} + {#key selectedHeaderIndex} + {#if header.children[0] instanceof HTMLAnchorElement && header.children[0].href} + {header.innerText} + {/if} + {/key} + {/each} +
diff --git a/docs/src/lib/components/link/Link.svelte b/docs/src/lib/components/link/Link.svelte new file mode 100644 index 0000000..5090779 --- /dev/null +++ b/docs/src/lib/components/link/Link.svelte @@ -0,0 +1,17 @@ + + + + + diff --git a/docs/src/lib/components/link/PluginLink.svelte b/docs/src/lib/components/link/PluginLink.svelte new file mode 100644 index 0000000..8318e91 --- /dev/null +++ b/docs/src/lib/components/link/PluginLink.svelte @@ -0,0 +1,22 @@ + + + + + diff --git a/docs/src/lib/components/mobile-sidebar/MobileSidebar.svelte b/docs/src/lib/components/mobile-sidebar/MobileSidebar.svelte new file mode 100644 index 0000000..1ebb918 --- /dev/null +++ b/docs/src/lib/components/mobile-sidebar/MobileSidebar.svelte @@ -0,0 +1,34 @@ + + +
+ +
+ +{#if enabled} +
+ +
+ + +
+{/if} diff --git a/docs/src/lib/components/navbar/GitHub.svelte b/docs/src/lib/components/navbar/GitHub.svelte new file mode 100644 index 0000000..226d95d --- /dev/null +++ b/docs/src/lib/components/navbar/GitHub.svelte @@ -0,0 +1,33 @@ + + + + +