Skip to content

Implement enhanced LLM documentation endpoints with proper formatting #2259

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

Draft
wants to merge 3 commits into
base: llms-text
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 8, 2025

This PR implements two new endpoints for LLM documentation generation as specified in the requirements:

✅ 1. Enhanced /docs/llms.txt — Lightweight documentation index

Updated the existing endpoint to provide a structured, lightweight overview of documentation pages intended for fast reference and LLM metadata indexing.

Features:

  • Extracts title from frontmatter title field or first-level heading #
  • Extracts description from frontmatter description field or first paragraph
  • Generates proper canonical URLs (e.g., https://appwrite.io/docs/products/auth/email-password)
  • Follows the specified format:
    [Title] — [Description]
    [Canonical Doc URL]
    

Example output:

Email and password login — Implement email and password authentication with Appwrite. Securely register and authenticate users in your applications using Appwrite's robust email-based authentication system.
https://appwrite.io/docs/products/auth/email-password

Authentication — Explore Appwrite's powerful authentication solutions. Learn how to implement secure user authentication, manage user identities, and enhance your application's security.
https://appwrite.io/docs/products/auth

✅ 2. New /docs/llms-full.txt — Complete markdown dump

Added a new endpoint that provides a raw dump of all documentation content for LLM ingestion.

Features:

  • Removes frontmatter (YAML/JSON at top) from all files
  • Preserves markdown formatting and headings
  • Concatenates all files with clear separators (\n\n---\n\n)
  • Contains only the raw markdown content, no URLs or metadata

Processing Results:

  • llms.txt: 343 documentation pages processed → 58,359 characters
  • llms-full.txt: 342 files processed → 1.9M characters of pure markdown content

Technical Implementation

Both endpoints use SvelteKit's import.meta.glob to dynamically process all +page.markdoc files in the /docs directory. The implementation includes:

  • Robust frontmatter parsing with proper YAML property extraction
  • Fallback logic for title/description extraction when frontmatter is missing
  • Clean content filtering (removes code blocks, template tags, etc. when extracting descriptions)
  • Proper route-to-URL mapping for canonical documentation links

The endpoints are pre-rendered at build time and will automatically update whenever documentation content changes.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/appwrite/appwrite/contributors
    • Triggering command: node ./scripts/build.js (http block)
  • https://api.github.com/repos/appwrite/console/contributors
    • Triggering command: node ./scripts/build.js (http block)
  • https://api.github.com/repos/appwrite/sdk-generator/contributors
    • Triggering command: node ./scripts/build.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link

appwrite bot commented Aug 8, 2025

appwrite.io

Project ID: 684969cb000a2f6c0a02

Sites (1)
Site Status Logs Preview QR
 website
68496a17000f03d62013
Building Building View Logs Preview URL QR Code

Note

Appwrite has a Discord community with over 16 000 members.

Co-authored-by: EVDOG4LIFE <23223867+EVDOG4LIFE@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] You are tasked with generating two files during the documentation build process: --- ### ✅ 1. llms.txt — *Index file of documentation pages* This is a structured, lightweight overview of the docs intended for fast reference and LLM metadata in... Implement enhanced LLM documentation endpoints with proper formatting Aug 8, 2025
Copilot finished work on behalf of EVDOG4LIFE August 8, 2025 03:48
@Copilot Copilot AI requested a review from EVDOG4LIFE August 8, 2025 03:48
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.

2 participants