Sha256: 641cb87ad2fc5b22f2de04b177a4ed97b47e80dbe6e6b06ae18bef33edb47439

Contents?: true

Size: 795 Bytes

Versions: 9

Compression:

Stored size: 795 Bytes

Contents

# frozen_string_literal: true

require 'pathname'

require 'jazzy/jazzy_markdown'
require 'jazzy/source_document'

module Jazzy
  module DocumentationGenerator
    extend Config::Mixin

    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

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

      file_path.read
    end

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
jazzy-0.15.3 lib/jazzy/documentation_generator.rb
jazzy-0.15.2 lib/jazzy/documentation_generator.rb
jazzy-0.15.1 lib/jazzy/documentation_generator.rb
jazzy-0.15.0 lib/jazzy/documentation_generator.rb
jazzy-0.14.4 lib/jazzy/documentation_generator.rb
jazzy-0.14.3 lib/jazzy/documentation_generator.rb
jazzy-0.14.2 lib/jazzy/documentation_generator.rb
jazzy-0.14.1 lib/jazzy/documentation_generator.rb
jazzy-0.14.0 lib/jazzy/documentation_generator.rb