Class: Giblish::BasicIndexBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/giblish/buildindex.rb

Overview

Base class with common functionality for all index builders

Direct Known Subclasses

GitRepoIndexBuilder, SimpleIndexBuilder

Instance Method Summary collapse

Constructor Details

#initialize(processed_docs, converter, path_manager, deployment_info, handle_docid = false) ⇒ BasicIndexBuilder

set up the basic index building info



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/giblish/buildindex.rb', line 12

def initialize(processed_docs, converter, path_manager, deployment_info, handle_docid = false)
  @paths = path_manager
  @deployment_info = deployment_info
  @nof_missing_titles = 0
  @processed_docs = processed_docs
  @converter = converter
  @src_str = ""
  @manage_docid = handle_docid
  @search_opts = {
    web_assets_top: @deployment_info.web_path,
    search_assets_top: @deployment_info.search_assets_path
  }
end

Instance Method Details

#source(dep_graph_exists: false, make_searchable: false) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/giblish/buildindex.rb', line 26

def source(dep_graph_exists: false, make_searchable: false)
  <<~DOC_STR
    #{generate_title_and_header}

    #{generate_date_info}

    #{add_search_box if make_searchable}

    #{add_docid_info if @manage_docid}

    #{add_depgraph_id if dep_graph_exists}

    #{generate_tree}

    #{generate_details}

    #{generate_footer}
  DOC_STR
end