From 711dbdebc7c7eb5ae4e005c8c01ac4b02d63f1fe Mon Sep 17 00:00:00 2001 From: Saurav Panda Date: Mon, 9 Dec 2024 01:46:55 -0800 Subject: [PATCH] fix: sitemap generation and new version released --- docs/compiled/de/docs/_meta.json | 68 ++-- docs/compiled/en/docs/_meta.json | 36 +- docs/compiled/es/docs/_meta.json | 34 +- docs/compiled/fr/docs/_meta.json | 36 +- docs/package-lock.json | 338 ++++++++++++------ docs/package.json | 10 +- docs/public/sitemap.xml | 218 +++++------ docs/scripts/compile.js | 79 ++-- docs/scripts/generate-sitemap.mjs | 7 +- docs/scripts/migrations/gitbook.js | 125 +++++++ .../app/[locale]/[type]/[...slug]/page.tsx | 17 +- docs/src/app/[locale]/[type]/page.tsx | 20 +- docs/src/app/api/rewrite/route.ts | 186 ---------- docs/src/components/blocks/ArticleHeaders.tsx | 4 +- docs/src/components/blocks/AudioBlock.tsx | 224 ++++++++++-- .../src/components/blocks/BlockquoteBlock.tsx | 4 +- docs/src/components/blocks/CalloutBlock.tsx | 2 +- docs/src/components/blocks/CheckListBlock.tsx | 142 +++++++- docs/src/components/blocks/CodeBlock.tsx | 15 +- docs/src/components/blocks/FileBlock.tsx | 191 ++++++++-- docs/src/components/blocks/HeadingBlock.tsx | 4 +- docs/src/components/blocks/ImageBlock.tsx | 24 +- docs/src/components/blocks/ListBlock.tsx | 2 +- docs/src/components/blocks/ParagraphBlock.tsx | 6 +- docs/src/components/blocks/SortableBlock.tsx | 152 +++++++- docs/src/components/blocks/TableBlock.tsx | 149 +++++++- docs/src/components/blocks/VideoBlock.tsx | 232 ++++++++++-- .../src/components/editor/AIRewriteButton.tsx | 63 +++- docs/src/components/editor/AddBlockButton.tsx | 13 +- .../components/editor/BlockFormatToolbar.tsx | 126 +++++-- docs/src/components/layout/Footer.tsx | 1 + docs/src/components/layout/Navigation.tsx | 6 +- .../src/components/layout/TableOfContents.tsx | 12 +- docs/src/components/tts/TextToSpeech.tsx | 6 +- docs/src/lib/content.ts | 74 ++-- docs/src/lib/getAkiradocsConfig.ts | 3 +- docs/src/lib/headerConfig.ts | 4 +- docs/src/lib/renderers/BlockRenderer.tsx | 123 ++++++- docs/src/template.json | 3 + docs/src/types/AkiraConfigType.tsx | 31 +- docs/src/types/Block.ts | 10 +- docs/src/types/Source.tsx | 6 +- docs/src/types/env.d.ts | 20 +- .../akiradocs/scripts/generate-sitemap.mjs | 7 +- packages/create-app/package.json | 2 +- test.md | 11 - 46 files changed, 1998 insertions(+), 848 deletions(-) create mode 100644 docs/scripts/migrations/gitbook.js delete mode 100644 docs/src/app/api/rewrite/route.ts delete mode 100644 test.md diff --git a/docs/compiled/de/docs/_meta.json b/docs/compiled/de/docs/_meta.json index d6d8024..c756624 100644 --- a/docs/compiled/de/docs/_meta.json +++ b/docs/compiled/de/docs/_meta.json @@ -17,23 +17,6 @@ } } }, - "installation": { - "title": "Installation", - "items": { - "troubleshooting": { - "title": "Fehlerbehebungsanleitung", - "path": "/docs/installation/troubleshooting" - }, - "setup": { - "title": "Ausführliche Installationsanleitung", - "path": "/docs/installation/setup" - }, - "configuration": { - "title": "Konfigurationshandbuch", - "path": "/docs/installation/configuration" - } - } - }, "internationalization": { "title": "Internationalization", "items": { @@ -51,6 +34,23 @@ } } }, + "installation": { + "title": "Installation", + "items": { + "troubleshooting": { + "title": "Fehlerbehebungsanleitung", + "path": "/docs/installation/troubleshooting" + }, + "setup": { + "title": "Ausführliche Installationsanleitung", + "path": "/docs/installation/setup" + }, + "configuration": { + "title": "Konfigurationshandbuch", + "path": "/docs/installation/configuration" + } + } + }, "guides": { "title": "Guides", "items": { @@ -86,23 +86,6 @@ } } }, - "gettingStarted": { - "title": "Getting-started", - "items": { - "requirements": { - "title": "Systemanforderungen", - "path": "/docs/getting-started/requirements" - }, - "quickstart": { - "title": "Leitfaden für einen schnellen Einstieg", - "path": "/docs/getting-started/quickstart" - }, - "features": { - "title": "AkiraDocs Funktionen", - "path": "/docs/getting-started/features" - } - } - }, "contentManagement": { "title": "Content-management", "items": { @@ -120,5 +103,22 @@ "path": "/docs/api-reference/usage-guide" } } + }, + "gettingStarted": { + "title": "Getting-started", + "items": { + "requirements": { + "title": "Systemanforderungen", + "path": "/docs/getting-started/requirements" + }, + "quickstart": { + "title": "Leitfaden für einen schnellen Einstieg", + "path": "/docs/getting-started/quickstart" + }, + "features": { + "title": "AkiraDocs Funktionen", + "path": "/docs/getting-started/features" + } + } } } \ No newline at end of file diff --git a/docs/compiled/en/docs/_meta.json b/docs/compiled/en/docs/_meta.json index 05af779..258df5d 100644 --- a/docs/compiled/en/docs/_meta.json +++ b/docs/compiled/en/docs/_meta.json @@ -34,12 +34,20 @@ } } }, - "guides": { - "title": "Guides", + "installation": { + "title": "Installation", "items": { - "analytics": { - "title": "Analytics Integration", - "path": "/docs/guides/analytics" + "troubleshooting": { + "title": "Troubleshooting", + "path": "/docs/installation/troubleshooting" + }, + "setup": { + "title": "Setup", + "path": "/docs/installation/setup" + }, + "configuration": { + "title": "Configuration", + "path": "/docs/installation/configuration" } } }, @@ -60,20 +68,12 @@ } } }, - "installation": { - "title": "Installation", + "guides": { + "title": "Guides", "items": { - "troubleshooting": { - "title": "Troubleshooting", - "path": "/docs/installation/troubleshooting" - }, - "setup": { - "title": "Setup", - "path": "/docs/installation/setup" - }, - "configuration": { - "title": "Configuration", - "path": "/docs/installation/configuration" + "analytics": { + "title": "Analytics Integration", + "path": "/docs/guides/analytics" } } }, diff --git a/docs/compiled/es/docs/_meta.json b/docs/compiled/es/docs/_meta.json index e8c0b7a..f4405d9 100644 --- a/docs/compiled/es/docs/_meta.json +++ b/docs/compiled/es/docs/_meta.json @@ -51,6 +51,23 @@ } } }, + "gettingStarted": { + "title": "Getting-started", + "items": { + "requirements": { + "title": "Requisitos del sistema", + "path": "/docs/getting-started/requirements" + }, + "quickstart": { + "title": "Guía de inicio rápido", + "path": "/docs/getting-started/quickstart" + }, + "features": { + "title": "Características de AkiraDocs", + "path": "/docs/getting-started/features" + } + } + }, "guides": { "title": "Guides", "items": { @@ -103,22 +120,5 @@ "path": "/docs/api-reference/usage-guide" } } - }, - "gettingStarted": { - "title": "Getting-started", - "items": { - "requirements": { - "title": "Requisitos del sistema", - "path": "/docs/getting-started/requirements" - }, - "quickstart": { - "title": "Guía de inicio rápido", - "path": "/docs/getting-started/quickstart" - }, - "features": { - "title": "Características de AkiraDocs", - "path": "/docs/getting-started/features" - } - } } } \ No newline at end of file diff --git a/docs/compiled/fr/docs/_meta.json b/docs/compiled/fr/docs/_meta.json index 8e6baf4..90de537 100644 --- a/docs/compiled/fr/docs/_meta.json +++ b/docs/compiled/fr/docs/_meta.json @@ -77,19 +77,6 @@ } } }, - "contributing": { - "title": "Contributing", - "items": { - "howToContribute": { - "title": "Contribuer à AkiraDocs", - "path": "/docs/contributing/how-to-contribute" - }, - "codeOfConduct": { - "title": "Code de conduite", - "path": "/docs/contributing/code-of-conduct" - } - } - }, "editor": { "title": "Editor", "items": { @@ -103,12 +90,16 @@ } } }, - "apiReference": { - "title": "Api-reference", + "contributing": { + "title": "Contributing", "items": { - "usageGuide": { - "title": "Voici la traduction en français :\n\nGuide de documentation de l'API", - "path": "/docs/api-reference/usage-guide" + "howToContribute": { + "title": "Contribuer à AkiraDocs", + "path": "/docs/contributing/how-to-contribute" + }, + "codeOfConduct": { + "title": "Code de conduite", + "path": "/docs/contributing/code-of-conduct" } } }, @@ -120,5 +111,14 @@ "path": "/docs/content-management/creating-pages" } } + }, + "apiReference": { + "title": "Api-reference", + "items": { + "usageGuide": { + "title": "Voici la traduction en français :\n\nGuide de documentation de l'API", + "path": "/docs/api-reference/usage-guide" + } + } } } \ No newline at end of file diff --git a/docs/package-lock.json b/docs/package-lock.json index 276555a..6c35ef4 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -1,14 +1,14 @@ { "name": "akiradocs", - "version": "1.0.1", + "version": "1.0.44", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "akiradocs", - "version": "1.0.1", + "version": "1.0.44", "dependencies": { - "@anthropic-ai/sdk": "^0.17.1", + "@ai-sdk/anthropic": "^1.0.1", "@dnd-kit/core": "^6.1.0", "@dnd-kit/sortable": "^8.0.0", "@dnd-kit/utilities": "^3.2.2", @@ -529,6 +529,7 @@ }, "node_modules/@clack/prompts/node_modules/is-unicode-supported": { "version": "1.3.0", + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -691,95 +692,10 @@ "node": ">=12" } }, - "node_modules/@floating-ui/core": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.8.tgz", - "integrity": "sha512-7XJ9cPU+yI2QeLS+FCSlqNFZJq8arvswefkZrYI1yQBbftw6FyrZOxYSh+9S7z7TpeWlRt9zJ5IhM1WIL334jA==", - "dependencies": { - "@floating-ui/utils": "^0.2.8" - } - }, - "node_modules/@floating-ui/dom": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.12.tgz", - "integrity": "sha512-NP83c0HjokcGVEMeoStg317VD9W7eDlGK7457dMBANbKA6GJZdc7rjujdgqzTaz93jkGgc5P/jeWbaCHnMNc+w==", - "dependencies": { - "@floating-ui/core": "^1.6.0", - "@floating-ui/utils": "^0.2.8" - } - }, - "node_modules/@floating-ui/react-dom": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.2.tgz", - "integrity": "sha512-06okr5cgPzMNBy+Ycse2A6udMi4bqwW/zgBF/rwjcNqWkyr82Mcg8b0vjX8OJpZFy/FKjJmw6wV7t44kK6kW7A==", - "dependencies": { - "@floating-ui/dom": "^1.0.0" - }, - "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" - } - }, - "node_modules/@floating-ui/utils": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.8.tgz", - "integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==" - }, - "node_modules/@google/generative-ai": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@google/generative-ai/-/generative-ai-0.2.1.tgz", - "integrity": "sha512-gNmMFadfwi7qf/6M9gImgyGJXY1jKQ/de8vGOqgJ0PPYgQ7WwzZDavbKrIuXS2zdqZZaYtxW3EFN6aG9x5wtFw==", - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@heroicons/react": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@heroicons/react/-/react-2.1.5.tgz", - "integrity": "sha512-FuzFN+BsHa+7OxbvAERtgBTNeZpUjgM/MIizfVkSCL2/edriN0Hx/DWRCR//aPYwO5QX/YlgLGXk+E3PcfZwjA==", - "peerDependencies": { - "react": ">= 16" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", - "deprecated": "Use @eslint/config-array instead", - "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", - "dev": true - }, - "node_modules/@img/sharp-darwin-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", - "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "node_modules/@esbuild/darwin-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", "cpu": [ "arm64" ], @@ -1173,6 +1089,15 @@ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.8.tgz", "integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==" }, + "node_modules/@google/generative-ai": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@google/generative-ai/-/generative-ai-0.2.1.tgz", + "integrity": "sha512-gNmMFadfwi7qf/6M9gImgyGJXY1jKQ/de8vGOqgJ0PPYgQ7WwzZDavbKrIuXS2zdqZZaYtxW3EFN6aG9x5wtFw==", + "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@heroicons/react": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@heroicons/react/-/react-2.1.5.tgz", @@ -3434,11 +3359,20 @@ "version": "20.17.6", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.6.tgz", "integrity": "sha512-VEI7OdvK2wP7XHnsuXbAJnEpEkF6NjSN45QJlL4VGqZSXsnicpesdTWsg9RISeSdYd3yeRj/y3k5KGjUXYnFwQ==", - "devOptional": true, "dependencies": { "undici-types": "~6.19.2" } }, + "node_modules/@types/node-fetch": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, "node_modules/@types/prop-types": { "version": "15.7.13", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.13.tgz", @@ -3698,6 +3632,18 @@ "integrity": "sha512-b5o1I6aLNeYlU/3CPlj/Z91ybk1gUsKT+5NAJI+2W4UjvS5KLG28K9v5UvNoFVjHV8PajVZ00RH3vnjyQO7ZAw==", "license": "MIT" }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, "node_modules/acorn": { "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", @@ -3729,6 +3675,18 @@ "node": ">=0.4.0" } }, + "node_modules/agentkeepalive": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", + "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, "node_modules/ai": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/ai/-/ai-4.0.2.tgz", @@ -4050,6 +4008,12 @@ "astring": "bin/astring" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -4384,14 +4348,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/charenc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", - "engines": { - "node": "*" - } - }, "node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -4602,6 +4558,18 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/comma-separated-tokens": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", @@ -4870,6 +4838,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -5817,6 +5794,15 @@ "node": ">=0.10.0" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/eventsource-parser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.0.tgz", @@ -6040,6 +6026,26 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data-encoder": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", + "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==", + "license": "MIT" + }, "node_modules/format": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", @@ -6048,6 +6054,19 @@ "node": ">=0.4.x" } }, + "node_modules/formdata-node": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", + "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "license": "MIT", + "dependencies": { + "node-domexception": "1.0.0", + "web-streams-polyfill": "4.0.0-beta.3" + }, + "engines": { + "node": ">= 12.20" + } + }, "node_modules/framer-motion": { "version": "11.11.15", "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.11.15.tgz", @@ -6625,6 +6644,15 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -6818,11 +6846,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, "node_modules/is-bun-module": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.2.1.tgz", @@ -7601,16 +7624,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/md5": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", - "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", - "dependencies": { - "charenc": "0.0.2", - "crypt": "0.0.2", - "is-buffer": "~1.1.6" - } - }, "node_modules/mdast-util-from-markdown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz", @@ -8362,6 +8375,27 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -8523,6 +8557,25 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -8684,6 +8737,47 @@ "wrappy": "1" } }, + "node_modules/openai": { + "version": "4.76.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.76.0.tgz", + "integrity": "sha512-QBGIetjX1C9xDp5XGa/3mPnfKI9BgAe2xHQX6PmO98wuW9qQaurBaumcYptQWc9LHZZq7cH/Y1Rjnsr6uUDdVw==", + "license": "Apache-2.0", + "dependencies": { + "@types/node": "^18.11.18", + "@types/node-fetch": "^2.6.4", + "abort-controller": "^3.0.0", + "agentkeepalive": "^4.2.1", + "form-data-encoder": "1.7.2", + "formdata-node": "^4.3.2", + "node-fetch": "^2.6.7" + }, + "bin": { + "openai": "bin/cli" + }, + "peerDependencies": { + "zod": "^3.23.8" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + } + } + }, + "node_modules/openai/node_modules/@types/node": { + "version": "18.19.67", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.67.tgz", + "integrity": "sha512-wI8uHusga+0ZugNp0Ol/3BqQfEcCCNfojtO6Oou9iVNGPTL6QNSdnUdqq85fRgIorLhLMuPIKpsN98QE9Nh+KQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/openai/node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "license": "MIT" + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -10973,8 +11067,7 @@ "node_modules/undici-types": { "version": "6.19.8", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "devOptional": true + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" }, "node_modules/unified": { "version": "11.0.5", @@ -11256,6 +11349,15 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/web-streams-polyfill": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", + "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", diff --git a/docs/package.json b/docs/package.json index e5e7901..6d2f6b1 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "akiradocs", - "version": "1.0.38", + "version": "1.0.44", "private": true, "scripts": { "translate": "npm run compile && node scripts/translate.js", @@ -9,13 +9,15 @@ "dev": "npm run compile && set NEXT_PUBLIC_AKIRADOCS_EDIT_MODE=true && next dev", "build": "npm run compile && npm run generate-sitemap && set NEXT_PUBLIC_AKIRADOCS_EDIT_MODE=false && next build", "start": "set NEXT_PUBLIC_AKIRADOCS_EDIT_MODE=false && next start", - "lint": "next lint" + "lint": "next lint", + "migrate-gitbook": "node scripts/migrations/gitbook.js" }, "dependencies": { "@ai-sdk/anthropic": "^1.0.1", "@dnd-kit/core": "^6.1.0", "@dnd-kit/sortable": "^8.0.0", "@dnd-kit/utilities": "^3.2.2", + "@google/generative-ai": "^0.2.1", "@heroicons/react": "^2.1.5", "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", @@ -62,9 +64,7 @@ "sonner": "^1.7.0", "styled-components": "^6.1.13", "tailwind-merge": "^2.5.4", - "tailwindcss-animate": "^1.0.7", - "@anthropic-ai/sdk": "^0.17.1", - "@google/generative-ai": "^0.2.1" + "tailwindcss-animate": "^1.0.7" }, "devDependencies": { "@tailwindcss/typography": "^0.5.15", diff --git a/docs/public/sitemap.xml b/docs/public/sitemap.xml index 49ab952..d0f5e6d 100644 --- a/docs/public/sitemap.xml +++ b/docs/public/sitemap.xml @@ -2,439 +2,439 @@ - https://your-domain.com/fr/docs/introduction + https://docs.akiradocs.com/fr/docs/introduction - https://your-domain.com/fr/docs/_meta + https://docs.akiradocs.com/fr/docs/_meta - https://your-domain.com/fr/docs/seo-and-performance/sitemap-generation + https://docs.akiradocs.com/fr/docs/seo-and-performance/sitemap-generation - https://your-domain.com/fr/docs/seo-and-performance/robot-txt + https://docs.akiradocs.com/fr/docs/seo-and-performance/robot-txt - https://your-domain.com/fr/docs/internationalization/setup + https://docs.akiradocs.com/fr/docs/internationalization/setup - https://your-domain.com/fr/docs/internationalization/managing-translation + https://docs.akiradocs.com/fr/docs/internationalization/managing-translation - https://your-domain.com/fr/docs/internationalization/ai-translation + https://docs.akiradocs.com/fr/docs/internationalization/ai-translation - https://your-domain.com/fr/docs/installation/troubleshooting + https://docs.akiradocs.com/fr/docs/installation/troubleshooting - https://your-domain.com/fr/docs/installation/setup + https://docs.akiradocs.com/fr/docs/installation/setup - https://your-domain.com/fr/docs/installation/configuration + https://docs.akiradocs.com/fr/docs/installation/configuration - https://your-domain.com/fr/docs/guides/analytics + https://docs.akiradocs.com/fr/docs/guides/analytics - https://your-domain.com/fr/docs/getting-started/requirements + https://docs.akiradocs.com/fr/docs/getting-started/requirements - https://your-domain.com/fr/docs/getting-started/quickstart + https://docs.akiradocs.com/fr/docs/getting-started/quickstart - https://your-domain.com/fr/docs/getting-started/features + https://docs.akiradocs.com/fr/docs/getting-started/features - https://your-domain.com/fr/docs/editor/overview + https://docs.akiradocs.com/fr/docs/editor/overview - https://your-domain.com/fr/docs/editor/features + https://docs.akiradocs.com/fr/docs/editor/features - https://your-domain.com/fr/docs/contributing/how-to-contribute + https://docs.akiradocs.com/fr/docs/contributing/how-to-contribute - https://your-domain.com/fr/docs/contributing/code-of-conduct + https://docs.akiradocs.com/fr/docs/contributing/code-of-conduct - https://your-domain.com/fr/docs/content-management/creating-pages + https://docs.akiradocs.com/fr/docs/content-management/creating-pages - https://your-domain.com/fr/docs/api-reference/usage-guide + https://docs.akiradocs.com/fr/docs/api-reference/usage-guide - https://your-domain.com/fr/articles/welcome + https://docs.akiradocs.com/fr/articles/welcome - https://your-domain.com/fr/articles/template + https://docs.akiradocs.com/fr/articles/template - https://your-domain.com/fr/articles/ai_integration + https://docs.akiradocs.com/fr/articles/ai_integration - https://your-domain.com/fr/articles/_meta + https://docs.akiradocs.com/fr/articles/_meta - https://your-domain.com/fr/api/apiSpec + https://docs.akiradocs.com/fr/api/apiSpec - https://your-domain.com/es/docs/introduction + https://docs.akiradocs.com/es/docs/introduction - https://your-domain.com/es/docs/_meta + https://docs.akiradocs.com/es/docs/_meta - https://your-domain.com/es/docs/seo-and-performance/sitemap-generation + https://docs.akiradocs.com/es/docs/seo-and-performance/sitemap-generation - https://your-domain.com/es/docs/seo-and-performance/robot-txt + https://docs.akiradocs.com/es/docs/seo-and-performance/robot-txt - https://your-domain.com/es/docs/internationalization/setup + https://docs.akiradocs.com/es/docs/internationalization/setup - https://your-domain.com/es/docs/internationalization/managing-translation + https://docs.akiradocs.com/es/docs/internationalization/managing-translation - https://your-domain.com/es/docs/internationalization/ai-translation + https://docs.akiradocs.com/es/docs/internationalization/ai-translation - https://your-domain.com/es/docs/installation/troubleshooting + https://docs.akiradocs.com/es/docs/installation/troubleshooting - https://your-domain.com/es/docs/installation/setup + https://docs.akiradocs.com/es/docs/installation/setup - https://your-domain.com/es/docs/installation/configuration + https://docs.akiradocs.com/es/docs/installation/configuration - https://your-domain.com/es/docs/guides/analytics + https://docs.akiradocs.com/es/docs/guides/analytics - https://your-domain.com/es/docs/getting-started/requirements + https://docs.akiradocs.com/es/docs/getting-started/requirements - https://your-domain.com/es/docs/getting-started/quickstart + https://docs.akiradocs.com/es/docs/getting-started/quickstart - https://your-domain.com/es/docs/getting-started/features + https://docs.akiradocs.com/es/docs/getting-started/features - https://your-domain.com/es/docs/editor/overview + https://docs.akiradocs.com/es/docs/editor/overview - https://your-domain.com/es/docs/editor/features + https://docs.akiradocs.com/es/docs/editor/features - https://your-domain.com/es/docs/contributing/how-to-contribute + https://docs.akiradocs.com/es/docs/contributing/how-to-contribute - https://your-domain.com/es/docs/contributing/code-of-conduct + https://docs.akiradocs.com/es/docs/contributing/code-of-conduct - https://your-domain.com/es/docs/content-management/creating-pages + https://docs.akiradocs.com/es/docs/content-management/creating-pages - https://your-domain.com/es/docs/api-reference/usage-guide + https://docs.akiradocs.com/es/docs/api-reference/usage-guide - https://your-domain.com/es/articles/welcome + https://docs.akiradocs.com/es/articles/welcome - https://your-domain.com/es/articles/template + https://docs.akiradocs.com/es/articles/template - https://your-domain.com/es/articles/ai_integration + https://docs.akiradocs.com/es/articles/ai_integration - https://your-domain.com/es/articles/_meta + https://docs.akiradocs.com/es/articles/_meta - https://your-domain.com/es/api/apiSpec + https://docs.akiradocs.com/es/api/apiSpec - https://your-domain.com/en/docs/introduction + https://docs.akiradocs.com/en/docs/introduction - https://your-domain.com/en/docs/_meta + https://docs.akiradocs.com/en/docs/_meta - https://your-domain.com/en/docs/seo-and-performance/sitemap-generation + https://docs.akiradocs.com/en/docs/seo-and-performance/sitemap-generation - https://your-domain.com/en/docs/seo-and-performance/robot-txt + https://docs.akiradocs.com/en/docs/seo-and-performance/robot-txt - https://your-domain.com/en/docs/seo-and-performance/_meta + https://docs.akiradocs.com/en/docs/seo-and-performance/_meta - https://your-domain.com/en/docs/internationalization/setup + https://docs.akiradocs.com/en/docs/internationalization/setup - https://your-domain.com/en/docs/internationalization/managing-translation + https://docs.akiradocs.com/en/docs/internationalization/managing-translation - https://your-domain.com/en/docs/internationalization/ai-translation + https://docs.akiradocs.com/en/docs/internationalization/ai-translation - https://your-domain.com/en/docs/internationalization/_meta + https://docs.akiradocs.com/en/docs/internationalization/_meta - https://your-domain.com/en/docs/installation/troubleshooting + https://docs.akiradocs.com/en/docs/installation/troubleshooting - https://your-domain.com/en/docs/installation/setup + https://docs.akiradocs.com/en/docs/installation/setup - https://your-domain.com/en/docs/installation/configuration + https://docs.akiradocs.com/en/docs/installation/configuration - https://your-domain.com/en/docs/installation/_meta + https://docs.akiradocs.com/en/docs/installation/_meta - https://your-domain.com/en/docs/guides/analytics + https://docs.akiradocs.com/en/docs/guides/analytics - https://your-domain.com/en/docs/guides/_meta + https://docs.akiradocs.com/en/docs/guides/_meta - https://your-domain.com/en/docs/getting-started/requirements + https://docs.akiradocs.com/en/docs/getting-started/requirements - https://your-domain.com/en/docs/getting-started/quickstart + https://docs.akiradocs.com/en/docs/getting-started/quickstart - https://your-domain.com/en/docs/getting-started/features + https://docs.akiradocs.com/en/docs/getting-started/features - https://your-domain.com/en/docs/getting-started/_meta + https://docs.akiradocs.com/en/docs/getting-started/_meta - https://your-domain.com/en/docs/editor/overview + https://docs.akiradocs.com/en/docs/editor/overview - https://your-domain.com/en/docs/editor/features + https://docs.akiradocs.com/en/docs/editor/features - https://your-domain.com/en/docs/editor/_meta + https://docs.akiradocs.com/en/docs/editor/_meta - https://your-domain.com/en/docs/contributing/how-to-contribute + https://docs.akiradocs.com/en/docs/contributing/how-to-contribute - https://your-domain.com/en/docs/contributing/code-of-conduct + https://docs.akiradocs.com/en/docs/contributing/code-of-conduct - https://your-domain.com/en/docs/contributing/_meta + https://docs.akiradocs.com/en/docs/contributing/_meta - https://your-domain.com/en/docs/content-management/creating-pages + https://docs.akiradocs.com/en/docs/content-management/creating-pages - https://your-domain.com/en/docs/content-management/_meta + https://docs.akiradocs.com/en/docs/content-management/_meta - https://your-domain.com/en/docs/api-reference/usage-guide + https://docs.akiradocs.com/en/docs/api-reference/usage-guide - https://your-domain.com/en/docs/api-reference/_meta + https://docs.akiradocs.com/en/docs/api-reference/_meta - https://your-domain.com/en/articles/welcome + https://docs.akiradocs.com/en/articles/welcome - https://your-domain.com/en/articles/template + https://docs.akiradocs.com/en/articles/template - https://your-domain.com/en/articles/ai_integration + https://docs.akiradocs.com/en/articles/ai_integration - https://your-domain.com/en/articles/_meta + https://docs.akiradocs.com/en/articles/_meta - https://your-domain.com/en/api/apiSpec + https://docs.akiradocs.com/en/api/apiSpec - https://your-domain.com/de/docs/introduction + https://docs.akiradocs.com/de/docs/introduction - https://your-domain.com/de/docs/_meta + https://docs.akiradocs.com/de/docs/_meta - https://your-domain.com/de/docs/seo-and-performance/sitemap-generation + https://docs.akiradocs.com/de/docs/seo-and-performance/sitemap-generation - https://your-domain.com/de/docs/seo-and-performance/robot-txt + https://docs.akiradocs.com/de/docs/seo-and-performance/robot-txt - https://your-domain.com/de/docs/internationalization/setup + https://docs.akiradocs.com/de/docs/internationalization/setup - https://your-domain.com/de/docs/internationalization/managing-translation + https://docs.akiradocs.com/de/docs/internationalization/managing-translation - https://your-domain.com/de/docs/internationalization/ai-translation + https://docs.akiradocs.com/de/docs/internationalization/ai-translation - https://your-domain.com/de/docs/installation/troubleshooting + https://docs.akiradocs.com/de/docs/installation/troubleshooting - https://your-domain.com/de/docs/installation/setup + https://docs.akiradocs.com/de/docs/installation/setup - https://your-domain.com/de/docs/installation/configuration + https://docs.akiradocs.com/de/docs/installation/configuration - https://your-domain.com/de/docs/guides/analytics + https://docs.akiradocs.com/de/docs/guides/analytics - https://your-domain.com/de/docs/getting-started/requirements + https://docs.akiradocs.com/de/docs/getting-started/requirements - https://your-domain.com/de/docs/getting-started/quickstart + https://docs.akiradocs.com/de/docs/getting-started/quickstart - https://your-domain.com/de/docs/getting-started/features + https://docs.akiradocs.com/de/docs/getting-started/features - https://your-domain.com/de/docs/editor/overview + https://docs.akiradocs.com/de/docs/editor/overview - https://your-domain.com/de/docs/editor/features + https://docs.akiradocs.com/de/docs/editor/features - https://your-domain.com/de/docs/contributing/how-to-contribute + https://docs.akiradocs.com/de/docs/contributing/how-to-contribute - https://your-domain.com/de/docs/contributing/code-of-conduct + https://docs.akiradocs.com/de/docs/contributing/code-of-conduct - https://your-domain.com/de/docs/content-management/creating-pages + https://docs.akiradocs.com/de/docs/content-management/creating-pages - https://your-domain.com/de/docs/api-reference/usage-guide + https://docs.akiradocs.com/de/docs/api-reference/usage-guide - https://your-domain.com/de/articles/welcome + https://docs.akiradocs.com/de/articles/welcome - https://your-domain.com/de/articles/template + https://docs.akiradocs.com/de/articles/template - https://your-domain.com/de/articles/ai_integration + https://docs.akiradocs.com/de/articles/ai_integration - https://your-domain.com/de/articles/_meta + https://docs.akiradocs.com/de/articles/_meta - https://your-domain.com/de/api/apiSpec + https://docs.akiradocs.com/de/api/apiSpec \ No newline at end of file diff --git a/docs/scripts/compile.js b/docs/scripts/compile.js index cc06ce8..7d79527 100644 --- a/docs/scripts/compile.js +++ b/docs/scripts/compile.js @@ -39,21 +39,31 @@ async function convertMarkdownToBlocks(content) { listItems.push(processedLine); if (i === lines.length - 1 || !lines[i + 1].trim().startsWith('-')) { - if (listItems.length > 0) { - blocks.push({ - id: String(blockId++), - type: 'list', - content: listItems, - metadata: { - listType: 'unordered' - } - }); - listItems = []; - } + blocks.push({ + id: String(blockId++), + type: 'list', + content: listItems, + metadata: { + listType: 'unordered' + } + }); + listItems = []; } continue; } + if (listItems.length > 0) { + blocks.push({ + id: String(blockId++), + type: 'list', + content: listItems, + metadata: { + listType: 'unordered' + } + }); + listItems = []; + } + if (line.startsWith('```')) { if (currentBlock.length > 0) { blocks.push({ @@ -85,11 +95,32 @@ async function convertMarkdownToBlocks(content) { continue; } + if (line.trim() === '***') { + if (currentBlock.length > 0) { + blocks.push({ + id: String(blockId++), + type: 'paragraph', + content: currentBlock.join('\n').trim() + }); + currentBlock = []; + } + + blocks.push({ + id: String(blockId++), + type: 'divider', + content: '' + }); + continue; + } + if (line.startsWith('#')) { if (!firstHeadingFound) { const match = line.match(/^#+\s*(.*)/); if (match) { title = match[1].trim(); + if (title.includes('**')) { + title = `${title.replace(/\*\*/g, '')}`; + } firstHeadingFound = true; skipNextLine = true; continue; @@ -109,10 +140,16 @@ async function convertMarkdownToBlocks(content) { if (!match) continue; const level = match[0].length; + let content = line.slice(level).trim(); + + if (content.includes('**')) { + content = `${content.replace(/\*\*/g, '')}`; + } + blocks.push({ id: String(blockId++), type: 'heading', - content: line.slice(level).trim(), + content: content, metadata: { level } }); @@ -205,12 +242,15 @@ async function updateMetaFile(folderPath, newFile) { .split('_') .map(word => word.charAt(0).toUpperCase() + word.slice(1)) .join(' '); + + const pathWithoutLang = relativePath.split(path.sep).slice(1).join(path.sep); meta[fileName] = { title: compiledContent.title || humanReadableFileName, - path: path.join('/', relativePath, fileName) + path: path.join('/', pathWithoutLang, fileName) }; } else { - meta[fileName].path = path.join('/', relativePath, fileName); + const pathWithoutLang = relativePath.split(path.sep).slice(1).join(path.sep); + meta[fileName].path = path.join('/', pathWithoutLang, fileName); } await writeFile(metaPath, JSON.stringify(meta, null, 2)); @@ -244,7 +284,7 @@ async function compileMarkdownFiles() { await mkdir(path.dirname(compiledPath), { recursive: true }); await writeFile(compiledPath, JSON.stringify(compiledContent, null, 2)); - await updateMetaFile(path.dirname(compiledPath), compiledPath); + // await updateMetaFile(path.dirname(compiledPath), compiledPath); console.log(`Compiled ${file} -> ${compiledPath}`); } @@ -278,7 +318,7 @@ async function createMetaFilesForAllFolders() { const jsonFiles = await glob('**/*.json', { cwd: sectionPath, - ignore: '**/_meta.json' + ignore: ['**/_meta.json'] }); const meta = { @@ -289,7 +329,7 @@ async function createMetaFilesForAllFolders() { const fileName = path.basename(jsonFile, '.json'); const filePath = path.join(sectionPath, jsonFile); const content = JSON.parse(await readFile(filePath, 'utf-8')); - const dirs = path.dirname(jsonFile).split('/').filter(d => d !== '.'); + const dirs = path.dirname(jsonFile).split(path.sep).filter(d => d !== '.'); const fileKey = fileName.replace(/-/g, ' ') .split(' ') @@ -334,9 +374,8 @@ async function createMetaFilesForAllFolders() { }; } - const metaDataPath = path.join(sectionPath, '_meta.json'); - await writeFile(metaDataPath, JSON.stringify(meta, null, 2)); - console.log(`Created meta file: ${metaDataPath}`); + await writeFile(metaPath, JSON.stringify(meta, null, 2)); + console.log(`Created/Updated meta file: ${metaPath}`); } } } catch (error) { diff --git a/docs/scripts/generate-sitemap.mjs b/docs/scripts/generate-sitemap.mjs index 926f747..71db30a 100644 --- a/docs/scripts/generate-sitemap.mjs +++ b/docs/scripts/generate-sitemap.mjs @@ -1,9 +1,10 @@ // Basic sitemap generator example -import { writeFileSync } from 'fs'; +import { writeFileSync, readFileSync } from 'fs'; import { globSync } from 'glob'; -import path from 'path'; -const BASE_URL = 'https://your-domain.com'; // Replace with your actual domain +// Read config file and parse JSON +const config = JSON.parse(readFileSync('./akiradocs.config.json', 'utf8')); +const BASE_URL = config.site.url; // Get URL from config const pages = globSync('compiled/**/*.json') .map(file => { diff --git a/docs/scripts/migrations/gitbook.js b/docs/scripts/migrations/gitbook.js new file mode 100644 index 0000000..647b024 --- /dev/null +++ b/docs/scripts/migrations/gitbook.js @@ -0,0 +1,125 @@ +const { readFile, writeFile, mkdir } = require('fs/promises'); +const { glob } = require('glob'); +const matter = require('gray-matter'); +const path = require('path'); +const yargs = require('yargs/yargs'); +const { hideBin } = require('yargs/helpers'); + +function processGitbookContent(content) { + // Remove Gitbook-specific content references + content = content.replace(/{% content-ref url="(.*?)" %}[\s\S]*?{% endcontent-ref %}/g, ''); + + // Convert Gitbook links to standard markdown links + content = content.replace(/\[(.*?)\]\((.*?)\.md\)/g, (match, text, url) => { + // Remove .md extension and convert to relative path + const cleanUrl = url.replace(/\.md$/, ''); + return `[${text}](${cleanUrl})`; + }); + + return content; +} + +async function migrateGitbookContent(options) { + const { + inputDir, + outputDir = '_contents', + language = 'en', + defaultAuthor = 'Anonymous' + } = options; + + try { + const files = await glob(`${inputDir}/**/*.md`, { cwd: process.cwd() }); + + if (files.length === 0) { + console.warn(`No markdown files found in ${inputDir}`); + return; + } + + console.log(`Found ${files.length} files to migrate...`); + + for (const file of files) { + const content = await readFile(file, 'utf-8'); + const { data: frontmatter, content: markdownContent } = matter(content); + + const processedContent = processGitbookContent(markdownContent); + + const newFrontmatter = { + title: frontmatter.title || '', + description: frontmatter.description || '', + author: frontmatter.author || defaultAuthor, + publishDate: frontmatter.publishDate || new Date().toISOString().split('T')[0], + modifiedDate: frontmatter.modifiedDate || new Date().toISOString().split('T')[0], + category: frontmatter.category || '', + keywords: frontmatter.keywords || [] + }; + + const newContent = matter.stringify(processedContent, newFrontmatter); + + const newPath = file + .replace(new RegExp(`^${inputDir}`), path.join(outputDir, language, 'docs')) + .replace(/SUMMARY\.md$/i, 'index.md'); + + await mkdir(path.dirname(newPath), { recursive: true }); + await writeFile(newPath, newContent); + + console.log(`Migrated ${file} -> ${newPath}`); + } + } catch (error) { + console.error('Error migrating Gitbook content:', error); + process.exit(1); + } +} + +async function main() { + const argv = yargs(hideBin(process.argv)) + .usage('Usage: $0 [options]') + .positional('input-dir', { + describe: 'Input directory containing Gitbook markdown files', + type: 'string' + }) + .option('output-dir', { + alias: 'o', + type: 'string', + description: 'Output directory for processed files', + default: '_contents' + }) + .option('language', { + alias: 'l', + type: 'string', + description: 'Language code for the content', + default: 'en' + }) + .option('author', { + alias: 'a', + type: 'string', + description: 'Default author name for content without authors', + default: 'Anonymous' + }) + .demandCommand(1, 'Please specify an input directory') + .help() + .argv; + + // Clean up input directory path by removing trailing slashes + const inputDir = argv._[0].replace(/\/+$/, ''); + + if (!inputDir) { + console.error('Input directory is required'); + process.exit(1); + } + + await migrateGitbookContent({ + inputDir, + outputDir: argv.outputDir, + language: argv.language, + defaultAuthor: argv.author + }); +} + +module.exports = { + main, + migrateGitbookContent +}; + +if (require.main === module) { + main(); +} diff --git a/docs/src/app/[locale]/[type]/[...slug]/page.tsx b/docs/src/app/[locale]/[type]/[...slug]/page.tsx index 3669a6f..db4fce9 100644 --- a/docs/src/app/[locale]/[type]/[...slug]/page.tsx +++ b/docs/src/app/[locale]/[type]/[...slug]/page.tsx @@ -13,7 +13,7 @@ import { PageNavigation } from '@/components/layout/PageNavigation' import { MainTitle, SubTitle } from '@/components/blocks/HeadingBlock' import { SEO } from '@/components/layout/SEO' import { NotFound } from '@/components/layout/NotFound' -// import { TextToSpeech } from '@/components/tts/TextToSpeech' +import { TextToSpeech } from '@/components/tts/TextToSpeech' import { getAkiradocsConfig } from "@/lib/getAkiradocsConfig"; import { getTranslation } from '@/lib/staticTranslation'; import { ClientSideControls } from '@/components/layout/ClientSideControl'; @@ -99,7 +99,6 @@ export default async function ContentPage({ params }: Props) { if (!post) { return ; } - const akiradocsConfig = getAkiradocsConfig(); const headerConfig = getHeaderConfig(); const footerConfig = getFooterConfig(); @@ -135,17 +134,19 @@ export default async function ContentPage({ params }: Props) { {t(post.title)} {t(post.description)} - {post.blocks.map((block) => ( - block.content !== post.title && ( +
+ {post.blocks.map((block) => ( + block.content !== post.title && ( - ) - ))} + }} + /> + ) + ))} +
diff --git a/docs/src/app/[locale]/[type]/page.tsx b/docs/src/app/[locale]/[type]/page.tsx index c56bd67..1b964cc 100644 --- a/docs/src/app/[locale]/[type]/page.tsx +++ b/docs/src/app/[locale]/[type]/page.tsx @@ -1,7 +1,9 @@ import { Metadata } from 'next' import { redirect } from 'next/navigation' -import { getAllPosts, getRecentContent } from '@/lib/content' +import { getRecentContent } from '@/lib/content' import { getHeaderConfig } from '@/lib/headerConfig' +import { getAkiradocsConfig } from '@/lib/getAkiradocsConfig' +import { Locale } from '@/types/AkiraConfigType' type Props = { params: Promise<{ @@ -13,7 +15,8 @@ type Props = { export const dynamic = 'force-static'; export async function generateStaticParams() { - const locales = ['en', 'es', 'fr']; + const akiraconfig = await getAkiradocsConfig(); + const locales = akiraconfig.localization.locales.map((locale: Locale) => locale.code); const types = ['docs', 'api', 'articles']; const params: { locale: string, type: string }[] = []; @@ -30,17 +33,18 @@ export async function generateMetadata({ params }: Props): Promise { const resolvedParams = await Promise.resolve(params); const { locale, type } = resolvedParams; const headerConfig = getHeaderConfig(); - + const akiraconfig = await getAkiradocsConfig(); return { title: `${type.charAt(0).toUpperCase() + type.slice(1)} - ${headerConfig.title}`, description: `Browse our latest ${type}`, alternates: { canonical: `${process.env.NEXT_PUBLIC_SITE_URL}/${locale}/${type}`, - languages: { - 'en': `${process.env.NEXT_PUBLIC_SITE_URL}/en/${type}`, - 'es': `${process.env.NEXT_PUBLIC_SITE_URL}/es/${type}`, - 'fr': `${process.env.NEXT_PUBLIC_SITE_URL}/fr/${type}`, - } + languages: Object.fromEntries( + akiraconfig.localization.locales.map((locale: Locale) => [ + locale.code, + `${process.env.NEXT_PUBLIC_SITE_URL}/${locale.code}/${type}` + ]) + ) } } } diff --git a/docs/src/app/api/rewrite/route.ts b/docs/src/app/api/rewrite/route.ts deleted file mode 100644 index a0ceae7..0000000 --- a/docs/src/app/api/rewrite/route.ts +++ /dev/null @@ -1,186 +0,0 @@ -import { NextResponse } from 'next/server'; -import OpenAI from 'openai'; -import Anthropic from '@anthropic-ai/sdk'; -import { GoogleGenerativeAI } from '@google/generative-ai'; -import { getAkiradocsConfig } from '@/lib/getAkiradocsConfig'; -import { validateConfig, getProviderConfig, isAzureProvider } from '@/lib/AIConfig'; -import type { SupportedProvider } from '@/types/AkiraConfigType'; - -// Define block-specific system prompts -const blockPrompts = { - paragraph: { - system: "You are an expert content editor. Maintain paragraph structure and formatting. Output only the rewritten paragraph text without any markdown or HTML.", - format: "Plain text paragraph" - }, - heading: { - system: "You are a headline optimization expert. Create impactful, concise headings. Output only the heading text without any formatting.", - format: "Single line heading text" - }, - code: { - system: "You are an expert code optimizer. Maintain the exact programming language syntax and structure. Output only valid code without any explanations.", - format: "Valid code in the original language" - }, - list: { - system: "You are a list organization expert. Maintain the list structure with one item per line. Do not include bullets or numbers.", - format: "One item per line, no bullets/numbers" - }, - blockquote: { - system: "You are a quote refinement expert. Maintain the quote's core message and emotional impact. Output only the quote text.", - format: "Single quote text without quotation marks" - }, - callout: { - system: "You are a technical documentation expert. Maintain the callout's type (info/warning/success/error) and structure. Output only the callout content.", - format: "Callout content preserving type indicators" - }, - image: { - system: "You are an image description expert. Optimize image alt text and captions. Output in JSON format with alt and caption fields.", - format: '{ "alt": "...", "caption": "..." }' - } -}; - -// Provider-specific implementations -const providers = { - openai: async (config: any, messages: any[]) => { - const openai = new OpenAI({ - apiKey: config.apiKey || '', - }); - - const completion = await openai.chat.completions.create({ - model: config.model || 'gpt-4', - temperature: config.temperature || 0.7, - messages, - }); - - return completion.choices[0].message.content || ''; - }, - - azure: async (config: any, messages: any[]) => { - const openai = new OpenAI({ - apiKey: config.apiKey || '', - baseURL: config.endpoint, - defaultQuery: { 'api-version': '2024-02-15-preview' }, - defaultHeaders: { 'api-key': config.apiKey || '' }, - }); - - const completion = await openai.chat.completions.create({ - model: config.deploymentName, - temperature: config.temperature || 0.7, - messages - }); - - return completion.choices[0].message.content || ''; - }, - - anthropic: async (config: any, messages: any[]) => { - const anthropic = new Anthropic({ - apiKey: config.apiKey || '', - }); - - // Convert messages format to Anthropic's format - const systemMessage = messages.find(m => m.role === 'system')?.content || ''; - const userMessage = messages.find(m => m.role === 'user')?.content || ''; - - const message = await anthropic.messages.create({ - model: config.model || 'claude-3-sonnet', - max_tokens: 1024, - temperature: config.temperature || 0.7, - system: systemMessage, - messages: [{ role: 'user', content: userMessage }], - }); - - return message.content[0].text; - }, - - google: async (config: any, messages: any[]) => { - const genAI = new GoogleGenerativeAI(config.apiKey || ''); - const model = genAI.getGenerativeModel({ - model: config.model || 'gemini-pro', - }); - - // Convert messages format to Google's format - const systemMessage = messages.find(m => m.role === 'system')?.content || ''; - const userMessage = messages.find(m => m.role === 'user')?.content || ''; - const prompt = `${systemMessage}\n\n${userMessage}`; - - const result = await model.generateContent(prompt); - const response = await result.response; - return response.text(); - }, -}; - -export async function POST(request: Request) { - try { - validateConfig(); - const config = getProviderConfig(); - const akiraConfig = getAkiradocsConfig(); - const provider = akiraConfig.rewrite?.provider || 'openai'; - - const { content, blockType, style } = await request.json(); - - if (!content || !blockType || !style) { - return NextResponse.json( - { error: 'Missing required fields: content, blockType, or style' }, - { status: 400 } - ); - } - - const blockPrompt = blockPrompts[blockType as keyof typeof blockPrompts]; - if (!blockPrompt) { - return NextResponse.json( - { error: 'Invalid block type' }, - { status: 400 } - ); - } - - const messages = [ - { - role: "system", - content: `${blockPrompt.system}\n\nExpected output format: ${blockPrompt.format}\n\nDo not include any explanations or markdown formatting in the response.` - }, - { - role: "user", - content: `Rewrite the following ${blockType} content in a ${style} style while maintaining its structure:\n\n${content}` - } - ]; - - const providerImpl = providers[provider as SupportedProvider]; - if (!providerImpl) { - return NextResponse.json( - { error: `Unsupported AI provider: ${provider}` }, - { status: 400 } - ); - } - - try { - const rewrittenContent = await providerImpl(config, messages); - return NextResponse.json({ content: rewrittenContent }); - } catch (providerError: any) { - console.error('Provider API error:', providerError); - return NextResponse.json( - { - error: providerError.message || 'Provider API error', - details: providerError.response?.data || providerError.response || providerError - }, - { status: 500 } - ); - } - - } catch (error: any) { - console.error('AI API error:', error); - - if (error instanceof Error) { - return NextResponse.json( - { - error: error.message, - details: error - }, - { status: error.message.includes('API key') ? 400 : 500 } - ); - } - - return NextResponse.json( - { error: 'Failed to generate AI content', details: error }, - { status: 500 } - ); - } -} \ No newline at end of file diff --git a/docs/src/components/blocks/ArticleHeaders.tsx b/docs/src/components/blocks/ArticleHeaders.tsx index 4afe7f2..ab5808e 100644 --- a/docs/src/components/blocks/ArticleHeaders.tsx +++ b/docs/src/components/blocks/ArticleHeaders.tsx @@ -26,13 +26,13 @@ export function ArticleHeaders({ title, setTitle, subtitle, setSubtitle, showPre value={title} onChange={(e) => setTitle(e.target.value)} placeholder="Article title" - className="text-4xl font-bold mb-4 border-none px-0" + className="text-4xl font-bold mb-4 border-none px-0 max-w-4xl break-words" /> setSubtitle(e.target.value)} placeholder="Add a subtitle" - className="text-xl mb-4 border-none px-0" + className="text-xl mb-4 border-none px-0 max-w-4xl break-words" /> ) diff --git a/docs/src/components/blocks/AudioBlock.tsx b/docs/src/components/blocks/AudioBlock.tsx index f1e81ca..ece5a5d 100644 --- a/docs/src/components/blocks/AudioBlock.tsx +++ b/docs/src/components/blocks/AudioBlock.tsx @@ -1,32 +1,198 @@ -import React from 'react'; -import { cn } from "@/lib/utils"; - -interface AudioProps { - id?: string; - src: string; - caption?: string; - align?: 'left' | 'center' | 'right'; - styles?: { - bold?: boolean; - italic?: boolean; - underline?: boolean; - }; +"use client" + +import { cn } from '@/lib/utils' +import { Button } from '@/components/ui/button' +import { Music, Pause, Play } from 'lucide-react' +import { useState, useRef, useEffect } from 'react' + +interface AudioBlockProps { + content: string + id: string + onUpdate?: (content: string) => void + isEditing?: boolean + metadata?: { + caption?: string + alignment?: 'left' | 'center' | 'right' + styles?: { + bold?: boolean + italic?: boolean + underline?: boolean + } + } } -export function Audio({ id, src, caption, align = 'left', styles }: AudioProps) { - const alignClass = align === 'center' ? 'mx-auto' : align === 'right' ? 'ml-auto' : ''; - return ( -
- - {caption &&

{caption}

} -
- ); +interface AudioBlockContent { + url: string + caption?: string + alignment?: 'left' | 'center' | 'right' } + +export function AudioBlock({ content, id, onUpdate, isEditing, metadata }: AudioBlockProps) { + const [isHovered, setIsHovered] = useState(false) + const [isPlaying, setIsPlaying] = useState(false) + const audioRef = useRef(null) + + const handlePlayPause = (e: React.MouseEvent) => { + e.stopPropagation() + if (audioRef.current) { + if (isPlaying) { + audioRef.current.pause() + } else { + audioRef.current.play() + } + setIsPlaying(!isPlaying) + } + } + + // Add event listeners to sync the isPlaying state with audio events + useEffect(() => { + const audio = audioRef.current + if (!audio) return + + const handlePlay = () => setIsPlaying(true) + const handlePause = () => setIsPlaying(false) + const handleEnded = () => setIsPlaying(false) + + audio.addEventListener('play', handlePlay) + audio.addEventListener('pause', handlePause) + audio.addEventListener('ended', handleEnded) + + return () => { + audio.removeEventListener('play', handlePlay) + audio.removeEventListener('pause', handlePause) + audio.removeEventListener('ended', handleEnded) + } + }, []) + + const parseAudioContent = (content: string): AudioBlockContent => { + try { + return typeof content === 'string' ? JSON.parse(content) : content + } catch { + return { + url: content, + caption: metadata?.caption || '', + alignment: metadata?.alignment || 'center' + } + } + } + + const UploadButton = () => ( +
+ +
+ +
+
+ ) + + if (!content && isEditing) { + return ( +
+ +
+ ) + } + + const audioContent = parseAudioContent(content) + const alignment = audioContent.alignment || metadata?.alignment || 'center' + + return ( +
setIsHovered(true)} + onMouseLeave={() => setIsHovered(false)} + > +
+
+
+ +
+
+ {isEditing && isHovered && ( +
e.stopPropagation()} + > + + + +
+ )} +
+ {audioContent.caption && ( +
+ {audioContent.caption} +
+ )} +
+ ) +} \ No newline at end of file diff --git a/docs/src/components/blocks/BlockquoteBlock.tsx b/docs/src/components/blocks/BlockquoteBlock.tsx index 4873b24..5230dfc 100644 --- a/docs/src/components/blocks/BlockquoteBlock.tsx +++ b/docs/src/components/blocks/BlockquoteBlock.tsx @@ -40,7 +40,7 @@ export function Blockquote({ id, children, align = 'left', styles, isEditing, on if (isEditing) { return ( -
+