Sha256: d1591750ac7cd46322a32ce0b5c5182fd0fe5a622e91e2d24bea03782f637b41

Contents?: true

Size: 1.22 KB

Versions: 38

Compression:

Stored size: 1.22 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

38 entries across 28 versions & 3 rubygems

Version Path
challah-1.0.0.beta3 vendor/bundle/gems/yard-0.8.5.2/templates/guide/fulldoc/html/setup.rb
challah-1.0.0.beta2 vendor/bundle/gems/yard-0.8.5.2/templates/guide/fulldoc/html/setup.rb
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.3/templates/guide/fulldoc/html/setup.rb
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.5.2/templates/guide/fulldoc/html/setup.rb
yard-0.8.5.2 templates/guide/fulldoc/html/setup.rb
yard-0.8.5.1 templates/guide/fulldoc/html/setup.rb
yard-0.8.5 templates/guide/fulldoc/html/setup.rb
challah-0.9.1.beta.3 vendor/bundle/gems/yard-0.8.3/templates/guide/fulldoc/html/setup.rb
yard-0.8.4.1 templates/guide/fulldoc/html/setup.rb
yard-0.8.4 templates/guide/fulldoc/html/setup.rb
challah-0.9.1.beta vendor/bundle/gems/yard-0.8.3/templates/guide/fulldoc/html/setup.rb
challah-0.9.0 vendor/bundle/gems/yard-0.8.3/templates/guide/fulldoc/html/setup.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.3/templates/guide/fulldoc/html/setup.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.2.1/templates/guide/fulldoc/html/setup.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/yard-0.8.2.1/templates/guide/fulldoc/html/setup.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.2.1/templates/guide/fulldoc/html/setup.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.3/templates/guide/fulldoc/html/setup.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.3/templates/guide/fulldoc/html/setup.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.2.1/templates/guide/fulldoc/html/setup.rb
yard-0.8.3 templates/guide/fulldoc/html/setup.rb