Skip to content

docs: add script to generate llm.txt - #9281

Merged
Laffery merged 2 commits into
NG-ZORRO:masterfrom
Laffery:feat/llm
Jul 18, 2025
Merged

Laffery merged 2 commits into
NG-ZORRO:masterfrom
Laffery:feat/llm

Conversation

@Laffery

@Laffery Laffery commented Jul 9, 2025 •

Copy link
Copy Markdown
Collaborator

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Add a script to generate llm.txt for ng-zorro-antd, inspired by https://github.com/ant-design/ant-design/blob/master/scripts/generate-llms.ts, which will be executed automatically by npm run start or npm run build.

The generated files are available with url

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@codecov

codecov Bot commented Jul 9, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.12%. Comparing base (a1b16a9) to head (cc32c47).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9281      +/-   ##
==========================================
+ Coverage   92.08%   92.12%   +0.04%     
==========================================
  Files         561      561              
  Lines       19627    19627              
  Branches     3106     3106              
==========================================
+ Hits        18074    18082       +8     
+ Misses       1214     1206       -8     
  Partials      339      339              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Laffery
Laffery marked this pull request as ready for review July 18, 2025 03:31
@Laffery
Laffery requested review from HyperLife1119 and Copilot and removed request for HyperLife1119 July 18, 2025 03:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 a script to generate LLM-friendly documentation files (llms.txt and llms-full.txt) for the ng-zorro-antd project, inspired by the Ant Design implementation. The script extracts documentation content from markdown files and formats it for consumption by Large Language Models.

  • Adds a new generateLLms function that processes documentation markdown files
  • Integrates the LLM generation into the site build process
  • Configures build assets to include the generated LLM files

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

File Description
scripts/generate-llms.ts Core script that processes markdown files and generates LLM-friendly documentation
scripts/gulp/tasks/site.ts Integrates LLM generation into the site initialization task
package.json Adds tsx dependency and llms npm script for standalone execution
angular.json Includes generated LLM files in the build assets
Comments suppressed due to low confidence (4)

scripts/generate-llms.ts:14

  • The function name 'generateLLms' uses inconsistent capitalization. It should be 'generateLLMs' to properly capitalize the acronym.
export async function generateLLms(): Promise<void> {

scripts/generate-llms.ts:93

  • The function call 'generateLLms()' uses inconsistent capitalization. It should be 'generateLLMs()' to match the corrected function name.
    await generateLLms();

scripts/gulp/tasks/site.ts:14

  • The import 'generateLLms' uses inconsistent capitalization. It should be 'generateLLMs' to properly capitalize the acronym.
import { generateLLms } from '../../generate-llms';

scripts/gulp/tasks/site.ts:54

  • The function call 'generateLLms()' uses inconsistent capitalization. It should be 'generateLLMs()' to match the corrected function name.
  await generateLLms();

@Laffery Laffery added this to the v20.1 milestone Jul 18, 2025

@HyperLife1119 HyperLife1119 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Laffery
Laffery merged commit 165b963 into NG-ZORRO:master Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants