-
Notifications
You must be signed in to change notification settings - Fork 834
feat: Auto-generate table of contents in llms.txt from toc.yml (backport #21844) #21880
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
feat: Auto-generate table of contents in llms.txt from toc.yml (backport #21844) #21880
Conversation
Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit adeba90)
Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit 0cfeb86)
- Trim llms.txt in repo to only base content (no Docs section) - Script now generates both files in single run - llms.txt = base content + TOC with raw GitHub URLs (no actual docs) - llms-full.txt = llms.txt content + TOC with xref anchors + all docs - Updated script parameters and README documentation Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit 61684d9)
- Add blank lines around lists (MD032) - Change asterisks to dashes for list items (MD004) Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit 535a388)
- Update Uno.UI.Build.csproj to use new parameter names for generate-llms-full.ps1 - Replace -OutputFile and -Llmstxt with -LlmsTxtOutput, -LlmsFullTxtOutput, -BaseContentFile, -TocYmlPath Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit 8c4501a)
- Add bullet points (-) to all TOC items for better formatting - Fix URL generation to include proper file paths relative to doc/ folder - URLs now correctly show full paths like doc/articles/getting-started/requirements.md Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit a7ee92a)
- Fixed YAML parser to correctly handle items: sections and nested children - Updated Convert-ItemToLines to output all items, even when xref URLs can't be resolved in Llms mode - Items with children and no URL are rendered as bold headers - Items without children and no URL are rendered as plain text - All nested levels now properly display in the generated TOC Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit 2bb5a75)
- Added Build-XrefCache function to scan all markdown files and build uid-to-file mappings - Updated Convert-ItemToLines to resolve xref: hrefs to actual file paths using the cache - All TOC items now have proper links to documentation files - Items like "Visual Studio 2022", "Skia Renderer", etc. now show as links instead of plain text - URLs are complete with full file paths (e.g., doc/articles/get-started-vs-2022.md) Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit d56094c)
β¦ation - Rewrote Get-RelativePath function to work in PowerShell 5.1 (Windows PowerShell) - Replaced direct calls to [System.IO.Path]::GetRelativePath() which is only available in .NET Core 2.0+ - Uses URI-based relative path calculation with fallback to string manipulation - Tested and verified URLs are correctly generated with proper relative paths Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit 3e9173e)
β¦ URLs - Changed llms-full.txt to use xref anchors (#Uno.GetStarted) in its TOC section - llms.txt continues to use raw GitHub URLs as intended - llms-full.txt now has only one TOC with xref anchors for in-document navigation - Removed duplicate TOC section that had raw GitHub URLs Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit 6d3d6f0)
- Add circular reference detection for nested toc.yml files - Make GitHub branch configurable via -GitHubBranch parameter (default: master) - Fix path comparison to use Ordinal for case-sensitive file systems - Add proper error logging with warnings for file processing failures - Add warnings for unresolved xrefs in Llms mode - Preserve anchor fragments in xref URLs for llms-full.txt - Improve fallback UID generation with sanitized relative paths - Remove redundant bullet variable (always use dash) - Add comprehensive comments for YAML parser limitations - Add detailed comments explaining rendering logic for items without links - Update build script to write outputs to OutputDir instead of source tree - Clarify documentation about base content file vs generated file Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit dd7b60b)
Co-authored-by: Copilot <[email protected]> (cherry picked from commit edb19c6)
Co-authored-by: Copilot <[email protected]> (cherry picked from commit 8be0830)
- Changed output paths back to articles/llms/llms.txt and articles/llms/llms-full.txt - Updated README to clarify that script reads base content before overwriting - Ensures generated files are in the correct location for documentation build Co-authored-by: jeromelaban <[email protected]> (cherry picked from commit 8d57c6e)
|
|
|
π€ Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21880/wasm-skia-net9/index.html |
|
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21880/docs/index.html |
|
The build 183735 found UI Test snapshots differences: Details
|
Original prompt
π‘ You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
This is an automatic backport of pull request #21844 done by Mergify.