diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-10-15 13:59:07 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-10-15 13:59:07 -0400 |
commit | aa06692c5bc575539760b436536edff626537bac (patch) | |
tree | f5927a205b873e23f6030657d5934fdf580dd120 /lib | |
parent | v2 v3: odf:odt v1.0: make odt header easier to track; remove binary blob (diff) |
v3: odf:odt, make odt style names more easily recognizablesisu_3.1.1
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v3/odf.rb | 90 | ||||
-rw-r--r-- | lib/sisu/v3/odf_format.rb | 32 |
2 files changed, 61 insertions, 61 deletions
diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb index e268b873..3bd59e81 100644 --- a/lib/sisu/v3/odf.rb +++ b/lib/sisu/v3/odf.rb @@ -158,8 +158,8 @@ module SiSU_ODF url=@md.fnb fn=@md.fn[:manifest] manifest="#{@env.url.root}/#{@md.fnb}/#{@md.fn[:manifest]}" - @@odf[:tail] << %{<text:p text:style-name="P1">Available document outputs: <br /> <<text:a xlink:type="simple" xlink:href="#{manifest}">#{manifest}</text:a>></text:p>} - @@odf[:tail] << %{\n<text:p text:style-name="P1">SiSU: <<text:a xlink:type="simple" xlink:href="http://www.jus.uio.no/lm">www.jus.uio.no/sisu</text:a>> and <<text:a xlink:type="simple" xlink:href="http://www.sisudoc.org">www.sisudoc.org</text:a>></text:p>} + @@odf[:tail] << %{<text:p text:style-name="P_normal">Available document outputs: <br /> <<text:a xlink:type="simple" xlink:href="#{manifest}">#{manifest}</text:a>></text:p>} + @@odf[:tail] << %{\n<text:p text:style-name="P_normal">SiSU: <<text:a xlink:type="simple" xlink:href="http://www.jus.uio.no/lm">www.jus.uio.no/sisu</text:a>> and <<text:a xlink:type="simple" xlink:href="http://www.sisudoc.org">www.sisudoc.org</text:a>></text:p>} @@odf[:tail] << "\n</office:text></office:body></office:document-content>" end def heading(dob,p_num='') @@ -175,12 +175,12 @@ module SiSU_ODF unless @@docstart breakpage=if (@md.pagenew or @md.pagebreak) \ and (@md.pagenew =~ m or @md.pagebreak =~m) - '<text:p text:style-name="P9"> </text:p>' + '<text:p text:style-name="P_normal_page_new"> </text:p>' else '' end end @@docstart=false - dob.obj=%{#{breakpage}<text:h text:style-name="Heading_20_#{dob.ln}" text:outline-level="#{dob.ln}">#{dob.obj}#{p_num}</text:h>} + dob.obj=%{#{breakpage}<text:h text:style-name="Heading_#{dob.ln}" text:outline-level="#{dob.ln}">#{dob.obj}#{p_num}</text:h>} dob end def image_src(i) @@ -222,7 +222,7 @@ module SiSU_ODF and w.to_s =~/\d/ @@img_count +=1 %{<draw:frame draw:style-name="fr1" draw:name="graphics#{@@img_count}" text:anchor-type="as-char" svg:width="#{w}cm" svg:height="#{h}cm" draw:z-index="2"><draw:image xlink:href="Pictures/#{i}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>#{c}} #anchor-type: as-char or paragraph or char or ... - else %{<text:p text:style-name="P1">[image omitted]</text:p>} + else %{<text:p text:style-name="P_normal">[image omitted]</text:p>} end end def image(dob) @@ -310,12 +310,12 @@ module SiSU_ODF dob.obj= if dob.is=='para' \ and dob.indent.to_s =~/[0-9]/ \ and dob.indent == dob.hang - %{<text:p text:style-name="P1#{dob.indent}">#{dob.obj}#{p_num}</text:p>} + %{<text:p text:style-name="P_indent_#{dob.indent}">#{dob.obj}#{p_num}</text:p>} elsif dob.is=='para' \ and dob.hang.to_s =~/[0-9]/ \ and dob.indent != dob.hang # NOT yet implemented - %{<text:p text:style-name="P1#{dob.indent}">#{dob.obj}#{p_num}</text:p>} - else %{<text:p text:style-name="P1">#{dob.obj}#{p_num}</text:p>} + %{<text:p text:style-name="P_indent_#{dob.indent}">#{dob.obj}#{p_num}</text:p>} + else %{<text:p text:style-name="P_normal">#{dob.obj}#{p_num}</text:p>} end dob end @@ -372,7 +372,7 @@ module SiSU_ODF def group_clean(str) str.gsub!(/&nbsp;| |#{Mx[:nbsp]}/,' ') str.gsub!(/</,'<'); str.gsub!(/>/,'>') - str.gsub!(/<(text:span text:style-name="T[1-5]"|\/text:span)>/,'<\1>') #works, not ideal + str.gsub!(/<(text:span text:style-name="Table_\S+?"|\/text:span)>/,'<\1>') #works, not ideal str.gsub!(/#{Mx[:br_line]}/,'<br />') str.gsub!(/<br(?:\s+\/)?>/,'<br />') str @@ -381,10 +381,10 @@ module SiSU_ODF parray=[] dob.obj.split(/#{Mx[:br_line]}|#{Mx[:br_nl]}/).each do |parablock| parablock=group_clean(parablock) - parray << %{<text:p text:style-name="P4">#{parablock}</text:p>} if parablock =~/\S+/ + parray << %{<text:p text:style-name="P_group">#{parablock}</text:p>} if parablock =~/\S+/ end dob.obj=parray.join \ - + %{<text:p text:style-name="P4">#{p_num}</text:p>} \ + + %{<text:p text:style-name="P_group">#{p_num}</text:p>} \ + '<text:p text:style-name="Standard"/>' dob end @@ -404,10 +404,10 @@ module SiSU_ODF parablock.gsub!(/<(text:p text:style-name="Footnote")>/,'<\1>') parablock.gsub!(/<(\/?text:(?:note-citation|note-body|note|p))>/,'<\1>') parablock=footnote(parablock) - parray << %{<text:p text:style-name="P4">#{parablock}</text:p>} if parablock =~/\S+/ + parray << %{<text:p text:style-name="P_group">#{parablock}</text:p>} if parablock =~/\S+/ end dob.obj=parray.join \ - + %{<text:p text:style-name="P4">#{p_num}</text:p>} \ + + %{<text:p text:style-name="P_group">#{p_num}</text:p>} \ + '<text:p text:style-name="Standard"/>' dob end @@ -427,10 +427,10 @@ module SiSU_ODF parablock.gsub!(/<(text:p text:style-name="Footnote")>/,'<\1>') parablock.gsub!(/<(\/?text:(?:note-citation|note-body|note|p))>/,'<\1>') parablock=footnote(parablock) - parray << %{<text:p text:style-name="P4">#{parablock}</text:p>} if parablock =~/\S+/ + parray << %{<text:p text:style-name="P_group">#{parablock}</text:p>} if parablock =~/\S+/ end dob.obj=parray.join \ - + %{<text:p text:style-name="P4">#{p_num}</text:p>} \ + + %{<text:p text:style-name="P_group">#{p_num}</text:p>} \ + '<text:p text:style-name="Standard"/>' dob end @@ -443,10 +443,10 @@ module SiSU_ODF parablock.gsub!(/^\s*$/,'<br />') parablock.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, '<text:a xlink:type="simple" xlink:href="\1">\1</text:a>') #http ftp matches escaped, no decoration - parray << %{<text:p text:style-name="P20">#{parablock}</text:p>} if parablock =~/\S+/ + parray << %{<text:p text:style-name="P_code">#{parablock}</text:p>} if parablock =~/\S+/ end dob.obj=parray.join \ - + %{<text:p text:style-name="P4">#{p_num}</text:p>} \ + + %{<text:p text:style-name="P_group">#{p_num}</text:p>} \ + '<text:p text:style-name="Standard"/>' end dob @@ -570,17 +570,17 @@ module SiSU_ODF dob.obj.gsub!(/©/,'©') #too arbitrary dob.obj.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check dob.obj.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/, - '<text:span text:style-name="T1">\1</text:span>') + '<text:span text:style-name="Table_bold">\1</text:span>') dob.obj.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/, - '<text:span text:style-name="T2">\1</text:span>') + '<text:span text:style-name="Table_italic">\1</text:span>') dob.obj.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/, - '<text:span text:style-name="T3">\1</text:span>') + '<text:span text:style-name="Table_underscore">\1</text:span>') dob.obj.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/, - '<text:span text:style-name="T4">\1</text:span>') + '<text:span text:style-name="Table_superscript">\1</text:span>') dob.obj.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/, - '<text:span text:style-name="T5">\1</text:span>') + '<text:span text:style-name="Table_subscript">\1</text:span>') dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/, - '<text:span text:style-name="T7">\1</text:span>') + '<text:span text:style-name="Table_monospace">\1</text:span>') dob.obj.gsub!(//u,'-') dob.obj.gsub!(/ /u, ' ') # space identify dob.obj.gsub!(/ /u, ' ') # space identify @@ -653,33 +653,33 @@ WOK <office:font-face-decls><style:font-face style:name="DejaVu Sans Mono" svg:font-family="'DejaVu Sans Mono'" style:font-adornments="Book" style:font-family-generic="modern" style:font-pitch="fixed"/><style:font-face style:name="Inconsolata" svg:font-family="Inconsolata" style:font-adornments="Regular" style:font-pitch="fixed"/><style:font-face style:name="Liberation Mono" svg:font-family="'Liberation Mono'" style:font-adornments="Regular" style:font-family-generic="modern" style:font-pitch="fixed"/><style:font-face style:name="DejaVu Sans" svg:font-family="'DejaVu Sans'" style:font-adornments="ExtraLight" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="Nimbus Sans L" svg:font-family="'Nimbus Sans L'" style:font-pitch="variable"/><style:font-face style:name="Tahoma" svg:font-family="Tahoma, Lucidasans, 'Lucida Sans', 'Arial Unicode MS'" style:font-pitch="variable"/><style:font-face style:name="DejaVu Serif" svg:font-family="'DejaVu Sans'" style:font-adornments="ExtraLight" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="Nimbus Roman No9 L" svg:font-family="'Nimbus Roman No9 L'" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Bitstream Vera Sans" svg:font-family="'Bitstream Vera Sans'" style:font-family-generic="swiss" style:font-pitch="variable"/></office:font-face-decls> <office:automatic-styles> #{table} - <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:text-align="justify" style:justify-single-word="false"/></style:style> + <style:style style:name="P_normal" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:text-align="justify" style:justify-single-word="false"/></style:style> <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:text-align="justify" style:justify-single-word="false"/></style:style> <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:text-align="justify" style:justify-single-word="false"/></style:style> - <style:style style:name="P4" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" fo:line-height="100%" fo:text-align="justify" style:justify-single-word="false"/></style:style> + <style:style style:name="P_group" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" fo:line-height="100%" fo:text-align="justify" style:justify-single-word="false"/></style:style> <style:style style:name="P5" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" fo:line-height="100%" fo:text-align="start" style:justify-single-word="false"/></style:style> <style:style style:name="P6" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:break-before="page"/></style:style> - <style:style style:name="P7" style:family="paragraph" style:parent-style-name="Table_20_Contents"><style:paragraph-properties fo:text-align="justify" style:justify-single-word="false"/></style:style> - <style:style style:name="P8" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:break-before="page"/></style:style> - <style:style style:name="P9" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:break-after="page"/></style:style> - <style:style style:name="P10" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:text-align="justify" style:justify-single-word="false"/></style:style> - <style:style style:name="P11" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="1cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> - <style:style style:name="P12" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="2cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> - <style:style style:name="P13" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="3cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> - <style:style style:name="P14" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="4cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> - <style:style style:name="P15" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="5cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> - <style:style style:name="P16" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="6cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> - <style:style style:name="P17" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="7cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> - <style:style style:name="P18" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="8cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> - <style:style style:name="P19" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="8cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> - <style:style style:name="P20" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" fo:line-height="100%" fo:text-align="start" style:justify-single-word="false"/><style:text-properties style:font-name="DejaVu Sans Mono" fo:font-size="9pt" fo:font-weight="normal" fo:background-color="#e6e6e6"/></style:style> - <style:style style:name="T1" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/></style:style> - <style:style style:name="T2" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/></style:style> - <style:style style:name="T3" style:family="text"><style:text-properties style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color"/></style:style> - <style:style style:name="T4" style:family="text"><style:text-properties style:text-position="super 58%"/></style:style> - <style:style style:name="T5" style:family="text"><style:text-properties style:text-position="sub 58%"/></style:style> + <style:style style:name="P_table_cell" style:family="paragraph" style:parent-style-name="Table_Contents"><style:paragraph-properties fo:text-align="justify" style:justify-single-word="false"/></style:style> + <style:style style:name="P_page_break" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:break-before="page"/></style:style> + <style:style style:name="P_normal_page_new" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:break-after="page"/></style:style> + <style:style style:name="P_indent_0" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:text-align="justify" style:justify-single-word="false"/></style:style> + <style:style style:name="P_indent_1" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="1cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> + <style:style style:name="P_indent_2" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="2cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> + <style:style style:name="P_indent_3" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="3cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> + <style:style style:name="P_indent_4" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="4cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> + <style:style style:name="P_indent_5" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="5cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> + <style:style style:name="P_indent_6" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="6cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> + <style:style style:name="P_indent_7" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="7cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> + <style:style style:name="P_indent_8" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="8cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> + <style:style style:name="P_indent_9" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="8cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style> + <style:style style:name="P_code" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" fo:line-height="100%" fo:text-align="start" style:justify-single-word="false"/><style:text-properties style:font-name="DejaVu Sans Mono" fo:font-size="9pt" fo:font-weight="normal" fo:background-color="#e6e6e6"/></style:style> + <style:style style:name="Table_bold" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/></style:style> + <style:style style:name="Table_italic" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/></style:style> + <style:style style:name="Table_underscore" style:family="text"><style:text-properties style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color"/></style:style> + <style:style style:name="Table_superscript" style:family="text"><style:text-properties style:text-position="super 58%"/></style:style> + <style:style style:name="Table_subscript" style:family="text"><style:text-properties style:text-position="sub 58%"/></style:style> <style:style style:name="T6" style:family="text"><style:text-properties style:font-name="Courier 10 Pitch" fo:font-size="12pt"/></style:style> - <style:style style:name="T7" style:family="text"><style:text-properties style:font-name="DejaVu Sans Mono" fo:font-size="10pt" fo:font-weight="normal" fo:background-color="#e6e6e6"/></style:style> + <style:style style:name="Table_monospace" style:family="text"><style:text-properties style:font-name="DejaVu Sans Mono" fo:font-size="10pt" fo:font-weight="normal" fo:background-color="#e6e6e6"/></style:style> <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics"><style:graphic-properties style:wrap="none" style:horizontal-pos="left" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0cm 0cm 0cm 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/></style:style> <style:style style:name="gr1" style:family="graphic"><style:graphic-properties draw:stroke="none" draw:fill="none" draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle" draw:color-mode="standard" draw:luminance="0%" draw:contrast="0%" draw:gamma="100%" draw:red="0%" draw:green="0%" draw:blue="0%" fo:clip="rect(0cm 0cm 0cm 0cm)" draw:image-opacity="100%" style:mirror="none" style:run-through="background" style:wrap="none" style:vertical-pos="top" style:vertical-rel="baseline" style:horizontal-pos="left" style:horizontal-rel="paragraph" draw:wrap-influence-on-position="once-concurrent" style:flow-with-text="false"/></style:style> <style:style style:name="gr2" style:family="graphic"><style:graphic-properties draw:stroke="none" draw:fill="none" draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle" draw:color-mode="standard" draw:luminance="0%" draw:contrast="0%" draw:gamma="100%" draw:red="0%" draw:green="0%" draw:blue="0%" fo:clip="rect(0cm 0cm 0cm 0cm)" draw:image-opacity="100%" style:mirror="none" style:run-through="background" style:wrap="none" style:vertical-pos="middle" style:vertical-rel="baseline" style:horizontal-pos="left" style:horizontal-rel="paragraph" draw:wrap-influence-on-position="once-concurrent" style:flow-with-text="false"/></style:style> diff --git a/lib/sisu/v3/odf_format.rb b/lib/sisu/v3/odf_format.rb index 7a9b267d..5abf5090 100644 --- a/lib/sisu/v3/odf_format.rb +++ b/lib/sisu/v3/odf_format.rb @@ -65,7 +65,7 @@ module SiSU_ODF_format @paranum=/(\d+)/m.match(paranum.to_s)[1] end def display - @paranum.gsub(/(\d+)/,' <text:span text:style-name="T5">[\1]</text:span>') + @paranum.gsub(/(\d+)/,' <text:span text:style-name="Table_subscript">[\1]</text:span>') end def name @paranum.gsub(/(\d+)/,'<a name="\1"></a>') @@ -142,13 +142,13 @@ module SiSU_ODF_format end def table_close(tablefoot='') '</table:table>' \ - + %{<text:p text:style-name="P4">#{@p_num}</text:p>} + + %{<text:p text:style-name="P_group">#{@p_num}</text:p>} end def table_tag_cell(str,i) txt_name_cell=if i==0 \ and @dob.head_ - 'Table_20_Heading' - else 'P7' + 'Table_Heading' + else 'P_table_cell' end str.gsub!(/^~$/,'') # tilde / empty cell %{<table:table-cell office:value-type="string">#{@br}} + @@ -165,8 +165,8 @@ module SiSU_ODF_format def table_tag_row_dump(str,i) txt_name_row=if i==0 \ and @dob.head_ - 'Table_20_Heading' - else 'P7' + 'Table_Heading' + else 'P_table_cell' end %{<table:table-row>#{@br}} + %{<table:table-cell office:value-type="string">#{@br}} + @@ -353,29 +353,29 @@ WOK <style:table-row-properties fo:keep-together="auto"/> </style:default-style> <style:style style:name="Standard" style:family="paragraph" style:class="text"/> - <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text"> + <style:style style:name="Text_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text"> <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.212cm"/> </style:style> - <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text"> + <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_body" style:class="text"> <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" fo:keep-with-next="always"/> <style:text-properties style:font-name="Bitstream Vera Sans" fo:font-size="14pt" style:font-name-asian="HG Mincho Light J" style:font-size-asian="14pt" style:font-name-complex="Tahoma" style:font-size-complex="14pt"/> </style:style> - <style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="text" style:default-outline-level="1"> + <style:style style:name="Heading_1" style:display-name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_body" style:class="text" style:default-outline-level="1"> <style:text-properties fo:font-size="120%" fo:font-weight="bold" style:font-size-asian="120%" style:font-weight-asian="bold" style:font-size-complex="115%" style:font-weight-complex="bold"/> </style:style> - <style:style style:name="Heading_20_2" style:display-name="Heading 2" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="text" style:default-outline-level="2"> + <style:style style:name="Heading_2" style:display-name="Heading 2" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_body" style:class="text" style:default-outline-level="2"> <style:text-properties fo:font-size="115%" fo:font-weight="bold" style:font-size-asian="115%" style:font-weight-asian="bold" style:font-size-complex="115%" style:font-weight-complex="bold"/> </style:style> - <style:style style:name="Heading_20_3" style:display-name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="text" style:default-outline-level="3"> + <style:style style:name="Heading_3" style:display-name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_body" style:class="text" style:default-outline-level="3"> <style:text-properties fo:font-size="110%" fo:font-weight="bold" style:font-size-asian="110%" style:font-weight-asian="bold" style:font-size-complex="115%" style:font-weight-complex="bold"/> </style:style> - <style:style style:name="Heading_20_4" style:display-name="Heading 4" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="text" style:default-outline-level="4"> + <style:style style:name="Heading_4" style:display-name="Heading 4" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_body" style:class="text" style:default-outline-level="4"> <style:text-properties fo:font-size="100%" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="100%" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="100%" style:font-style-complex="italic" style:font-weight-complex="bold"/> </style:style> - <style:style style:name="Heading_20_5" style:display-name="Heading 5" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="text" style:default-outline-level="5"> + <style:style style:name="Heading_5" style:display-name="Heading 5" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_body" style:class="text" style:default-outline-level="5"> <style:text-properties fo:font-size="90%" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="90%" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="90%" style:font-style-complex="italic" style:font-weight-complex="bold"/> </style:style> - <style:style style:name="Heading_20_6" style:display-name="Heading 6" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="text" style:default-outline-level="6"> + <style:style style:name="Heading_6" style:display-name="Heading 6" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_body" style:class="text" style:default-outline-level="6"> <style:text-properties fo:font-size="80%" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="80%" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="80%" style:font-style-complex="italic" style:font-weight-complex="bold"/> </style:style> <style:style style:name="Footnote" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> @@ -455,12 +455,12 @@ WOK @md,@t_o=md,t_o end def br_page - @t_o.obj='<text:p text:style-name="P8"> </text:p>' + @t_o.obj='<text:p text:style-name="P_page_break"> </text:p>' @t_o end def obj_sep #center later sep='--- ' - @t_o.obj=%{<text:p text:style-name="P1">#{sep*20}</text:p>} + @t_o.obj=%{<text:p text:style-name="P_normal">#{sep*20}</text:p>} @t_o end end |