Sha256: 82c5c8d9af108a18c3eb072410791d62a25eba0e1cefaa8cae79d6666ed711bb

Contents?: true

Size: 1.24 KB

Versions: 30

Compression:

Stored size: 1.24 KB

Contents

include T('default/fulldoc/html')

module OverrideFileLinks
  def resolve_links(text)
    result = ''
    log.enter_level(Logger::ERROR) { result = super }
    result
  end
end

Template.extra_includes << OverrideFileLinks

def init
  class << options[:serializer]
    def serialized_path(object)
      if CodeObjects::ExtraFileObject === object
        super.sub(/^file\./, '')
      else
        super
      end
    end
  end if options[:serializer]
  
  generate_assets
  options.delete(:objects)
  options[:files].each {|file| serialize_file(file) }
  serialize_file(options[:readme])
end

def generate_assets
  %w( js/jquery.js js/app.js css/style.css css/common.css ).each do |file|
    asset(file, file(file, true))
  end
end

def serialize_file(file)
  index = options[:files].index(file)
  outfile = file.name + '.html'
  options[:file] = file
  if file.attributes[:namespace]
    options[:object] = Registry.at(file.attributes[:namespace])
  end
  options[:object] ||= Registry.root

  if file == options[:readme]
    serialize_index(options)
  else
    serialize_index(options) if !options[:readme] && index == 0
    Templates::Engine.with_serializer(outfile, options[:serializer]) do
      T('layout').run(options)
    end
  end
  options.delete(:file)
end

Version data entries

30 entries across 30 versions & 4 rubygems

Version Path
challah-0.6.2 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.6.1 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.6.0 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.5.4 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.5.3 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.5.2 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.5.1 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.5.0 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.4.1 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.4.0 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.3.5 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.3.4 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.3.3 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.3.2 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.3.1 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.3.0 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.2.1 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
challah-0.2.0 vendor/bundle/gems/yard-0.7.5/templates/guide/fulldoc/html/setup.rb
yard-0.7.5 templates/guide/fulldoc/html/setup.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/yard-0.7.4/templates/guide/fulldoc/html/setup.rb