From 7432be8dad0ea16d001c9b244b141338c14b4883 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 2 Jul 2007 11:33:44 +0100 Subject: * dal, auto-numbering (minor) fix for segments/headings * cosmetic fixes, * screen output of project name * screen output when generating tex pdf * debian documents skins * html indent levels, regular and bulleted text --- lib/sisu/v0/css.rb | 106 ++++++++++++++++++----------------------------- lib/sisu/v0/dal.rb | 66 ++++++++++++++--------------- lib/sisu/v0/semantics.rb | 2 +- 3 files changed, 75 insertions(+), 99 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/css.rb b/lib/sisu/v0/css.rb index 85084e45..abe14da1 100644 --- a/lib/sisu/v0/css.rb +++ b/lib/sisu/v0/css.rb @@ -439,76 +439,43 @@ WOK font-family: #{fonts}; /* font-size: 100%; */ font-weight: normal; - line-height: 100%; + line-height: 150%; text-align: left; margin-left: 10mm; text-indent: 0mm; - margin-top: 0px; - margin-bottom: 0px; - margin-right: 5mm; - } - li.bullet { - line-height: 150%; - margin-left: 0mm; - margin-right: 0mm; margin-top: 3px; margin-bottom: 3px; + margin-right: 0mm; + } + li.bullet { + margin-left: 10mm; } li.i1 { - margin-left: 20mm; - line-height: 150%; - margin-left: 5mm; - margin-right: 5mm; - margin-top: 3px; - margin-bottom: 3px; + margin-left: 15mm; } li.i2 { - margin-left: 25mm; - line-height: 150%; - margin-top: 3px; - margin-bottom: 3px; + margin-left: 20mm; } li.i3 { - margin-left: 30mm; - line-height: 150%; - margin-top: 3px; - margin-bottom: 3px; + margin-left: 25mm; } li.i4 { - margin-left: 35mm; - line-height: 150%; - margin-top: 3px; - margin-bottom: 3px; + margin-left: 30mm; } li.i5 { - margin-left: 40mm; - line-height: 150%; - margin-top: 3px; - margin-bottom: 3px; + margin-left: 35mm; } li.i6 { - margin-left: 45mm; - line-height: 150%; - margin-top: 3px; - margin-bottom: 3px; + margin-left: 40mm; } li.i7 { - margin-left: 50mm; - line-height: 150%; - margin-top: 3px; - margin-bottom: 3px; + margin-left: 45mm; } li.i8 { - margin-left: 55mm; - line-height: 150%; - margin-top: 3px; - margin-bottom: 3px; + margin-left: 50mm; } li.i9 { - margin-left: 60mm; - line-height: 150%; - margin-top: 3px; - margin-bottom: 3px; + margin-left: 55mm; } #horizontal_links { background: #eeeeee; @@ -1385,59 +1352,68 @@ WOK font-weight: bold; text-align: left; } - text[class|="indent1"] { + text[class|="indent0"] { margin-left: 10%; } - text[class|="indent2"] { + text[class|="indent1"] { margin-left: 15%; } - text[class|="indent3"] { + text[class|="indent2"] { margin-left: 20%; } - text[class|="indent4"] { + text[class|="indent3"] { margin-left: 25%; } - text[class|="indent5"] { + text[class|="indent4"] { margin-left: 30%; } - text[class|="indent6"] { + text[class|="indent5"] { margin-left: 35%; } - text[class|="indent7"] { + text[class|="indent6"] { margin-left: 40%; } - text[class|="indent8"] { + text[class|="indent7"] { margin-left: 45%; } - text[class|="indent9"] { + text[class|="indent8"] { margin-left: 50%; } + text[class|="indent9"] { + margin-left: 55%; + } + text[class|="indent_bullet"] { + text-indent: 0%; + } + text[class|="indent_bullet0"] { + text-indent: 0%; + } text[class|="indent_bullet1"] { - margin-left: 10%; + text-indent: 10%; } text[class|="indent_bullet2"] { - margin-left: 15%; + text-indent: 15%; } text[class|="indent_bullet3"] { - margin-left: 20%; + text-indent: 20%; } text[class|="indent_bullet4"] { - margin-left: 25%; + text-indent: 25%; } text[class|="indent_bullet5"] { - margin-left: 30%; + text-indent: 30%; } text[class|="indent_bullet6"] { - margin-left: 35%; + text-indent: 35%; } text[class|="indent_bullet7"] { - margin-left: 40%; + text-indent: 40%; } text[class|="indent_bullet8"] { - margin-left: 45%; + text-indent: 45%; } text[class|="indent_bullet9"] { - margin-left: 50%; + text-indent: 50%; } text[class|="verse"], text[class|="group"], text[class|="code"] { text-align: left; diff --git a/lib/sisu/v0/dal.rb b/lib/sisu/v0/dal.rb index a70d1880..8880ca9d 100644 --- a/lib/sisu/v0/dal.rb +++ b/lib/sisu/v0/dal.rb @@ -516,7 +516,9 @@ module SiSU_DAL when /^#{num}~#\s*/; para.gsub!(/^#{num}~#\s*/,"#{title_no} ") when /^#{num}~[a-z_\.]+ / para.gsub!(/^#{num}~([a-z_\.]+)\s+(.+)/i,%{#{num}~\\1 #{title_no} \\2 <:name##{title_no}>}) - else para.gsub!(/^#{num}~ /,"#{num}~#{title_no} #{title_no} ") #main + when /^#{num}~\s+#{title_no}/ + para.gsub!(/^#{num}~ /,"#{num}~#{title_no} ") #where title contains title number + else para.gsub!(/^#{num}~ /,"#{num}~#{title_no} #{title_no} ") #main, where title number is to be provided end if @md.toc_lev_limit and @md.toc_lev_limit < num para.gsub!(/^[5-8]~(?:~\S+)?\s*/,'!_ ') @@ -649,41 +651,39 @@ module SiSU_DAL puts 'manual segment names, numbers used as names, risk warning (segmented html)' if not @md.seg_autoname_safe and @md.cmd =~/[MV]/ data.each do |para| para=SiSU_document_structure::Structure.new(@md,para).structure_markup - if para !~/^0~/ - if para =~/^[456]~ / - if para=~/^4/ and not @md.set_heading_seg - @md.set_heading_seg=true - end - if para =~/^[456]~(?:\s\S+)?\s+([\d.,:-]+)/m #heading starts with a recognised numeric or word followed by a recognised numerical construct, use that as name - pattern=$1 - pattern.gsub!(/(?:[:,-]|\W)/,'.') - pattern.gsub!(/\.$/,'') - if not @md.seg_names.nil? and not @md.seg_names.include?(pattern) - para.gsub!(/^([456])~\s*/,"\\1~#{pattern} ") - @md.seg_names << pattern - else puts 'warn, there may be a conflicting numbering scheme' if @md.cmd =~/[VM]/ - end + if para =~/^[456]~ / + if para=~/^4/ and not @md.set_heading_seg + @md.set_heading_seg=true + end + if para =~/^[456]~(?:\s\S+)?\s+([\d.,:-]+)/m #heading starts with a recognised numeric or word followed by a recognised numerical construct, use that as name + pattern=$1 + pattern.gsub!(/(?:[:,-]|\W)/,'.') + pattern.gsub!(/\.$/,'') + if not @md.seg_names.nil? and not @md.seg_names.include?(pattern) + para.gsub!(/^([456])~\s*/,"\\1~#{pattern} ") + @md.seg_names << pattern + else puts 'warn, there may be a conflicting numbering scheme' if @md.cmd =~/[VM]/ end - if para =~/^4~\s.+?;4:(\d+);/m #extract segment name from embedded document structure info - pattern=$1 - pattern.gsub!(/(?:[:,-]|\W)/,'.') - pattern.gsub!(/\.$/,'') - if not @md.seg_names.nil? and not @md.seg_names.include?(pattern) - para.gsub!(/^(4)~\s*/,"\\1~#{pattern} ") - @md.seg_names << pattern - else - para.gsub!(/^(4)~\s*/,"\\1~~#{pattern} ") - @md.seg_names << "~#{pattern}" - end + end + if para =~/^4~\s.+?;4:(\d+);/m #extract segment name from embedded document structure info + pattern=$1 + pattern.gsub!(/(?:[:,-]|\W)/,'.') + pattern.gsub!(/\.$/,'') + if not @md.seg_names.nil? and not @md.seg_names.include?(pattern) + para.gsub!(/^(4)~\s*/,"\\1~#{pattern} ") + @md.seg_names << pattern + else + para.gsub!(/^(4)~\s*/,"\\1~~#{pattern} ") + @md.seg_names << "~#{pattern}" end - if para =~/^4~\s+/ #if still not segment name, provide a numerical one - if not @md.seg_names.nil? and not @md.seg_names.include?(art_filename_auto) - para.gsub!(/^4~\s+/,%{4~_#{art_filename_auto} }) - @md.seg_names << art_filename_auto - else puts 'segment name (numbering) error' - end - art_filename_auto+=1 + end + if para =~/^4~\s+/ #if still not segment name, provide a numerical one + if not @md.seg_names.nil? and not @md.seg_names.include?(art_filename_auto) + para.gsub!(/^4~\s+/,%{4~_#{art_filename_auto} }) + @md.seg_names << art_filename_auto + else puts 'segment name (numbering) error' end + art_filename_auto+=1 end end @tuned_file << if para =~/^([1-6])~/m and (@md.pagenew or @md.pagebreak); m=$1 #watch ref~ diff --git a/lib/sisu/v0/semantics.rb b/lib/sisu/v0/semantics.rb index 86e05fc4..177a5d98 100644 --- a/lib/sisu/v0/semantics.rb +++ b/lib/sisu/v0/semantics.rb @@ -349,7 +349,7 @@ outputdir=SiSU_Env::Info_env.new.path.feed pwd=Dir.pwd @argv=[] argv=$* -p argv +#p argv my_make=SiSU_Env::Create_file.new('','') if argv.to_s =~/yaml/ my_make.file_semantic -- cgit v1.2.3