})
# para=@sto[:lev_para_ocn].scrPara
#when /^(b|bold)$/i
# para.gsub!(/(.+)/,
# %{(\\1)})
# para=@sto[:lev_para_ocn].scrPara
#when /null/ # see whether u can improve
# if (para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/)
# #format_scroll.gsubBody
# #para=@sto[:lev_para_ocn].scrPara
# end
else
if para =~ /<:verse>/
poem_structure(para)
elsif para =~ /<:group>/
group_structure(para)
elsif para =~ /<:code>/
para.gsub!(/,'<')
para.gsub!(/>/,'>')
code_structure(para)
elsif para =~// and para =~/^(-\{{2}~\d+|)/ # -endnote
if para =~/.*<:#>.*$/
para=case para
when /<:i1>/
format_text=Format_text_object.new(para,'')
format_text.scr_inden_ocn_e_no_paranum
when /<:i2>/
format_text=Format_text_object.new(para,'')
format_text.scr_inden_ocn_e_no_paranum
end
end
if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
# i don't get the condition for no paranum
end
if para =~/<:center>/
one,two=/(.*)<:center>(.*)/.match(para)[1,2]
format_text=Format_text_object.new(one,two)
para=format_text.center
end
end
para.gsub!(/<:\S+?>/,'')
para.gsub!(//,'') ## Clean Prepared Text #bugwatch reinstate
end
end
6.downto(4) do |x|
y=x - 1; v=x - 3
@@xml[:body] << "#{@tab*5}\n#{@tab*y}\n" if @level[x] == true
end
3.downto(1) do |x|
y=x - 1
@@xml[:body] << "#{@tab*y}\n" if @level[x] == true
end
#6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}\n" if @level[x] == true }
end
def pre
rdf=SiSU_XML_tags::RDF.new(@md)
dir=SiSU_Env::Info_env.new
@@xml[:head],@@xml[:body]=[],[]
css=SiSU_Env::CSS_select.new(@md).xml_sax
encoding=if @sys.locale =~/utf-?8/i; ''
else ''
end
@@xml[:open] =<
#{rdf.comment_xml_sax}
WOK
@@xml[:head] << "\n"
@@xml[:body] << "\n"
end
def post
@@xml[:head] << @@xml[:sc]
@@xml[:head] << "\n"
@@xml[:body] << "\n"
@@xml[:close] = "\n"
end
def publish
content=[]
data=@data
content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]
content << @@xml[:owner_details] if @md.stmp =~/\w\w/
content << @@xml[:tail] << @@xml[:close]
Output.new(content.to_s,@md).xml
@@xml={}
end
end
class Output
include SiSU_Param
include SiSU_Env
def initialize(data,md)
@data,@md=data,md
end
def xml
@sisu=[]
@data.each do |para|
para.gsub!(/<:\S+?>/,'')
para.gsub!(//,'')
para="#{para}\n" unless para.empty?
@sisu << para
end
new_file_data=@sisu.to_s
@sisu=new_file_data.scan(/.+/)
SiSU_Env::SiSU_file.new(@md).mkdir
filename_sxm=SiSU_Env::SiSU_file.new(@md,@md.fn[:sxs]).mkfile_pwd
if filename_sxm.class == File
@sisu.each {|para| filename_sxm.puts para}
filename_sxm.close
else puts 'file not created, is directory writable?'
end
end
end
class Tidy
def initialize(md,dir)
@md,@env=md,dir
@prog=SiSU_Env::Info_program.new
end
def xml
if @prog.tidy !=false #note values can be other than true
if @md.cmd =~/[VM]/
tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure')
tell.colorize unless @md.cmd =~/q/
tell.grey_open unless @md.cmd =~/q/
tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
tidy =SiSU_Env::System_call.new("#{Dir.pwd}/#{@md.fn[:sxs]}",tidyfile)
tidy.well_formed?
tell.p_off unless @md.cmd =~/q/
end
end
end
end
end
end
__END__