Skip to content

Commit 543fc04

Browse files
[autofix.ci] apply automated fixes
1 parent d59c95b commit 543fc04

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/plugins/llms-txt.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,13 @@ async function generateForVersion(
252252
llmsFullTxt += `${doc.processedContent}\n\n---\n\n`;
253253
});
254254

255-
const fullFilename = isLatest
256-
? 'llms-full.txt'
257-
: `llms-full-${version}.txt`;
255+
const fullFilename = isLatest ? 'llms-full.txt' : `llms-full-${version}.txt`;
258256

259257
fs.writeFileSync(path.join(outDir, fullFilename), llmsFullTxt);
260258

261259
// 4. Generate individual .md files for each doc
262260
const mdFiles = processedDocs.map((doc) => {
263-
const urlPath = isLatest
264-
? `/docs/${doc.id}`
265-
: `/docs/${version}/${doc.id}`;
261+
const urlPath = isLatest ? `/docs/${doc.id}` : `/docs/${version}/${doc.id}`;
266262

267263
const mdFilePath = path.join(outDir, `${urlPath}.md`);
268264
const mdDir = path.dirname(mdFilePath);

src/plugins/process-markdown.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,14 @@ function renderTabsAsMarkdown(items: TabItem[]): string {
285285
*/
286286
async function transformStatic2Dynamic(content: string): Promise<string> {
287287
// Match code fences with static2dynamic in meta
288-
const fenceRegex = /^(```\w*)\s+([^\n]*static2dynamic[^\n]*)\n([\s\S]*?)^```$/gm;
289-
const matches: { fullMatch: string; lang: string; meta: string; code: string }[] = [];
288+
const fenceRegex =
289+
/^(```\w*)\s+([^\n]*static2dynamic[^\n]*)\n([\s\S]*?)^```$/gm;
290+
const matches: {
291+
fullMatch: string;
292+
lang: string;
293+
meta: string;
294+
code: string;
295+
}[] = [];
290296

291297
let match: RegExpExecArray | null;
292298

@@ -308,10 +314,8 @@ async function transformStatic2Dynamic(content: string): Promise<string> {
308314
const langTag = m.lang || 'js';
309315
const metaSuffix = cleanMeta ? ` ${cleanMeta}` : '';
310316

311-
const staticSection =
312-
`**Static:**\n\n\`\`\`${langTag}${metaSuffix}\n${m.code}\`\`\``;
313-
const dynamicSection =
314-
`**Dynamic:**\n\n\`\`\`${langTag}${metaSuffix}\n${dynamicCode}\n\`\`\``;
317+
const staticSection = `**Static:**\n\n\`\`\`${langTag}${metaSuffix}\n${m.code}\`\`\``;
318+
const dynamicSection = `**Dynamic:**\n\n\`\`\`${langTag}${metaSuffix}\n${dynamicCode}\n\`\`\``;
315319

316320
return {
317321
original: m.fullMatch,

0 commit comments

Comments
 (0)