Skip to content

Add Ask AI buttons #617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add Ask AI buttons #617

wants to merge 4 commits into from

Conversation

gvdongen
Copy link
Contributor

@gvdongen gvdongen commented May 28, 2025

  • Add generation llms-full.txt
  • Add Ask AI button next to search
  • Add Chat with Page dropdown

@gvdongen gvdongen requested a review from Copilot May 28, 2025 16:16
@gvdongen gvdongen changed the title Add copy llm button Add Ask AI buttons May 28, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds AI/chat integrations and a “copy as Markdown” feature across the docs UI and updates the llms-txt plugin to generate a full Markdown bundle.

  • Wraps the existing SearchBar and DocBreadcrumbs to inject AiSearch and ChatPageButton components
  • Introduces ChatPageButton and AiSearch dropdowns with ChatGPT, Claude, copy Markdown, and view-as-Markdown options
  • Enhances the llms-txt plugin to append full page content to llms-full.txt, adds an appendToMarkdownFile helper, and propagates outDir throughout

Reviewed Changes

Copilot reviewed 12 out of 16 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/theme/SearchBar/index.tsx Wraps original SearchBar and adds an AI search button
src/theme/DocBreadcrumbs/index.tsx Appends ChatPageButton to breadcrumbs UI
src/components/ChatPageButton/index.tsx New dropdown component for chatting and copying Markdown
src/components/AiSearch/index.tsx New dropdown component for global AI queries
plugins/docusaurus-plugin-llms-txt/src/pipeline/html/html-processor.ts Imports and uses appendToMarkdownFile to build llms-full.txt
plugins/docusaurus-plugin-llms-txt/src/pipeline/core/route-processor.ts Adds outDir parameter to route processing functions
plugins/docusaurus-plugin-llms-txt/src/index.ts Passes outDir into plugin entry point
plugins/docusaurus-plugin-llms-txt/src/fs/io/write.ts Adds appendToMarkdownFile helper
plugins/docusaurus-plugin-llms-txt/src/constants.ts Declares LLMS_FULL_TXT_FILENAME constant
plugins/docusaurus-plugin-llms-txt/src/cli/command.ts Updates CLI to accept and forward outDir
docusaurus.config.js Excludes /adminapi/** from static files
Files not reviewed (4)
  • docs/overview.mdx: Language not supported
  • package.json: Language not supported
  • src/components/AiSearch/styles.module.css: Language not supported
  • src/components/ChatPageButton/styles.module.css: Language not supported

import { saveMarkdownFile } from '../../fs/io/write';
import { TITLE_TRUNCATE_LENGTH } from '../../constants';
import {appendToMarkdownFile, saveMarkdownFile} from '../../fs/io/write';
import {LLMS_FULL_TXT_FILENAME, LLMS_TXT_FILENAME, TITLE_TRUNCATE_LENGTH} from '../../constants';
Copy link
Preview

Copilot AI May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLMS_TXT_FILENAME is imported here but not used in this file; consider removing the unused import.

Suggested change
import {LLMS_FULL_TXT_FILENAME, LLMS_TXT_FILENAME, TITLE_TRUNCATE_LENGTH} from '../../constants';
import {LLMS_FULL_TXT_FILENAME, TITLE_TRUNCATE_LENGTH} from '../../constants';

Copilot uses AI. Check for mistakes.

Copy link

cloudflare-workers-and-pages bot commented May 29, 2025

Deploying documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: 176ed17
Status: ✅  Deploy successful!
Preview URL: https://56ee7263.documentation-beg.pages.dev
Branch Preview URL: https://add-copy-llm-button.documentation-beg.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant