Skip to content

Commit d7f9180

Browse files
committed
snake_case
1 parent 086c48f commit d7f9180

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

apps/svelte.dev/src/lib/server/llms.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ interface GenerateLlmContentOptions {
99
package?: string;
1010
}
1111

12+
interface MinimizeOptions {
13+
remove_legacy: boolean;
14+
remove_note_blocks: boolean;
15+
remove_details_blocks: boolean;
16+
remove_playground_links: boolean;
17+
remove_prettier_ignore: boolean;
18+
normalize_whitespace: boolean;
19+
}
20+
1221
export function generate_llm_content(options: GenerateLlmContentOptions = {}): string {
1322
const { prefix, ignore = [], minimize: minimizeOptions, package: pkg } = options;
1423

@@ -74,31 +83,31 @@ function minimize_content(content: string, options?: Partial<MinimizeOptions>):
7483

7584
let minimized = content;
7685

77-
if (settings.removeLegacy) {
86+
if (settings.remove_legacy) {
7887
minimized = remove_quote_blocks(minimized, 'LEGACY');
7988
}
8089

81-
if (settings.removeNoteBlocks) {
90+
if (settings.remove_note_blocks) {
8291
minimized = remove_quote_blocks(minimized, 'NOTE');
8392
}
8493

85-
if (settings.removeDetailsBlocks) {
94+
if (settings.remove_details_blocks) {
8695
minimized = remove_quote_blocks(minimized, 'DETAILS');
8796
}
8897

89-
if (settings.removePlaygroundLinks) {
98+
if (settings.remove_playground_links) {
9099
// Replace playground URLs with /[link] but keep the original link text
91100
minimized = minimized.replace(/\[([^\]]+)\]\(\/playground[^)]+\)/g, '[$1](/REMOVED)');
92101
}
93102

94-
if (settings.removePrettierIgnore) {
103+
if (settings.remove_prettier_ignore) {
95104
minimized = minimized
96105
.split('\n')
97106
.filter((line) => line.trim() !== '<!-- prettier-ignore -->')
98107
.join('\n');
99108
}
100109

101-
if (settings.normalizeWhitespace) {
110+
if (settings.normalize_whitespace) {
102111
minimized = minimized.replace(/\s+/g, ' ');
103112
}
104113

@@ -149,22 +158,13 @@ function sort_documentation_paths(): string[] {
149158
});
150159
}
151160

152-
interface MinimizeOptions {
153-
removeLegacy: boolean;
154-
removeNoteBlocks: boolean;
155-
removeDetailsBlocks: boolean;
156-
removePlaygroundLinks: boolean;
157-
removePrettierIgnore: boolean;
158-
normalizeWhitespace: boolean;
159-
}
160-
161161
const defaultOptions: MinimizeOptions = {
162-
removeLegacy: false,
163-
removeNoteBlocks: false,
164-
removeDetailsBlocks: false,
165-
removePlaygroundLinks: false,
166-
removePrettierIgnore: false,
167-
normalizeWhitespace: false
162+
remove_legacy: false,
163+
remove_note_blocks: false,
164+
remove_details_blocks: false,
165+
remove_playground_links: false,
166+
remove_prettier_ignore: false,
167+
normalize_whitespace: false
168168
};
169169

170170
function remove_quote_blocks(content: string, blockType: string): string {

apps/svelte.dev/src/routes/llms-small.txt/+server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ export function GET() {
2525
'../../../content/docs/kit/60-appendix/**/*.md'
2626
],
2727
minimize: {
28-
removeLegacy: true,
29-
removeNoteBlocks: true,
30-
removeDetailsBlocks: true,
31-
removePlaygroundLinks: true,
32-
removePrettierIgnore: true,
33-
normalizeWhitespace: true
28+
remove_legacy: true,
29+
remove_note_blocks: true,
30+
remove_details_blocks: true,
31+
remove_playground_links: true,
32+
remove_prettier_ignore: true,
33+
normalize_whitespace: true
3434
}
3535
});
3636
const content = `<SYSTEM>This is the abridged developer documentation for Svelte and SvelteKit.</SYSTEM>\n\n${main_content}`;

0 commit comments

Comments
 (0)