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.



60
61
62
63
64
# File 'lib/sisu/html_format.rb', line 60

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

Instance Method Details

#gotoObject



89
90
91
92
# File 'lib/sisu/html_format.rb', line 89

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

#idObject

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



85
86
87
88
# File 'lib/sisu/html_format.rb', line 85

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

#nameObject



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

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

#ocn_displayObject



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

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