From 90c0a374c2d0432cc9b0b44a5d78c79441f87d05 Mon Sep 17 00:00:00 2001
From: flooorianflo {props.content}
-//
-
-
-
-
-
-
-
-
-
- {
const content = await unified()
.use(remarkParse)
.use(remarkGfm)
.use(remarkRehype)
+ .use(remarkDirective)
+ .use(inlangRemarkDirectives)
.use(rehypeSlug)
.use(addClasses, {
"h1,h2,h3,h4,h5,h6": "font-semibold leading-relaxed my-5 cursor-pointer",
@@ -36,7 +46,40 @@ export async function convert(markdown: string): Promise
The rendering of RFCs on the website might be broken.{" "} Read the RFC on GitHub instead.
- {
+ const markdown = `
+\`\`\`mermaid
+graph TD
+A[Hard edge] -->|Link text| B(Round edge)
+B --> C{Decision}
+C -->|One| D[Result one]
+C -->|Two| E[Result two]
+\`\`\`
+ `
+ const html = await convert(markdown)
+ expect(html).toContain("
Hello, ${this.name}!
` + } +} diff --git a/inlang/source-code/markdown/tsconfig.json b/inlang/source-code/markdown/tsconfig.json index 18cd67c1db..f32a9f922d 100644 --- a/inlang/source-code/markdown/tsconfig.json +++ b/inlang/source-code/markdown/tsconfig.json @@ -2,7 +2,14 @@ "extends": "../tsconfig.base.json", "include": ["src/**/*"], "compilerOptions": { - "lib": ["ESNext"], + "lib": ["ESNext", "DOM"], + "target": "ES2019", + "module": "ES2015", + "moduleResolution": "Node", + "declaration": true, + "declarationMap": true, + "experimentalDecorators": true, + "useDefineForClassFields": false, "types": [], "outDir": "./dist", "rootDir": "./src", diff --git a/inlang/source-code/website/src/pages/documentation/index.page.tsx b/inlang/source-code/website/src/pages/documentation/index.page.tsx index 1b665fb6bb..0240161982 100644 --- a/inlang/source-code/website/src/pages/documentation/index.page.tsx +++ b/inlang/source-code/website/src/pages/documentation/index.page.tsx @@ -9,6 +9,7 @@ import { EditButton } from "./EditButton.jsx" import { defaultLanguage } from "#src/renderer/_default.page.route.js" import { useI18n } from "@solid-primitives/i18n" import "@inlang/markdown/css" +import "@inlang/markdown/custom-elements" import tableOfContents from "../../../../../documentation/tableOfContents.json" /** diff --git a/package-lock.json b/package-lock.json index 04a132fa5c..f214db2715 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19649,6 +19649,7 @@ "version": "0.0.0", "license": "Apache-2.0", "dependencies": { + "lit": "2.8.0", "rehype-accessible-emojis": "0.3.2", "rehype-add-classes": "1.0.0", "rehype-autolink-headings": "7.0.0", @@ -19672,6 +19673,57 @@ "node": ">=16.15.0" } }, + "inlang/source-code/markdown/node_modules/lit": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-2.8.0.tgz", + "integrity": "sha512-4Sc3OFX9QHOJaHbmTMk28SYgVxLN3ePDjg7hofEft2zWlehFL3LiAuapWc4U/kYwMYJSh2hTCPZ6/LIC7ii0MA==", + "dependencies": { + "@lit/reactive-element": "^1.6.0", + "lit-element": "^3.3.0", + "lit-html": "^2.8.0" + } + }, + "inlang/source-code/markdown/node_modules/lit/node_modules/@lit/reactive-element": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.6.3.tgz", + "integrity": "sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.0.0" + } + }, + "inlang/source-code/markdown/node_modules/lit/node_modules/@lit/reactive-element/node_modules/@lit-labs/ssr-dom-shim": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.1.1.tgz", + "integrity": "sha512-kXOeFbfCm4fFf2A3WwVEeQj55tMZa8c8/f9AKHMobQMkzNUfUj+antR3fRPaZJawsa1aZiP/Da3ndpZrwEe4rQ==" + }, + "inlang/source-code/markdown/node_modules/lit/node_modules/lit-element": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-3.3.3.tgz", + "integrity": "sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.1.0", + "@lit/reactive-element": "^1.3.0", + "lit-html": "^2.8.0" + } + }, + "inlang/source-code/markdown/node_modules/lit/node_modules/lit-element/node_modules/@lit-labs/ssr-dom-shim": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.1.1.tgz", + "integrity": "sha512-kXOeFbfCm4fFf2A3WwVEeQj55tMZa8c8/f9AKHMobQMkzNUfUj+antR3fRPaZJawsa1aZiP/Da3ndpZrwEe4rQ==" + }, + "inlang/source-code/markdown/node_modules/lit/node_modules/lit-html": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.8.0.tgz", + "integrity": "sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q==", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "inlang/source-code/markdown/node_modules/lit/node_modules/lit-html/node_modules/@types/trusted-types": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.4.tgz", + "integrity": "sha512-IDaobHimLQhjwsQ/NMwRVfa/yL7L/wriQPMhw1ZJall0KX6E1oxk29XMDeilW5qTIg5aoiqf5Udy8U/51aNoQQ==" + }, "inlang/source-code/markdown/node_modules/lowlight": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-3.0.0.tgz", From ef45623a03e71afa618c825a8dcdc2b59b4f09be Mon Sep 17 00:00:00 2001 From: flooorianflo${this.description}
+Hello, ${this.name}!
` - } -} From 36a6fda4a66ef5d7ab006eca1c5f09ebba528590 Mon Sep 17 00:00:00 2001 From: flooorianflo${this.description}
${this.description}