Class: Slidict::Cli::Lint

Inherits:
Object
  • Object
show all
Includes:
Options
Defined in:
lib/slidict/cli/lint.rb

Overview

Implements slidict lint <file>: diagnoses whether a Markdown/Asciidoc slide deck has a structure that an audience can actually follow (not whether it looks nice). Diagnosis only -- it does not rewrite the file.

Constant Summary collapse

ASCIIDOC_EXTENSIONS =
%w[.adoc .asciidoc].freeze

Constants included from Options

Options::FAILURE, Options::MISSING, Options::SUCCESS

Instance Method Summary collapse

Methods included from Options

included

Instance Method Details

#run(argv) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/slidict/cli/lint.rb', line 27

def run(argv)
  options = parse(argv)
  return print_help if options[:help] || options[:path].nil?
  return file_not_found(options[:path]) unless File.exist?(options[:path])

  run_lint(options)
rescue ArgumentError => e
  print_usage_error(e)
rescue Slidict::Lint::Linter::Error, Llm::Client::Error => e
  print_error(e)
end