@@ -46,9 +46,7 @@ module.exports = function pluginLlmMarkdown(context, options) {
4646 fs . mkdirSync ( outputDir , { recursive : true } ) ;
4747
4848 // Create header with reference to llms.txt index
49- const header = `# ${ getTitle ( fileContent , file ) }
50-
51- > ## Documentation Index
49+ const header = `> ## Documentation Index
5250> Fetch the complete documentation index at: ${ siteUrl } /llms.txt
5351> Use this file to discover all available pages before exploring further.
5452
@@ -67,14 +65,9 @@ module.exports = function pluginLlmMarkdown(context, options) {
6765 markdownUrls . sort ( ) ;
6866
6967 // Generate llms.txt
70- const llmsTxtContent = `# Dappnode Documentation - LLM Markdown Index
71- # Generated: ${ new Date ( ) . toISOString ( ) }
72- #
73- # This file lists all documentation pages available in plain markdown format.
74- # These URLs return raw markdown content optimized for LLM consumption.
75- #
76- # Usage: Append .md to any documentation URL to get the markdown version.
77- # Example: ${ siteUrl } /docs/dao -> ${ siteUrl } /docs/dao.md
68+ const llmsTxtContent = `# Knowledge Base
69+
70+ ## Docs
7871
7972${ markdownUrls . join ( '\n' ) }
8073` ;
@@ -95,30 +88,3 @@ function stripFrontmatter(content) {
9588 return content . replace ( frontmatterRegex , '' ) ;
9689}
9790
98- /**
99- * Extract title from frontmatter or filename
100- */
101- function getTitle ( content , filename ) {
102- // Try to get title from frontmatter
103- const frontmatterMatch = content . match ( / ^ - - - \r ? \n ( [ \s \S ] * ?) \r ? \n - - - / ) ;
104- if ( frontmatterMatch ) {
105- const titleMatch = frontmatterMatch [ 1 ] . match ( / ^ t i t l e : \s * [ " ' ] ? ( .+ ?) [ " ' ] ? \s * $ / m) ;
106- if ( titleMatch ) {
107- return titleMatch [ 1 ] ;
108- }
109- }
110-
111- // Try to get title from first heading
112- const headingMatch = content . match ( / ^ # \s + ( .+ ) $ / m) ;
113- if ( headingMatch ) {
114- return headingMatch [ 1 ] ;
115- }
116-
117- // Fall back to filename
118- return filename
119- . replace ( / \. m d x ? $ / , '' )
120- . split ( '/' )
121- . pop ( )
122- . replace ( / - / g, ' ' )
123- . replace ( / \b \w / g, c => c . toUpperCase ( ) ) ;
124- }
0 commit comments