Class: SiSU_Param_Make::MakeHead

Inherits:
Object
  • Object
show all
Defined in:
lib/sisu/dp_make.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(make) ⇒ MakeHead

Returns a new instance of MakeHead.



541
542
543
# File 'lib/sisu/dp_make.rb', line 541

def initialize(make)
  @make=make
end

Instance Attribute Details

#bold_match_listObject

Returns the value of attribute bold_match_list.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def bold_match_list
  @bold_match_list
end

#cover_imageObject

Returns the value of attribute cover_image.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def cover_image
  @cover_image
end

#emphasis_set_toObject

Returns the value of attribute emphasis_set_to.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def emphasis_set_to
  @emphasis_set_to
end

Returns the value of attribute footer_links.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def footer_links
  @footer_links
end

#home_button_imageObject

Returns the value of attribute home_button_image.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def home_button_image
  @home_button_image
end

Returns the value of attribute home_button_links.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def home_button_links
  @home_button_links
end

#i18nObject

Returns the value of attribute i18n.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def i18n
  @i18n
end

#italics_match_listObject

Returns the value of attribute italics_match_list.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def italics_match_list
  @italics_match_list
end

#lv1Object

Returns the value of attribute lv1.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def lv1
  @lv1
end

#lv2Object

Returns the value of attribute lv2.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def lv2
  @lv2
end

#lv3Object

Returns the value of attribute lv3.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def lv3
  @lv3
end

#lv4Object

Returns the value of attribute lv4.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def lv4
  @lv4
end

#lv5Object

Returns the value of attribute lv5.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def lv5
  @lv5
end

#lv6Object

Returns the value of attribute lv6.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def lv6
  @lv6
end

#man_sectionObject

Returns the value of attribute man_section.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def man_section
  @man_section
end

#num_topObject

Returns the value of attribute num_top.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def num_top
  @num_top
end

#pagebreakObject

Returns the value of attribute pagebreak.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def pagebreak
  @pagebreak
end

#pagelineObject

Returns the value of attribute pageline.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def pageline
  @pageline
end

#pagenewObject

Returns the value of attribute pagenew.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def pagenew
  @pagenew
end

#substitution_match_listObject

Returns the value of attribute substitution_match_list.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def substitution_match_list
  @substitution_match_list
end

#tocObject

Returns the value of attribute toc.



540
541
542
# File 'lib/sisu/dp_make.rb', line 540

def toc
  @toc
end

Instance Method Details

#clearObject



544
545
546
# File 'lib/sisu/dp_make.rb', line 544

def clear
  @pagenew=@pagebreak=@pageline=@toc=@lv1=@lv2=@lv3=@lv4=@lv5=@lv6=@num_top=@i18n=@man_section=@footer_links=@substitution_match_list=@bold_match_list=@italics_match_list=@emphasis_set_to=@home_button_links=@home_button_image=@cover_image=nil
end

#make_instructObject



547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
# File 'lib/sisu/dp_make.rb', line 547

def make_instruct
  clear
  if defined? @make.breaks \
  and @make.breaks[:page_new]                  #clearpage
    @pagenew=@make.breaks[:page_new]
  end
  if defined? @make.breaks \
  and @make.breaks[:page_break]                #newpage
    @pagebreak=@make.breaks[:page_break]
  end
  if defined? @make.breaks \
  and @make.breaks[:page_line]                 #page line across
    @pagebreak=@make.breaks[:page_line]
  end
  if defined? @make.headings \
  and @make.headings
    @toc=@make.headings[0]
    @lv1=@make.headings[1]
    @lv2=@make.headings[2]
    @lv3=@make.headings[3]
    @lv4=@make.headings[4]
    @lv5=@make.headings[5]
    @lv6=@make.headings[6]
  end
  if defined? @make.num_top \
  and @make.num_top
    @num_top=@make.num_top # remove @num_top
  end
  if defined? @make.language \
  and @make.language[0]
    @i18n=@make.language
  end
  if defined? @make.manpage \
  and @make.manpage
    @man_section=(defined? @make.manpage.section) \
    ? @make.manpage.section
    : 1
  end
  if defined? @make.substitute \
  and @make.substitute
    @substitution_match_list=@make.substitute
  end
  if defined? @make.bold \
  and @make.bold
    @bold_match_list=@make.bold
  end
  if defined? @make.italics \
  and @make.italics
    @italics_match_list=@make.italics
  end
  if defined? @make.emphasis \
  and @make.emphasis
    @emphasis_set_to=@make.emphasis
  end
  if defined? @make.footer \
  and @make.footer.is_a?(Array)
    @footer_links= { left: { say: '', url: '' }, center: { say: '', url: '' } } #already set
    @footer_links[:left]=if @make.footer[0]=~/\{.+?\}(?:(?:https?|file|ftp):\/|\.\.)\/\S+(?:\s|$)/
      say,url=/\{\s*(.+?)\s*\}((?:(?:https?|file|ftp):\/|\.\.)\/\S+)/im.match(@make.footer[0])[1,2]
      { say: say, url: url }
    else
      { say: '', url: '' }
    end
    @footer_links[:center]=if @make.footer[1]=~/\{.+?\}(?:(?:https?|file|ftp):\/|\.\.)\/\S+(?:\s|$)/
      say,url=/\{\s*(.+?)\s*\}((?:(?:https?|file|ftp):\/|\.\.)\/\S+)/im.match(@make.footer[1])[1,2]
      { say: say, url: url }
    else
      { say: '', url: '' }
    end
    @footer_links
  else #already set
    @footer_links= { left: { say: '', url: '' }, center: { say: '', url: '' } }
  end
  if defined? @make.home_button_text \
  and @make.home_button_text.is_a?(Array)
    a_idx=0
    @home_button_links=[]
    @make.home_button_text.each do |doc_link|
      if doc_link=~/\{.+?\}(?:(?:https?|file|ftp):\/|\.\.)\/\S+(?:\s|$)/
        say,url=/\{\s*(.+?)\s*\}((?:(?:https?|file|ftp):\/|\.\.)\/\S+)/im.match(doc_link)[1,2]
        @home_button_links[a_idx]= { say: say, url: url }
        a_idx +=1
      end
    end
    @home_button_links
  end
  if defined? @make.home_button_image \
  and @make.home_button_image.is_a?(Hash)
    @home_button_image=@make.home_button_image
  end
  if defined? @make.cover_image \
  and @make.cover_image.is_a?(Hash)
    @cover_image=@make.cover_image
  end
  { pagenew: @pagenew,
    pagebreak: @pagebreak,
    pageline: @pageline,
    toc: @toc,
    lv1: @lv1,
    lv2: @lv2,
    lv3: @lv3,
    lv4: @lv4,
    lv5: @lv5,
    lv6: @lv6,
    num_top: @num_top,
    i18n: @i18n,
    emphasis_set_to: @emphasis_set_to,
    bold_match_list: @bold_match_list,
    italics_match_list: @italics_match_list,
    substitution_match_list: @substitution_match_list,
    man_section: @man_section,
    footer_links: @footer_links,
    home_button_links: @home_button_links,
    home_button_image: @home_button_image,
    cover_image: @cover_image,
  }
end