Class: SiSU_XHTML::Source::Tidy

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

Instance Method Summary collapse

Constructor Details

#initialize(md, file) ⇒ Tidy

Returns a new instance of Tidy.



429
430
431
432
# File 'lib/sisu/xhtml.rb', line 429

def initialize(md,file)
  @md,@file=md,file
  @prog=SiSU_Env::InfoProgram.new
end

Instance Method Details

#xmlObject



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/sisu/xhtml.rb', line 433

def xml
  if @prog.tidy !=false
    if (@md.opt.act[:verbose_plus][:set]==:on \
    || @md.opt.act[:maintenance][:set]==:on)
      unless @md.opt.act[:quiet][:set]==:on
        SiSU_Screen::Ansi.new(
          @md.opt.act[:color_state][:set],
          'invert',
          'Using XML Tidy',
          'check document structure'
        ).colorize
        tell=SiSU_Screen::Ansi.new(
          @md.opt.act[:color_state][:set],
          'invert',
          '',
          ''
        )
        tell.grey_open
      end
      tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
      tidy=SiSU_Env::SystemCall.new(@file,tidyfile)
      tidy.well_formed?
      tell.p_off unless @md.opt.act[:quiet][:set]==:on
    end
  end
end