Class: SiSU_HTML_Format::ParagraphNumber

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

Instance Method Summary collapse

Constructor Details

#initialize(md, ocn) ⇒ ParagraphNumber

Returns a new instance of ParagraphNumber.



58
59
60
61
62
# File 'lib/sisu/html_format.rb', line 58

def initialize(md,ocn)
  @md,@ocn=md,ocn.to_s
  @ocn ||=''
  @make=SiSU_Env::ProcessingSettings.new(@md)
end

Instance Method Details

#gotoObject



87
88
89
90
# File 'lib/sisu/html_format.rb', line 87

def goto
  (@ocn==nil || @ocn.empty?) \
  ? '' : %{<a href="##{@ocn}">}
end

#idObject

w3c? “tidy” complains about numbers as identifiers ! annoying



83
84
85
86
# File 'lib/sisu/html_format.rb', line 83

def id #w3c? "tidy" complains about numbers as identifiers ! annoying
  (@ocn==nil || @ocn.empty?) \
  ? '' : %{id="#{Mx[:ocn_id_char]}#{@ocn}"}
end

#nameObject



75
76
77
78
79
80
81
82
# File 'lib/sisu/html_format.rb', line 75

def name
  if @make.build.html_strict? \
  or @ocn==(nil || @ocn.empty?)
    ''
  else
    %{<a name="#{@ocn}"></a>}
  end
end

#ocn_displayObject



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/sisu/html_format.rb', line 63

def ocn_display
  if @make.build.ocn?
    if @ocn.to_i==0 \
    or @ocn.empty?
      ''
    else
      %{<label class="ocn"><a href="##{@ocn}" class="lnkocn">#{@ocn}</a></label>}
    end
  else
    ''
  end
end