Sha256: 41ab14e89ee6e20b62645bd96cec21abe0ca9029b635a244036651bea6317e9a

Contents?: true

Size: 774 Bytes

Versions: 15

Compression:

Stored size: 774 Bytes

Contents

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 && 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

15 entries across 15 versions & 1 rubygems

Version Path
jazzy-0.13.7 lib/jazzy/documentation_generator.rb
jazzy-0.13.6 lib/jazzy/documentation_generator.rb
jazzy-0.13.5 lib/jazzy/documentation_generator.rb
jazzy-0.13.4 lib/jazzy/documentation_generator.rb
jazzy-0.13.3 lib/jazzy/documentation_generator.rb
jazzy-0.13.2 lib/jazzy/documentation_generator.rb
jazzy-0.13.1 lib/jazzy/documentation_generator.rb
jazzy-0.13.0 lib/jazzy/documentation_generator.rb
jazzy-0.12.0 lib/jazzy/documentation_generator.rb
jazzy-0.11.2 lib/jazzy/documentation_generator.rb
jazzy-0.11.1 lib/jazzy/documentation_generator.rb
jazzy-0.11.0 lib/jazzy/documentation_generator.rb
jazzy-0.10.0 lib/jazzy/documentation_generator.rb
jazzy-0.9.6 lib/jazzy/documentation_generator.rb
jazzy-0.9.5 lib/jazzy/documentation_generator.rb