Class: RDoc::Generator::Aliki

Inherits:
Darkfish
  • Object
show all
Defined in:
lib/rdoc/generator/aliki.rb

Overview

Aliki theme for RDoc documentation

Author: Stan Lo

Constant Summary

Constants inherited from Darkfish

Darkfish::BUILTIN_STYLE_ITEMS, Darkfish::DESCRIPTION, Darkfish::ParagraphExcerptRegexpOther, Darkfish::ParagraphExcerptRegexpUnicode, Darkfish::VERSION

Instance Attribute Summary

Attributes inherited from Darkfish

#asset_rel_path, #base_dir, #classes, #dry_run, #file_output, #files, #json_index, #methods, #modsort, #outputdir, #store, #template_dir

Instance Method Summary collapse

Methods inherited from Darkfish

#assemble_template, #copy_static, #debug_msg, #excerpt, #gen_sub_directories, #generate, #generate_ancestor_list, #generate_class, #generate_class_files, #generate_class_index_content, #generate_class_link, #generate_file_files, #generate_index, #generate_page, #generate_servlet_not_found, #generate_servlet_root, #generate_table_of_contents, #get_sorted_module_list, #group_classes_by_namespace_for_sidebar, #install_rdoc_static_file, #render, #render_template, #setup, #template_for, #template_result, #traverse_classes

Constructor Details

#initialize(store, options) ⇒ Aliki

Returns a new instance of Aliki.



12
13
14
15
16
# File 'lib/rdoc/generator/aliki.rb', line 12

def initialize(store, options)
  super
  aliki_template_dir = File.expand_path(File.join(__dir__, 'template', 'aliki'))
  @template_dir = Pathname.new(aliki_template_dir)
end

Instance Method Details

#write_style_sheetObject

Copy only the static assets required by the Aliki theme. Unlike Darkfish we don’t ship embedded fonts or image sprites, so limit the asset list to keep generated documentation lightweight.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/rdoc/generator/aliki.rb', line 23

def write_style_sheet
  debug_msg "Copying Aliki static files"
  options = { verbose: $DEBUG_RDOC, noop: @dry_run }

  install_rdoc_static_file @template_dir + 'css/rdoc.css', "./css/rdoc.css", options

  unless @options.template_stylesheets.empty?
    FileUtils.cp @options.template_stylesheets, '.', **options
  end

  Dir[(@template_dir + 'js/**/*').to_s].each do |path|
    next if File.directory?(path)
    next if File.basename(path).start_with?('.')

    dst = Pathname.new(path).relative_path_from(@template_dir)

    install_rdoc_static_file @template_dir + path, dst, options
  end
end