diff --git a/.gitignore b/.gitignore index 3f7dea2..41a517e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,9 @@ node_modules .DS_Store build -.docusaurus \ No newline at end of file +.docusaurus + +# Remote content files (downloaded automatically) +docs/community/contribute.md +docs/community/code-of-conduct.md +docs/community/security.md \ No newline at end of file diff --git a/docs/community/contact_us.md b/docs/community/contact_us.md index 6813048..f20258c 100644 --- a/docs/community/contact_us.md +++ b/docs/community/contact_us.md @@ -1,5 +1,5 @@ --- -sidebar_position: 1 +sidebar_position: 4 --- # Talk to us! diff --git a/docs/community/contribute.md b/docs/community/contribute.md deleted file mode 100644 index b52bb89..0000000 --- a/docs/community/contribute.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -sidebar_position: 0 -sidebar_label: Contribute to llm-d ---- - -# Contribute to llm-d - -**NOTE: the definitive version of these guidelines may always be found in the GitHub project at [https://github.com/llm-d/llm-d/blob/dev/PROJECT.md](https://github.com/llm-d/llm-d/blob/dev/PROJECT.md)** - -# Contributing Guidelines - -Thank you for your interest in contributing to llm-d. Community involvement is highly valued and crucial for the project's growth and success. The llm-d project accepts contributions via GitHub pull requests. This outlines the process to help get your contribution accepted. - -To ensure a clear direction and cohesive vision for the project, the project leads have the final decision on all contributions. However, these guidelines outline how you can contribute effectively to llm-d. - -## How You Can Contribute - -There are several ways you can contribute to llm-d: - -* **Reporting Issues:** Help us identify and fix bugs by reporting them clearly and concisely. -* **Suggesting Features:** Share your ideas for new features or improvements. -* **Improving Documentation:** Help make the project more accessible by enhancing the documentation. -* **Submitting Code Contributions (with consideration):** While the project leads maintain final say, code contributions that align with the project's vision are always welcome. - -## Reporting Issues - -Before submitting a new issue, please: - -* **Check Existing Issues:** Search the issue tracker to see if a similar issue has already been reported. -* **Be Clear and Concise:** Provide a descriptive title and detailed steps to reproduce the issue. Include your operating system, relevant software versions, and any error messages. -* **Provide Context:** Explain the expected behavior and what you observed instead. - -## Suggesting Features - -We welcome your ideas for improving llm-d! When suggesting a feature: - -* **Explain the Use Case:** Describe the problem the feature solves or the benefit it provides. -* **Provide Details:** Outline how the feature would work, if possible. -* **Be Open to Discussion:** Feature requests may be discussed and refined before a decision is made. The project leads will ultimately decide on the inclusion of new features based on the project's overall direction. - -## Improving Documentation - -Good documentation is essential for any project. You can contribute by: - -* **Fixing Typos and Errors:** Correcting any mistakes you find in the documentation. -* **Clarifying Explanations:** Making existing documentation easier to understand. -* **Adding Missing Information:** Documenting new features or expanding on existing ones. -* **Providing Examples:** Creating clear and helpful usage examples. - -Pull requests for documentation improvements are welcome. - -## Submitting Code Contributions - -The process for accepting code contributions is as follows: - -1. **Discuss First (Recommended):** For significant changes or new features, it's highly recommended to open an issue first to discuss in the community. This helps ensure your effort aligns with the project's goals and avoids potential rework. -2. **Fork the Repository:** Create your own fork of the relevant llm-d repository. -3. **Create a Branch:** Make your changes in a dedicated branch within your fork. -4. **Follow Coding Standards:** Adhere to any existing coding style or conventions used in the project. -5. **Write Tests (if applicable):** If your contribution includes code changes, please include relevant tests. -6. **Submit a Pull Request (PR):** Once you're satisfied with your changes, submit a pull request to the main repository. Clearly describe the changes you've made and why. - -## Code Review Process - -All pull requests will be reviewed by the lead core Maintainer. Feedback will be provided, and you may be asked to make revisions. The project leads will ultimately decide whether to merge the pull request based on its alignment with the project's vision, code quality, and overall impact. - -## Community and Communication - -* **Developer Slack:** [Join our developer Slack workspace](https://inviter.co/llm-d-slack) to connect with the core maintainers and other contributors, ask questions, and participate in discussions. -* **Weekly Meetings:** Project updates, ongoing work discussions, and Q&A will be covered in our weekly project meeting every Wednesday at 12:30 PM ET. Please join by [adding the shared calendar](https://calendar.google.com/calendar/u/0?cid=NzA4ZWNlZDY0NDBjYjBkYzA3NjdlZTNhZTk2NWQ2ZTc1Y2U5NTZlMzA5MzhmYTAyZmQ3ZmU1MDJjMDBhNTRiNEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t). You can also [join our Google Group](https://groups.google.com/g/llm-d-contributors) for access to shared diagrams and other content. -* **Social Media:** Follow us on social media for the latest news, announcements, and updates: - * **X:** [https://x.com/\_llm_d\_](https://x.com/_llm_d_) - * **LinkedIn:** [https://linkedin.com/company/llm-d ](https://linkedin.com/company/llm-d) - * **Reddit:** [https://www.reddit.com/r/llm_d/](https://www.reddit.com/r/llm_d/) - -## License - -By contributing to llm-d, you agree that your contributions will be licensed under the [Apache 2.0 License](@site/docs/assets/files/LICENSE). - -## Code of Conduct - -Please note that we expect all contributors to adhere to a respectful and professional code of conduct. Detailed documentation can be found [here](https://github.com/llm-d/llm-d/blob/dev/CODE_OF_CONDUCT.md). - -Thank you again for your interest in llm-d! Your contributions, in any form, are valuable. diff --git a/docusaurus.config.js b/docusaurus.config.js index 9ed513b..1e327da 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -5,6 +5,7 @@ // See: https://docusaurus.io/docs/api/docusaurus-config import { themes as prismThemes } from "prism-react-renderer"; +import remoteContentPlugins from "./remote-content/remote-content.js"; //import GHiconUrl from "./docs/assets/github-mark-white.svg"; //import LIiconURL from "./docs/assets/linkedin-mark-white.svg"; @@ -94,18 +95,28 @@ const config = { }), ], ], - markdown: { mermaid: true }, - themes: ["@docusaurus/theme-mermaid"], - + + // Plugins configuration plugins: [ + // Remote content plugins (managed independently) + ...remoteContentPlugins, + + // Other site plugins [ require.resolve("docusaurus-lunr-search"), { languages: ["en"], }, ], - ], + // Examples: + // ['@docusaurus/plugin-google-analytics', { trackingID: 'UA-XXXXXX-X' }], + // ['docusaurus-plugin-sass', {}], + // Add any other plugins you need + ], + + markdown: { mermaid: true }, + themes: ["@docusaurus/theme-mermaid"], themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ diff --git a/package-lock.json b/package-lock.json index 18d87dd..09122ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", "docusaurus-lunr-search": "^3.6.0", + "docusaurus-plugin-remote-content": "^4.0.0", "prism-react-renderer": "^2.3.0", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -3952,6 +3953,47 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", @@ -4142,6 +4184,15 @@ "node": ">= 8" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@pnpm/config.env-replace": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", @@ -5675,6 +5726,11 @@ "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==" + }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", @@ -5730,6 +5786,16 @@ "postcss": "^8.1.0" } }, + "node_modules/axios": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.10.0.tgz", + "integrity": "sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/babel-loader": { "version": "9.2.1", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.2.1.tgz", @@ -6506,6 +6572,17 @@ "node": ">=10" } }, + "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==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/comma-separated-tokens": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz", @@ -8008,6 +8085,14 @@ "robust-predicates": "^3.0.2" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -8267,6 +8352,81 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/docusaurus-plugin-remote-content": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-remote-content/-/docusaurus-plugin-remote-content-4.0.0.tgz", + "integrity": "sha512-e+gBmNdgOwA+7u6O2kk/u1w4ET23j8OIF6OiOWV6EoKHJJ/w/8U5smkHNlrQC3hQOltxE2NRC1jbsG7wfS+d3w==", + "workspaces": [ + "testsite" + ], + "dependencies": { + "axios": "^1.6.0", + "picocolors": "^1.0.0", + "pretty-ms": "^7.0.1", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@docusaurus/core": "2.x || 3.x" + } + }, + "node_modules/docusaurus-plugin-remote-content/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/docusaurus-plugin-remote-content/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/docusaurus-plugin-remote-content/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/docusaurus-plugin-remote-content/node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -8522,6 +8682,20 @@ "node": ">= 0.4" } }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esast-util-from-estree": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/esast-util-from-estree/-/esast-util-from-estree-2.0.0.tgz", @@ -9242,6 +9416,32 @@ } } }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/fork-ts-checker-webpack-plugin": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-6.5.3.tgz", @@ -9370,6 +9570,21 @@ "node": ">=6" } }, + "node_modules/form-data": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.3.tgz", + "integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/form-data-encoder": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", @@ -9860,6 +10075,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", @@ -11340,6 +11569,20 @@ "node": ">=0.10.0" } }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/jest-util": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", @@ -14252,6 +14495,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mkdirp": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", @@ -14762,6 +15013,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" + }, "node_modules/package-manager-detector": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.3.0.tgz", @@ -14833,6 +15089,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse-ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", + "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==", + "engines": { + "node": ">=6" + } + }, "node_modules/parse-numeric-range": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz", @@ -14940,6 +15204,26 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "license": "MIT" }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + }, "node_modules/path-to-regexp": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.9.0.tgz", @@ -16563,6 +16847,20 @@ "renderkid": "^3.0.0" } }, + "node_modules/pretty-ms": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz", + "integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==", + "dependencies": { + "parse-ms": "^2.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/pretty-time": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pretty-time/-/pretty-time-1.1.0.tgz", @@ -16665,6 +16963,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -18517,6 +18820,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, "node_modules/string-width/node_modules/ansi-regex": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", @@ -18584,6 +18906,18 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", @@ -20094,6 +20428,41 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", diff --git a/package.json b/package.json index 1c8cb28..f96e935 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", "docusaurus-lunr-search": "^3.6.0", + "docusaurus-plugin-remote-content": "^4.0.0", "prism-react-renderer": "^2.3.0", "react": "^19.0.0", "react-dom": "^19.0.0", diff --git a/remote-content/README.md b/remote-content/README.md new file mode 100644 index 0000000..50bc435 --- /dev/null +++ b/remote-content/README.md @@ -0,0 +1,58 @@ +# Remote Content System + +Automatically download and sync content from remote repositories (like GitHub) into your Docusaurus site. Each remote file gets its own configuration with automatic source attribution and edit links. + +## 🚀 Quick Start + +### 1. Copy & Edit Template +```bash +cp config/remote-sources/example-readme.js.template config/remote-sources/my-content.js +``` +Edit the file and replace these placeholders: + +| Placeholder | Example | Description | +|-------------|---------|-------------| +| `YOUR-CONTENT-NAME` | `user-guide` | Unique name for CLI commands | +| `YOUR-ORG/YOUR-REPO` | `microsoft/vscode` | GitHub repo path | +| `YOUR-SECTION` | `docs/guides` | Where to put the file | +| `YOUR-FILE.md` | `README.md` | Source filename | + +### 2. Add to System +```javascript +// config/remote-content.js +import myContent from './remote-sources/my-content.js'; + +const remoteContentPlugins = [ + contributeSource, + codeOfConductSource, + myContent, // Add here +]; +``` + +### 3. Test +```bash +npm start +``` + +## 📁 File Structure + +``` +config/ +├── remote-content.js # Main system (imports all sources) +├── remote-sources/ +│ ├── utils.js # Shared utilities +│ ├── contribute.js # Contributing guide +│ ├── code-of-conduct.js # Code of conduct +│ └── example-readme.js.template # Copy this for new sources +└── README.md # This file +``` + +## 🐛 Troubleshooting + +| Problem | Fix | +|---------|-----| +| Page not appearing | Check source URL is publicly accessible | +| Build errors | Verify all `YOUR-...` placeholders are replaced | +| Wrong sidebar order | Check `sidebarPosition` numbers | +| Links broken | Use `contentTransform` to fix relative links | +| Import errors | Ensure file is imported in `config/remote-content.js` | \ No newline at end of file diff --git a/remote-content/remote-content.js b/remote-content/remote-content.js new file mode 100644 index 0000000..d67b9a7 --- /dev/null +++ b/remote-content/remote-content.js @@ -0,0 +1,34 @@ +// @ts-check + +// Import individual remote content sources +import contributeSource from './remote-sources/contribute.js'; +import codeOfConductSource from './remote-sources/code-of-conduct.js'; +import securitySource from './remote-sources/security.js'; + +/** + * Remote Content Plugin System + * + * This module is completely independent from other Docusaurus plugins. + * It only manages remote content sources and can scale independently. + * + * To add new remote content: + * 1. Create a new file in remote-sources/ + * 2. Import it below + * 3. Add it to the remoteContentPlugins array + * + * Users can manage their own plugins separately in docusaurus.config.js + */ + +/** + * All remote content plugin configurations + * Add new remote sources here as you create them + */ +const remoteContentPlugins = [ + contributeSource, + codeOfConductSource, + securitySource, + + // Add more remote sources here +]; + +export default remoteContentPlugins; \ No newline at end of file diff --git a/remote-content/remote-sources/code-of-conduct.js b/remote-content/remote-sources/code-of-conduct.js new file mode 100644 index 0000000..4c60020 --- /dev/null +++ b/remote-content/remote-sources/code-of-conduct.js @@ -0,0 +1,41 @@ +/** + * Code of Conduct Remote Content + * + * Downloads the CODE_OF_CONDUCT.md file from the llm-d repository + * and transforms it into docs/community/code-of-conduct.md + */ + +import { createContentWithSource } from './utils.js'; + +export default [ + 'docusaurus-plugin-remote-content', + { + // Basic configuration + name: 'code-of-conduct', + sourceBaseUrl: 'https://raw.githubusercontent.com/llm-d/llm-d/dev/', + outDir: 'docs/community', + documents: ['CODE_OF_CONDUCT.md'], + + // Plugin behavior + noRuntimeDownloads: false, // Download automatically when building + performCleanup: true, // Clean up files after build + + // Transform the content for this specific document + modifyContent(filename, content) { + if (filename === 'CODE_OF_CONDUCT.md') { + return createContentWithSource({ + title: 'Code of Conduct', + description: 'Code of Conduct and Community Guidelines for llm-d', + sidebarLabel: 'Code of Conduct', + sidebarPosition: 2, + filename: 'CODE_OF_CONDUCT.md', + newFilename: 'code-of-conduct.md', + repoUrl: 'https://github.com/llm-d/llm-d', + branch: 'dev', + content + }); + } + return undefined; + }, + }, +]; \ No newline at end of file diff --git a/remote-content/remote-sources/contribute.js b/remote-content/remote-sources/contribute.js new file mode 100644 index 0000000..b361079 --- /dev/null +++ b/remote-content/remote-sources/contribute.js @@ -0,0 +1,43 @@ +/** + * Contributing Guide Remote Content + * + * Downloads the CONTRIBUTING.md file from the llm-d repository + * and transforms it into docs/community/contribute.md + */ + +import { createContentWithSource } from './utils.js'; + +export default [ + 'docusaurus-plugin-remote-content', + { + // Basic configuration + name: 'contribute-guide', + sourceBaseUrl: 'https://raw.githubusercontent.com/llm-d/llm-d/dev/', + outDir: 'docs/community', + documents: ['CONTRIBUTING.md'], + + // Plugin behavior + noRuntimeDownloads: false, // Download automatically when building + performCleanup: true, // Clean up files after build + + // Transform the content for this specific document + modifyContent(filename, content) { + if (filename === 'CONTRIBUTING.md') { + return createContentWithSource({ + title: 'Contributing to llm-d', + description: 'Guidelines for contributing to the llm-d project', + sidebarLabel: 'Contributing', + sidebarPosition: 1, + filename: 'CONTRIBUTING.md', + newFilename: 'contribute.md', + repoUrl: 'https://github.com/llm-d/llm-d', + branch: 'dev', + content, + // Fix relative links in the content + contentTransform: (content) => content.replace(/\(CODE_OF_CONDUCT\.md\)/g, '(code-of-conduct)') + }); + } + return undefined; + }, + }, +]; \ No newline at end of file diff --git a/remote-content/remote-sources/example-readme.js.template b/remote-content/remote-sources/example-readme.js.template new file mode 100644 index 0000000..87aa18d --- /dev/null +++ b/remote-content/remote-sources/example-readme.js.template @@ -0,0 +1,41 @@ +/** + * Example: Project README Remote Content + * + * This is an example of how to set up remote content for a README file. + * Copy this file, rename it (remove .template), and modify the values. + */ + +import { createContentWithSource } from './utils.js'; + +export default [ + 'docusaurus-plugin-remote-content', + { + // Basic configuration + name: 'project-overview', // Change: unique name for CLI commands + sourceBaseUrl: 'https://raw.githubusercontent.com/YOUR-ORG/YOUR-REPO/main/', // Change: your repo URL + outDir: 'docs/overview', // Change: where to put the files + documents: ['README.md'], // Change: which files to download + + // Plugin behavior + noRuntimeDownloads: false, // false = auto-download, true = CLI only + performCleanup: true, // true = clean up after build + + // Transform the content using utilities + modifyContent(filename, content) { + if (filename === 'README.md') { + return createContentWithSource({ + title: 'Project Overview', // Change: your page title + description: 'Overview of the project', // Change: your description + sidebarLabel: 'Overview', // Change: sidebar label + sidebarPosition: 1, // Change: sidebar position + filename: 'README.md', // Original filename + newFilename: 'overview.md', // Change: new filename + repoUrl: 'https://github.com/YOUR-ORG/YOUR-REPO', // Change: your repo URL + branch: 'main', // Change: your branch + content + }); + } + return undefined; + }, + }, +]; \ No newline at end of file diff --git a/remote-content/remote-sources/security.js b/remote-content/remote-sources/security.js new file mode 100644 index 0000000..2f29110 --- /dev/null +++ b/remote-content/remote-sources/security.js @@ -0,0 +1,43 @@ +/** + * Security Policy Remote Content + * + * Downloads the SECURITY.md file from the llm-d repository + * and transforms it into docs/community/security.md + */ + +import { createContentWithSource } from './utils.js'; + +export default [ + 'docusaurus-plugin-remote-content', + { + // Basic configuration + name: 'security-policy', + sourceBaseUrl: 'https://raw.githubusercontent.com/llm-d/llm-d/dev/', + outDir: 'docs/community', + documents: ['SECURITY.md'], + + // Plugin behavior + noRuntimeDownloads: false, // Download automatically when building + performCleanup: true, // Clean up files after build + + // Transform the content for this specific document + modifyContent(filename, content) { + if (filename === 'SECURITY.md') { + return createContentWithSource({ + title: 'Security Policy', + description: 'Security vulnerability reporting and disclosure policy for llm-d', + sidebarLabel: 'Security Policy', + sidebarPosition: 3, + filename: 'SECURITY.md', + newFilename: 'security.md', + repoUrl: 'https://github.com/llm-d/llm-d', + branch: 'dev', + content, + // No additional content transformations needed for SECURITY.md + contentTransform: (content) => content + }); + } + return undefined; + }, + }, +]; \ No newline at end of file diff --git a/remote-content/remote-sources/utils.js b/remote-content/remote-sources/utils.js new file mode 100644 index 0000000..1da81fa --- /dev/null +++ b/remote-content/remote-sources/utils.js @@ -0,0 +1,73 @@ +/** + * Utilities for Remote Content Sources + * + * Helper functions to maintain consistency across remote content transformations + */ + +/** + * Generate a source callout for remote content + * @param {string} filename - The original filename + * @param {string} repoUrl - The GitHub repository URL (without .git) + * @param {string} branch - The branch name (e.g., 'dev', 'main') + * @returns {string} Formatted source callout + */ +export function createSourceCallout(filename, repoUrl, branch = 'main') { + const fileUrl = `${repoUrl}/blob/${branch}/${filename}`; + const editUrl = `${repoUrl}/edit/${branch}/${filename}`; + const issuesUrl = `${repoUrl}/issues`; + + return `:::info Content Source +This content is automatically synced from [${filename}](${fileUrl}) in the ${repoUrl.split('/').slice(-2).join('/')} repository. + +📝 To suggest changes, please [edit the source file](${editUrl}) or [create an issue](${issuesUrl}). +::: + +`; +} + +/** + * Create a complete content transformation with frontmatter and source callout + * @param {Object} options - Configuration options + * @param {string} options.title - Page title + * @param {string} options.description - Page description + * @param {string} options.sidebarLabel - Sidebar label + * @param {number} options.sidebarPosition - Sidebar position + * @param {string} options.filename - Original filename + * @param {string} options.newFilename - New filename + * @param {string} options.repoUrl - GitHub repository URL + * @param {string} options.branch - Branch name + * @param {string} options.content - Original content + * @param {Function} [options.contentTransform] - Optional content transformation function + * @returns {Object} Transformed content object + */ +export function createContentWithSource({ + title, + description, + sidebarLabel, + sidebarPosition, + filename, + newFilename, + repoUrl, + branch = 'main', + content, + contentTransform +}) { + const frontmatter = `--- +title: ${title} +description: ${description} +sidebar_label: ${sidebarLabel} +sidebar_position: ${sidebarPosition} +--- + +`; + + const sourceCallout = createSourceCallout(filename, repoUrl, branch); + + // Apply any additional content transformations + const transformedContent = contentTransform ? contentTransform(content) : content; + + return { + filename: newFilename, + content: frontmatter + sourceCallout + transformedContent + }; +} \ No newline at end of file