@@ -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+
1221export 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 ( / \[ ( [ ^ \] ] + ) \] \( \/ p l a y g r o u n d [ ^ ) ] + \) / 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-
161161const 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
170170function remove_quote_blocks ( content : string , blockType : string ) : string {
0 commit comments