Class: Slidict::Lint::Linter

Inherits:
Object
  • Object
show all
Defined in:
lib/slidict/lint/linter.rb

Overview

Orchestrates a lint run: splits the raw deck source into slides and asks the LLM client to diagnose the presentation's structure.

Defined Under Namespace

Classes: Error

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Linter

Returns a new instance of Linter.



10
11
12
# File 'lib/slidict/lint/linter.rb', line 10

def initialize(client:)
  @client = client
end

Instance Method Details

#lint(content, format: "markdown", translate: nil) ⇒ Object

Raises:



14
15
16
17
18
19
# File 'lib/slidict/lint/linter.rb', line 14

def lint(content, format: "markdown", translate: nil)
  slides = SlideParser.parse(content, format: format)
  raise Error, "no slides found in the given file" if slides.empty?

  @client.lint_slides(slides, translate: translate)
end