Sha256: ca8ab5c7e6a75b8025b4180252ceed9aa561d2d0638ac74e6107f301476c5d2c

Contents?: true

Size: 619 Bytes

Versions: 27

Compression:

Stored size: 619 Bytes

Contents

module Jazzy
  module SearchBuilder
    def self.build(source_module, output_dir)
      decls = source_module.all_declarations.select do |d|
        d.type && d.name && !d.name.empty?
      end
      index = Hash[decls.map do |d|
        [d.url,
         {
           name: d.name,
           abstract: d.abstract && d.abstract.split(/\n/).map(&:strip).first,
           parent_name: d.parent_in_code && d.parent_in_code.name,
         }.reject { |_, v| v.nil? || v.empty? }]
      end
      ]
      File.open(File.join(output_dir, 'search.json'), 'w') do |f|
        f.write(index.to_json)
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
jazzy-0.13.7 lib/jazzy/search_builder.rb
jazzy-0.13.6 lib/jazzy/search_builder.rb
jazzy-0.13.5 lib/jazzy/search_builder.rb
jazzy-0.13.4 lib/jazzy/search_builder.rb
jazzy-0.13.3 lib/jazzy/search_builder.rb
jazzy-0.13.2 lib/jazzy/search_builder.rb
jazzy-0.13.1 lib/jazzy/search_builder.rb
jazzy-0.13.0 lib/jazzy/search_builder.rb
jazzy-0.12.0 lib/jazzy/search_builder.rb
jazzy-0.11.2 lib/jazzy/search_builder.rb
jazzy-0.11.1 lib/jazzy/search_builder.rb
jazzy-0.11.0 lib/jazzy/search_builder.rb
jazzy-0.10.0 lib/jazzy/search_builder.rb
jazzy-0.9.6 lib/jazzy/search_builder.rb
jazzy-0.9.5 lib/jazzy/search_builder.rb
jazzy-0.9.4 lib/jazzy/search_builder.rb
jazzy-0.9.3 lib/jazzy/search_builder.rb
jazzy-0.9.2 lib/jazzy/search_builder.rb
jazzy-0.9.1 lib/jazzy/search_builder.rb
jazzy-0.9.0 lib/jazzy/search_builder.rb