Class: Jekyll::AgentMarkdown::LlmsIndexRenderer

Inherits:
Object
  • Object
show all
Includes:
Filters::URLFilters, Liquid::StandardFilters
Defined in:
lib/jekyll/agent_markdown/llms_index_renderer.rb

Instance Method Summary collapse

Constructor Details

#initialize(site, settings, documents) ⇒ LlmsIndexRenderer

Returns a new instance of LlmsIndexRenderer.



18
19
20
21
22
23
# File 'lib/jekyll/agent_markdown/llms_index_renderer.rb', line 18

def initialize(site, settings, documents)
  @site = site
  @settings = settings
  @index = LlmsDocumentIndex.new(settings, documents)
  @context = Liquid::Context.new({}, {}, { site: site })
end

Instance Method Details

#to_sObject



25
26
27
28
29
30
31
# File 'lib/jekyll/agent_markdown/llms_index_renderer.rb', line 25

def to_s
  return legacy_index if index.default_compatibility?

  sections = [LlmsHeadings.new(site, settings).to_s(include_articles: false)] +
             index.sections.map { |section| render_section(section) }
  "#{sections.reject(&:empty?).join("\n\n")}\n"
end