aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/shared_html_lite.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/shared_html_lite.rb')
-rw-r--r--lib/sisu/v0/shared_html_lite.rb27
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/sisu/v0/shared_html_lite.rb b/lib/sisu/v0/shared_html_lite.rb
index 5285b6db..76def67d 100644
--- a/lib/sisu/v0/shared_html_lite.rb
+++ b/lib/sisu/v0/shared_html_lite.rb
@@ -60,18 +60,29 @@ module SiSU_Format_Shared
include SiSU_Viz
class CSS_Format
require "#{SiSU_lib}/defaults"
- def initialize(content=nil,id=nil,ocnd='',ocns='',lv='',hname=nil)
+ @@fns=nil
+ def initialize(md,content=nil,col=nil,en=nil)
content.gsub!(/<:i[12]>/,'')
- @content=content
- @id=@ocn=id
- @ocnd,@ocns=ocnd,ocns
- @lv=@notenumber=lv.to_s
- @hname=hname.to_s
+ @md,@content=md,content
+ @id=@ocn=col[:id]
+ @ocnd,@ocns=col[:ocnd],col[:ocns]
+ @notenumber=en
+ @lv=col[:lev].to_s
+ @@hname=if @md.fns != @@fns
+ @@fns=@md.fns
+ ''
+ end
+ @hname=if col[:seg] and not col[:seg].to_s.empty?
+ @@hname=col[:seg].to_s
+ else @@hname
+ end
@tab="\t"
@url_brace=SiSU_Viz::Skin.new.url_decoration
# lots introduced to do html tables in db
@@tablehead,@@tablefoot=[],[]
@vz=SiSU_Env::Get_init.instance.skin
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @base_url="#{@env.url.root}/#{@md.fnb}/#@hname.html"
end
def urls(data)
@words=[]
@@ -128,11 +139,11 @@ module SiSU_Format_Shared
def paragraph
%{#{@tab*1}<p class="h#@lv" id="#@ocn" type="substantive" header="#@hname">\n#{@tab*2}#@content\n#{@tab*1}</p>\n} << "\n"
end
- def endnote
+ def endnote #used only by db
@content=markup(@content)
<<GSUB
#{@tab*1}<p class="endnote" name="note_#@notenumber" from="#@ocn">
-#{@tab*2}<a name="_#@notenumber" href="#-#@notenumber">#@notenumber.</a> <note>#@content</note>
+#{@tab*2}<a href="#@base_url#-#@notenumber" name="_#@notenumber">#@notenumber.</a> <note>#@content</note>
#{@tab*1}</p>
GSUB
end