Skip to content

Commit bf273e9

Browse files
committed
fix(llms): Remove 'Download section' and fix redundant headings in section markdown
- Comment out 'Download section' UI option (not yet implemented) - Comment out handleDownloadSection function - Strip first H1 heading from child pages to avoid duplication - Child pages now only show H2 heading when aggregated This fixes the issue where section markdown showed both: ## Page Title (our H2) # Page Title (original H1 from child page content)
1 parent 258c18b commit bf273e9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

assets/js/components/format-selector.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,16 @@ export default function FormatSelector(options: ComponentOptions) {
290290

291291
/**
292292
* Handle download section action
293+
* Commented out - not yet implemented
293294
*/
295+
/*
294296
function handleDownloadSection(): void {
295297
if (config.sectionDownloadUrl) {
296298
window.open(config.sectionDownloadUrl, '_self');
297299
closeDropdown();
298300
}
299301
}
302+
*/
300303

301304
/**
302305
* Handle external link action
@@ -374,7 +377,9 @@ export default function FormatSelector(options: ComponentOptions) {
374377
dataAttribute: 'open-claude',
375378
});
376379

377-
// Option 4: Download section (conditional - only for large sections)
380+
// Future: Download section option
381+
// Commented out - not yet implemented
382+
/*
378383
if (config.pageType === 'branch') {
379384
const shouldShowDownload =
380385
(config.childPageCount && config.childPageCount > 10) ||
@@ -392,6 +397,7 @@ export default function FormatSelector(options: ComponentOptions) {
392397
});
393398
}
394399
}
400+
*/
395401

396402
// Future: MCP server options
397403
// Commented out for now - will be implemented as future enhancement

scripts/html-to-markdown.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,10 @@ function aggregateSectionMarkdown(sectionHtmlPath) {
520520
.replace(/\* \* \*\s*$/g, '')
521521
.trim();
522522

523+
// Remove the first h1 heading (page title) to avoid redundancy
524+
// since we're adding it as an h2 heading
525+
childMarkdown = childMarkdown.replace(/^#\s+.+?\n+/, '');
526+
523527
// Add child page title as heading
524528
childContents.push(`## ${childMetadata.title}\n\n${childMarkdown}`);
525529
}

0 commit comments

Comments
 (0)