Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4598e87
Add new docContet.js util
pwizla Nov 4, 2025
6f0bde0
Add new openLLM action
pwizla Nov 4, 2025
925e20d
Swap generic icon for ChatGPT with the official OpenAI logo from Phos…
pwizla Nov 4, 2025
c50254c
Swap sparkle icon for Claude with a chat bubble icon, since sparkle i…
pwizla Nov 4, 2025
04c94d7
Add prompt localization for the top 10 most used languages
pwizla Nov 4, 2025
68742d8
Fix Claude incorrectly building translated prompt
pwizla Nov 4, 2025
0fc185c
Better fix Claude handling of locales by adding dual English + locali…
pwizla Nov 4, 2025
98c95cc
Ensure only Claude shows dual prompts
pwizla Nov 4, 2025
a68f7b0
Hide descriptions for Open with… buttons
pwizla Nov 4, 2025
83d7e8a
Update icon for Claude
pwizla Nov 4, 2025
6766923
Fix icon position when no description provided
pwizla Nov 4, 2025
cdb8d76
Try to accomodate for both description and no desciption scenarii for…
pwizla Nov 4, 2025
6691a93
Revert "Try to accomodate for both description and no desciption scen…
pwizla Nov 4, 2025
b707ce3
Simplify icons alignment fix
pwizla Nov 4, 2025
713ce21
Try to fix Claude's issue
pwizla Nov 5, 2025
08ad520
Fix query parameter for Claude
pwizla Nov 5, 2025
ed2d60e
Remove dual prompt in Claude now that we fixed the query param
pwizla Nov 5, 2025
7b044c1
Refactor translation system and add many more locales
pwizla Nov 5, 2025
4211207
Add aiPromptTemplates.js
pwizla Nov 5, 2025
b2f8c03
Add script for translated prompt validation
pwizla Nov 5, 2025
119eb1c
Added many more languages
pwizla Nov 5, 2025
8d4461b
Include Tldr components content in llms.txt
pwizla Nov 6, 2025
6266bc9
Merge branch 'main' into repo/include-tldr-in-llms-txt
pwizla Nov 7, 2025
a9d9a48
Remove "contributing" folder
pwizla Nov 7, 2025
ae7816f
Remove "ai-toolbar-translations.md"
pwizla Nov 7, 2025
e9f9374
Remove superfluous script file
pwizla Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions docusaurus/scripts/generate-llms.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ class DocusaurusLlmsGenerator {
const { data: frontmatter, content } = matter(fileContent);

const pageUrl = this.generatePageUrl(docId);

const tldr = this.extractTldr(content);

pages.push({
id: docId,
title: frontmatter.title || this.getTitleFromContent(content) || docId,
description: frontmatter.description || this.extractDescription(content),
description:
tldr || frontmatter.description || this.extractDescription(content),
url: pageUrl,
content: this.cleanContent(content),
frontmatter
Expand Down Expand Up @@ -160,6 +162,42 @@ class DocusaurusLlmsGenerator {
return '';
}

extractTldr(content) {
const match = content.match(/<Tldr>([\s\S]*?)<\/Tldr>/i);

if (!match) {
return null;
}

const raw = match[1].trim();

if (!raw) {
return null;
}

return this.sanitizeInlineMarkdown(raw);
}

sanitizeInlineMarkdown(text) {
return text
// Remove fenced code blocks inside TLDR (rare but safe)
.replace(/```[\s\S]*?```/g, '')
// Strip inline code
.replace(/`([^`]+)`/g, '$1')
// Turn markdown links into plain text
.replace(/\[([^\]]+)\]\([^\)]+\)/g, '$1')
// Bold and italic markers
.replace(/\*\*([^*]+)\*\*/g, '$1')
.replace(/__([^_]+)__/g, '$1')
.replace(/\*([^*]+)\*/g, '$1')
.replace(/_([^_]+)_/g, '$1')
// Strip residual HTML tags (including MDX components)
.replace(/<[^>]+>/g, ' ')
// Collapse whitespace and trim
.replace(/\s+/g, ' ')
.trim();
}

cleanContent(content) {
return content
// Deletes frontmatter metadata
Expand Down
Loading
Loading