Module: Jazzy::DocumentationGenerator

Extended by:
Config::Mixin
Defined in:
lib/jazzy/documentation_generator.rb

Class Method Summary collapse

Methods included from Config::Mixin

config

Class Method Details

.documentation_entriesObject



28
29
30
31
32
33
# File 'lib/jazzy/documentation_generator.rb', line 28

def self.documentation_entries
  return [] unless
    config.documentation_glob_configured && config.documentation_glob

  config.documentation_glob.select { |e| File.file? e }
end

.overview(file_path) ⇒ Object



22
23
24
25
26
# File 'lib/jazzy/documentation_generator.rb', line 22

def self.overview(file_path)
  return '' unless file_path&.exist?

  file_path.read
end

.source_docsObject



12
13
14
15
16
17
18
19
20
# File 'lib/jazzy/documentation_generator.rb', line 12

def self.source_docs
  documentation_entries.map do |file_path|
    SourceDocument.new.tap do |sd|
      sd.name = File.basename(file_path, '.md')
      sd.overview = overview Pathname(file_path)
      sd.usr = "documentation.#{sd.name}"
    end
  end
end