Sha256: 5ab1318fc99f17f202c9d8eb6479ca662d9f08f470dc526ab2d05a51fa938b8c

Contents?: true

Size: 1.89 KB

Versions: 68

Compression:

Stored size: 1.89 KB

Contents

def init
  @breadcrumb = []
  if @onefile
    sections :layout
  elsif @file
    if @file.attributes[:namespace]
      @object = options.object = Registry.at(@file.attributes[:namespace]) || Registry.root
    end
    @breadcrumb_title = "File: " + @file.title
    @page_title = @breadcrumb_title
    sections :layout, [:diskfile]
  elsif @contents
    sections :layout, [:contents]
  else
    case object
    when '_index.html'
      @page_title = options.title
      sections :layout, [:index, [:listing, [:files, :objects]]]
    when CodeObjects::Base
      unless object.root?
        cur = object.namespace
        while !cur.root?
          @breadcrumb.unshift(cur)
          cur = cur.namespace
        end
      end

      @page_title = format_object_title(object)
      type = object.root? ? :module : object.type
      sections :layout, [T(type)]
    end
  end
end

def contents
  @contents
end

def index
  @objects_by_letter = {}
  objects = Registry.all(:class, :module).sort_by {|o| o.name.to_s }
  objects = run_verifier(objects)
  objects.each {|o| (@objects_by_letter[o.name.to_s[0,1].upcase] ||= []) << o }
  erb(:index)
end

def diskfile
  @file.attributes[:markup] ||= markup_for_file('', @file.filename)
  data = htmlify(@file.contents, @file.attributes[:markup])
  "<div id='filecontents'>" + data + "</div>"
end

# @return [Array<String>] core javascript files for layout
# @since 0.7.0
def javascripts
  %w(js/jquery.js js/app.js)
end

# @return [Array<String>] core stylesheets for the layout
# @since 0.7.0
def stylesheets
  %w(css/style.css css/common.css)
end

# @return [Array<Hash{Symbol=>String}>] the list of search links and drop-down menus
# @since 0.7.0
def menu_lists
[ { :type => 'class', :title => 'Classes', :search_title => 'Class List' },
  { :type => 'method', :title => 'Methods', :search_title => 'Method List' },
  { :type => 'file', :title => 'Files', :search_title => 'File List' } ]
end

Version data entries

68 entries across 52 versions & 7 rubygems

Version Path
yard-0.8.7.6 templates/default/layout/html/setup.rb
yard-0.8.7.5 templates/default/layout/html/setup.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/templates/default/layout/html/setup.rb
climine-0.0.7 vendor/bundle/ruby/2.1.0/gems/yard-0.8.7.3/templates/default/layout/html/setup.rb
climine-0.0.6 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/templates/default/layout/html/setup.rb
climine-0.0.5 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/templates/default/layout/html/setup.rb
yard-0.8.7.4 templates/default/layout/html/setup.rb
climine-0.0.4 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/templates/default/layout/html/setup.rb
climine-0.0.3 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/templates/default/layout/html/setup.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/yard-0.8.7.3/templates/default/layout/html/setup.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/templates/default/layout/html/setup.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/templates/default/layout/html/setup.rb
climine-0.0.2 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/templates/default/layout/html/setup.rb
climine-0.0.1 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/templates/default/layout/html/setup.rb
yard-0.8.7.3 templates/default/layout/html/setup.rb
yard-0.8.7.2 templates/default/layout/html/setup.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/yard-0.8.7/templates/default/layout/html/setup.rb
candlepin-api-0.4.0 bundle/ruby/gems/yard-0.8.7/templates/default/layout/html/setup.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/yard-0.8.7/templates/default/layout/html/setup.rb
yard-0.8.7.1 templates/default/layout/html/setup.rb