Class: ConTeXtSetup::Word

Inherits:
Param show all
Defined in:
lib/tex/context/contextsetup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Param

#opt, #optional?, #sanitize_html, #show

Methods inherited from SetupXML

parse_xml, tag_method

Constructor Details

#initialize(interface) ⇒ Word

Returns a new instance of Word.



549
550
551
552
# File 'lib/tex/context/contextsetup.rb', line 549

def initialize(interface)
  @interface=interface
  @list=false
end

Instance Attribute Details

#listObject

Returns the value of attribute list.



545
546
547
# File 'lib/tex/context/contextsetup.rb', line 545

def list
  @list
end

Instance Method Details

#==(other) ⇒ Object



565
566
567
# File 'lib/tex/context/contextsetup.rb', line 565

def ==(other)
  ConTeXtSetup::Word===other && @list==other.list
end

#parse_xml(elt) ⇒ Object



546
547
548
# File 'lib/tex/context/contextsetup.rb', line 546

def parse_xml(elt)
  @list = elt.attributes["list"] == "yes"
end

#to_html(detail = true, cls = "first") ⇒ Object



553
554
555
556
557
558
559
560
561
562
563
564
# File 'lib/tex/context/contextsetup.rb', line 553

def to_html(detail=true,cls="first")
  # this is a hack! cd:word only appears with one argument, so the second td looks ugly
  # TODO: this should be corrected in Command.to_html
  head="{... ...}"
  if detail
    tr { 
      td(:class => cls) { head }
    }
  else
    head
  end
end