Class: Jekyll::LlmsOutput::FullBuilder
- Inherits:
-
Object
- Object
- Jekyll::LlmsOutput::FullBuilder
- Defined in:
- lib/jekyll-llms-output/full_builder.rb
Overview
Builds the body of /llms-full.txt: a concatenation of every document’s source markdown, separated by a configurable delimiter, each with a small header (title + url) for context.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(site, options) ⇒ FullBuilder
constructor
A new instance of FullBuilder.
Constructor Details
#initialize(site, options) ⇒ FullBuilder
Returns a new instance of FullBuilder.
11 12 13 14 |
# File 'lib/jekyll-llms-output/full_builder.rb', line 11 def initialize(site, ) @site = site @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/jekyll-llms-output/full_builder.rb', line 9 def @options end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
9 10 11 |
# File 'lib/jekyll-llms-output/full_builder.rb', line 9 def site @site end |
Instance Method Details
#build ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jekyll-llms-output/full_builder.rb', line 16 def build chunks = [] Array(["collections"]).each do |coll_name| collection = site.collections[coll_name.to_s] next unless collection collection.docs.each { |doc| chunks << render_doc(doc) } end if ["pages"] exts = Array(["page_extensions"]).map(&:downcase) site.pages.each do |page| next unless exts.include?(File.extname(page.path).downcase) chunks << render_doc(page) end end chunks.compact.join(["separator"] || "\n\n---\n\n") + "\n" end |