@@ -85,16 +85,24 @@ def get_description_content(file_path):
85
85
return " " .join (description_lines ) if description_lines else None
86
86
87
87
def get_full_content (file_path ):
88
- """Extract the full content from a file, skipping YAML frontmatter."""
88
+ """Extract the full content from a file, skipping YAML frontmatter and first heading ."""
89
89
with open (file_path , 'r' , encoding = 'utf-8' ) as f :
90
90
content_lines = []
91
91
in_frontmatter = False
92
+ first_heading_skipped = False
93
+
92
94
for line in f :
93
95
if line .strip ().startswith ("---" ):
94
96
in_frontmatter = not in_frontmatter
95
97
continue
96
98
if in_frontmatter :
97
99
continue
100
+
101
+ # Skip the first heading (starts with #)
102
+ if not first_heading_skipped and line .strip ().startswith ("#" ):
103
+ first_heading_skipped = True
104
+ continue
105
+
98
106
content_lines .append (line .rstrip ())
99
107
100
108
# Join and clean up the content
@@ -216,7 +224,7 @@ def generate_toc(nodes, depth=0):
216
224
return toc_lines
217
225
218
226
def generate_llms_toc (nodes , base_url = "https://docs.ensembleui.com" ):
219
- """Generate table of contents in llms.txt format (Cursor style) ."""
227
+ """Generate table of contents in llms.txt format."""
220
228
lines = []
221
229
222
230
for node in nodes :
@@ -304,7 +312,7 @@ def get_url_path(file_path):
304
312
return url_path
305
313
306
314
def generate_full_docs (pages , base_url = "https://docs.ensembleui.com" ):
307
- """Generate full documentation content in llms-full.txt format (Cursor style) ."""
315
+ """Generate full documentation content in llms-full.txt format."""
308
316
content_blocks = []
309
317
310
318
for page in pages :
@@ -317,8 +325,8 @@ def generate_full_docs(pages, base_url="https://docs.ensembleui.com"):
317
325
# Get full content
318
326
full_content = get_full_content (file_path )
319
327
320
- # Format as Cursor does: # Title \n Source: URL \n Content
321
- block = f"# { title } \n Source: { url } \n { full_content } "
328
+ # Format as does: # Title \n Source: URL \n Content
329
+ block = f"# { title } \n Source: { url } \n \n { full_content } \n "
322
330
content_blocks .append (block )
323
331
324
332
return content_blocks
@@ -497,7 +505,7 @@ def resolve_entry_path_custom(dir_path, name):
497
505
toc_content = generate_llms_toc (structure )
498
506
toc_lines .extend (toc_content )
499
507
500
- # Add optional section at the end (like Cursor does)
508
+ # Add optional section at the end
501
509
toc_lines .append ("" )
502
510
toc_lines .append ("## Optional" )
503
511
toc_lines .append ("" )
0 commit comments