Class: SiSU_XHTML_EPUB2_Format::ParagraphNumber
- Inherits:
-
Object
- Object
- SiSU_XHTML_EPUB2_Format::ParagraphNumber
- Defined in:
- lib/sisu/xhtml_epub2_format.rb
Instance Method Summary collapse
- #goto ⇒ Object
-
#id ⇒ Object
w3c? “tidy” complains about numbers as identifiers ! annoying.
-
#initialize(md, ocn) ⇒ ParagraphNumber
constructor
A new instance of ParagraphNumber.
- #name ⇒ Object
- #ocn_display ⇒ Object
Constructor Details
#initialize(md, ocn) ⇒ ParagraphNumber
Returns a new instance of ParagraphNumber.
59 60 61 62 |
# File 'lib/sisu/xhtml_epub2_format.rb', line 59 def initialize(md,ocn) @md,@ocn=md,ocn.to_s @ocn ||='' end |
Instance Method Details
#goto ⇒ Object
85 86 87 |
# File 'lib/sisu/xhtml_epub2_format.rb', line 85 def goto (@ocn==nil || @ocn.empty?) ? '' : %{<a href="##{@ocn}">} end |
#id ⇒ Object
w3c? “tidy” complains about numbers as identifiers ! annoying
82 83 84 |
# File 'lib/sisu/xhtml_epub2_format.rb', line 82 def id #w3c? "tidy" complains about numbers as identifiers ! annoying (@ocn==nil || @ocn.empty?) ? '' : %{id="o#{@ocn}"} end |
#name ⇒ Object
79 80 81 |
# File 'lib/sisu/xhtml_epub2_format.rb', line 79 def name (@ocn==nil || @ocn.empty?) ? '' : %{<a name="#{@ocn}"></a>} end |
#ocn_display ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/sisu/xhtml_epub2_format.rb', line 63 def ocn_display make=SiSU_Env::ProcessingSettings.new(@md) if make.build.ocn? ocn_class='ocn' if @ocn==nil \ or @ocn.to_i==0 \ or @ocn.empty? %{<label class="ocn_off"></label>} else @ocn.gsub(/^(\d+|)$/, %{<label class="#{ocn_class}"><a href="#o\\1" class="lnk#{ocn_class}">\\1</a></label>}) end else %{<label class="ocn_off"></label>} end end |