From e3330f16f31ccc9cd62d5d1f15e76cec4e45485d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 26 Jul 2011 20:32:10 -0400 Subject: v3: sql (pg, sqlite), indent ... --- data/doc/sisu/CHANGELOG_v3 | 2 +- lib/sisu/v3/db_import.rb | 10 +++++++++- lib/sisu/v3/shared_html_lite.rb | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 73d1062d..b10bf30d 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -26,7 +26,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.14.orig.tar.gz _[0-9]?_[1-9] initial indent; paragraph text indent - * done: dal, plaintext, css, html, epub, xhtml, xml sax, xml dom, pdf; + * done: dal, plaintext, css, html, epub, xhtml, xml sax, xml dom, pdf, sql; not done: odf, man, info check: po4a, html_lite (used in sql search results) * syntax highlighting done: vim (sisu.vim), emacs (sisu-mode.el) diff --git a/lib/sisu/v3/db_import.rb b/lib/sisu/v3/db_import.rb index 541399a9..ac6f0104 100644 --- a/lib/sisu/v3/db_import.rb +++ b/lib/sisu/v3/db_import.rb @@ -393,8 +393,16 @@ module SiSU_DB_import SiSU_Format_Shared::CSS_Format.new(@md,data).html_table elsif data.is=='code' SiSU_Format_Shared::CSS_Format.new(@md,data).code - elsif defined? data.indent and data.indent =~/[1-9]/ + elsif defined? data.indent \ + and defined? data.hang \ + and data.indent =~/[1-9]/ \ + and data.indent == data.hang SiSU_Format_Shared::CSS_Format.new(@md,data).indent(data.indent) + elsif defined? data.indent \ + and defined? data.hang \ + and data.hang =~/[0-9]/ \ + and data.indent != data.hang + SiSU_Format_Shared::CSS_Format.new(@md,data).hang_indent(data.hang,data.indent) else SiSU_Format_Shared::CSS_Format.new(@md,data).norm end diff --git a/lib/sisu/v3/shared_html_lite.rb b/lib/sisu/v3/shared_html_lite.rb index fca0cfb8..0dd13a34 100644 --- a/lib/sisu/v3/shared_html_lite.rb +++ b/lib/sisu/v3/shared_html_lite.rb @@ -236,6 +236,12 @@ GSUB h={ txt: txt, class: "indent#{t}", type: 'substantive', id: @ocn } tag_para(h) end + def hang_indent(f,t) + txt=markup_object(@t_o) + h={ txt: txt, class: "hang#{f}indent#{t}", type: 'substantive', id: @ocn } + #h={ txt: txt, class: "h#{f}i#{t}", type: 'substantive', id: @ocn } + tag_para(h) + end def para_table %{

} end -- cgit v1.2.3