diff --git a/.eslintignore b/.eslintignore index 5a6a90e..53c37a1 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1 @@ -dist -.svelte-kit \ No newline at end of file +dist \ No newline at end of file diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 842d40c..c9c1775 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: 8 + version: 6 - name: Install dependendencies run: pnpm i diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 731c3a1..eb4a0a7 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: 8 + version: 6 - name: Install dependencies run: pnpm i @@ -25,12 +25,12 @@ jobs: - name: Build packages run: pnpm run build - - name: Build docs + - name: Build demo run: pnpm run build - working-directory: docs + working-directory: demo - name: Deploy pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/build + publish_dir: ./demo/build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84a2e6e..be810b1 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: 8 + version: 6 - name: Install dependendencies run: pnpm i @@ -45,7 +45,7 @@ jobs: - uses: actions/setup-node@v3 - uses: pnpm/action-setup@v2 with: - version: 8 + version: 6 - name: Install dependendencies run: pnpm i @@ -53,6 +53,9 @@ 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 8bc6e86..a77fdde 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,6 +3,7 @@ "singleQuote": true, "trailingComma": "none", "printWidth": 100, - "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], + "plugins": ["prettier-plugin-svelte"], + "pluginSearchDirs": ["."], "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 85e3f0d..0c2fc2b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,26 +1,7 @@ { - "cSpell.words": [ - "Carta", - "cartamd", - "coldark", - "dompurify", - "flexsearch", - "Gemoji", - "gruvbox", - "iconify", - "Katex", - "mdsvex", - "oldschool", - "rehype", - "shiki", - "shikijs", - "tikz", - "tikzjax", - "typeof" - ], + "cSpell.words": ["Carta", "cartamd", "Katex", "tikzjax", "tikz"], "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 deleted file mode 100644 index a45bccc..0000000 --- a/.vscode/tailwind.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "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 38235d5..3cd09a4 100644 --- a/README.md +++ b/README.md @@ -1,88 +1,42 @@ -
- - npm - - - bundle - - - license - - - docs - -
- -[![Carta.png](https://i.postimg.cc/nV6DMXKM/Carta.png)](https://beartocode.github.io/carta/) - -

Carta

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

-# Introduction +
+ npm + bundle + license + demo +
-> [!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. 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. +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-md/) 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. ## Features -- ๐ŸŒˆ 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). +- 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). -## Packages +## Getting started -| 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] +> **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: @@ -96,13 +50,15 @@ Plugins: npm i @cartamd/plugin-name ``` -## Basic configuration +### Basic configuration ```svelte - + ``` -# Documentation +Editor component exported properties: -For the full documentation, examples, guides and more checkout the [website](https://beartocode.github.io/carta/). +| 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 | -- [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) +### Plugins -# Contributing & Development +Each plugin's _readme_ includes a guide on its use. + +| Name | Description | +| -------------------------------------------------------------------------------------------------- | --------------------------------------- | +| [plugin-math](https://github.com/BearToCode/carta-md/tree/master/packages/plugin-math) | Katex support | +| [plugin-slash](https://github.com/BearToCode/carta-md/tree/master/packages/plugin-slash) | Slash commands support | +| [plugin-emoji](https://github.com/BearToCode/carta-md/tree/master/packages/plugin-emoji) | Emojis support, including inline search | +| [plugin-code](https://github.com/BearToCode/carta-md/tree/master/packages/plugin-code) | Code blocks syntax highlighting | +| [plugin-tikz](https://github.com/BearToCode/carta-md/tree/master/packages/plugin-tikz) | TikZ support using TikZJax | +| [plugin-attachment](https://github.com/BearToCode/carta-md/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-md/blob/master/packages/carta-md/src/lib/default-theme.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 Every contribution is well accepted. If you have a feature request you can open a new issue. @@ -158,12 +159,3 @@ 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/packages/plugin-anchor/.gitignore b/demo/.gitignore similarity index 95% rename from packages/plugin-anchor/.gitignore rename to demo/.gitignore index ac7211b..6635cf5 100644 --- a/packages/plugin-anchor/.gitignore +++ b/demo/.gitignore @@ -1,7 +1,6 @@ .DS_Store node_modules /build -/dist /.svelte-kit /package .env diff --git a/demo/.npmrc b/demo/.npmrc new file mode 100644 index 0000000..0c05da4 --- /dev/null +++ b/demo/.npmrc @@ -0,0 +1,2 @@ +engine-strict=true +resolution-mode=highest diff --git a/demo/package.json b/demo/package.json new file mode 100644 index 0000000..a4f1d50 --- /dev/null +++ b/demo/package.json @@ -0,0 +1,38 @@ +{ + "name": "demo", + "version": "0.0.1", + "private": true, + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/BearToCode/carta-md.git" + }, + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "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", + "@types/katex": "^0.16.0", + "svelte": "^3.54.0 || ^4.0.0", + "svelte-check": "^3.0.1", + "tslib": "^2.4.1", + "typescript": "^5.0.0", + "vite": "^4.3.9" + }, + "type": "module", + "dependencies": { + "@cartamd/plugin-code": "workspace:^", + "@cartamd/plugin-emoji": "workspace:^", + "@cartamd/plugin-math": "workspace:^", + "@cartamd/plugin-slash": "workspace:^", + "@cartamd/plugin-tikz": "workspace:^", + "carta-md": "workspace:^", + "katex": "^0.16.7" + } +} diff --git a/docs/src/app.d.ts b/demo/src/app.d.ts similarity index 100% rename from docs/src/app.d.ts rename to demo/src/app.d.ts diff --git a/packages/plugin-anchor/src/app.html b/demo/src/app.html similarity index 51% rename from packages/plugin-anchor/src/app.html rename to demo/src/app.html index f22aeaa..77d870b 100644 --- a/packages/plugin-anchor/src/app.html +++ b/demo/src/app.html @@ -1,12 +1,13 @@ - + - + + %sveltekit.head% -
%sveltekit.body%
+
%sveltekit.body%
diff --git a/demo/src/routes/+page.svelte b/demo/src/routes/+page.svelte new file mode 100644 index 0000000..b05a09c --- /dev/null +++ b/demo/src/routes/+page.svelte @@ -0,0 +1,144 @@ + + + + + + + + + + + + + +
+
+
+ Scroll + + + +
+ +
+ Editor mode + +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+ + +
+ + diff --git a/demo/src/routes/+page.ts b/demo/src/routes/+page.ts new file mode 100644 index 0000000..189f71e --- /dev/null +++ b/demo/src/routes/+page.ts @@ -0,0 +1 @@ +export const prerender = true; diff --git a/demo/src/routes/placeholder.ts b/demo/src/routes/placeholder.ts new file mode 100644 index 0000000..567dde5 --- /dev/null +++ b/demo/src/routes/placeholder.ts @@ -0,0 +1,122 @@ +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-md/) 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 new file mode 100644 index 0000000..e69de29 diff --git a/packages/plugin-anchor/static/favicon.png b/demo/static/favicon.png similarity index 100% rename from packages/plugin-anchor/static/favicon.png rename to demo/static/favicon.png diff --git a/demo/static/github-light-theme.css b/demo/static/github-light-theme.css new file mode 100644 index 0000000..45f073b --- /dev/null +++ b/demo/static/github-light-theme.css @@ -0,0 +1,1007 @@ +.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/docs/svelte.config.js b/demo/svelte.config.js similarity index 52% rename from docs/svelte.config.js rename to demo/svelte.config.js index 3f812da..9fc3ba8 100644 --- a/docs/svelte.config.js +++ b/demo/svelte.config.js @@ -1,15 +1,11 @@ -import mdsvexConfig from './mdsvex.config.js'; import adapter from '@sveltejs/adapter-static'; -import { mdsvex } from 'mdsvex'; -import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; +import { vitePreprocess } from '@sveltejs/kit/vite'; /** @type {import('@sveltejs/kit').Config} */ const config = { - extensions: ['.svelte', ...mdsvexConfig.extensions], - // Consult https://kit.svelte.dev/docs/integrations#preprocessors // for more information about preprocessors - preprocess: [vitePreprocess(), mdsvex(mdsvexConfig)], + preprocess: vitePreprocess(), kit: { adapter: adapter({ @@ -17,7 +13,7 @@ const config = { assets: 'build' }), paths: { - base: process.env.NODE_ENV === 'production' ? '/carta' : '' + base: process.env.NODE_ENV === 'production' ? '/carta-md' : '' } } }; diff --git a/docs/tsconfig.json b/demo/tsconfig.json similarity index 100% rename from docs/tsconfig.json rename to demo/tsconfig.json diff --git a/docs/vite.config.ts b/demo/vite.config.ts similarity index 100% rename from docs/vite.config.ts rename to demo/vite.config.ts diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index ac7211b..0000000 --- a/docs/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.DS_Store -node_modules -/build -/dist -/.svelte-kit -/package -.env -.env.* -!.env.example -vite.config.js.timestamp-* -vite.config.ts.timestamp-* diff --git a/docs/components.json b/docs/components.json deleted file mode 100644 index 849ec61..0000000 --- a/docs/components.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$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 deleted file mode 100644 index 93d975b..0000000 --- a/docs/mdsvex.config.js +++ /dev/null @@ -1,16 +0,0 @@ -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/docs/package.json b/docs/package.json deleted file mode 100644 index 7a24ff5..0000000 --- a/docs/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "docs", - "version": "0.0.1", - "private": true, - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/BearToCode/carta.git" - }, - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" - }, - "devDependencies": { - "@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", - "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": "^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:^", - "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 deleted file mode 100644 index 4eb987c..0000000 --- a/docs/postcss.config.cjs +++ /dev/null @@ -1,8 +0,0 @@ -const tailwindcss = require('tailwindcss'); -const autoprefixer = require('autoprefixer'); - -const config = { - plugins: [tailwindcss(), autoprefixer] -}; - -module.exports = config; diff --git a/docs/src/app.html b/docs/src/app.html deleted file mode 100644 index e9a46db..0000000 --- a/docs/src/app.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - %sveltekit.head% - - - - - - - - - -
%sveltekit.body%
- - diff --git a/docs/src/app.postcss b/docs/src/app.postcss deleted file mode 100644 index 5c9e7a3..0000000 --- a/docs/src/app.postcss +++ /dev/null @@ -1,84 +0,0 @@ -@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 deleted file mode 100644 index 8be7d1f..0000000 --- a/docs/src/lib/components/code/Code.svelte +++ /dev/null @@ -1,20 +0,0 @@ - - -
- - - -
diff --git a/docs/src/lib/components/footer/Footer.svelte b/docs/src/lib/components/footer/Footer.svelte deleted file mode 100644 index c1725e0..0000000 --- a/docs/src/lib/components/footer/Footer.svelte +++ /dev/null @@ -1,9 +0,0 @@ -
- Handmade by Davide -
diff --git a/docs/src/lib/components/header-tracker/HeaderTracker.svelte b/docs/src/lib/components/header-tracker/HeaderTracker.svelte deleted file mode 100644 index d584c97..0000000 --- a/docs/src/lib/components/header-tracker/HeaderTracker.svelte +++ /dev/null @@ -1,66 +0,0 @@ - - - { - 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 deleted file mode 100644 index 5090779..0000000 --- a/docs/src/lib/components/link/Link.svelte +++ /dev/null @@ -1,17 +0,0 @@ - - - - - diff --git a/docs/src/lib/components/link/PluginLink.svelte b/docs/src/lib/components/link/PluginLink.svelte deleted file mode 100644 index 8318e91..0000000 --- a/docs/src/lib/components/link/PluginLink.svelte +++ /dev/null @@ -1,22 +0,0 @@ - - - - - diff --git a/docs/src/lib/components/mobile-sidebar/MobileSidebar.svelte b/docs/src/lib/components/mobile-sidebar/MobileSidebar.svelte deleted file mode 100644 index 1ebb918..0000000 --- a/docs/src/lib/components/mobile-sidebar/MobileSidebar.svelte +++ /dev/null @@ -1,34 +0,0 @@ - - -
- -
- -{#if enabled} -
- -
- - -
-{/if} diff --git a/docs/src/lib/components/navbar/GitHub.svelte b/docs/src/lib/components/navbar/GitHub.svelte deleted file mode 100644 index 226d95d..0000000 --- a/docs/src/lib/components/navbar/GitHub.svelte +++ /dev/null @@ -1,33 +0,0 @@ - - - - -