aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--data/doc/sisu/CHANGELOG_v54
-rw-r--r--data/doc/sisu/CHANGELOG_v64
-rw-r--r--lib/sisu/v5/concordance.rb9
-rw-r--r--lib/sisu/v5/constants.rb1
-rw-r--r--lib/sisu/v5/html.rb9
-rw-r--r--lib/sisu/v5/html_format.rb25
-rw-r--r--lib/sisu/v5/html_lite_shared.rb7
-rw-r--r--lib/sisu/v5/html_minitoc.rb5
-rw-r--r--lib/sisu/v5/txt_plain.rb3
-rw-r--r--lib/sisu/v5/xml_odf_odt.rb7
-rw-r--r--lib/sisu/v5/xml_odf_odt_format.rb19
-rw-r--r--lib/sisu/v6/concordance.rb9
-rw-r--r--lib/sisu/v6/constants.rb1
-rw-r--r--lib/sisu/v6/html.rb9
-rw-r--r--lib/sisu/v6/html_format.rb25
-rw-r--r--lib/sisu/v6/html_lite_shared.rb7
-rw-r--r--lib/sisu/v6/html_minitoc.rb5
-rw-r--r--lib/sisu/v6/txt_plain.rb3
-rw-r--r--lib/sisu/v6/xml_odf_odt.rb7
-rw-r--r--lib/sisu/v6/xml_odf_odt_format.rb19
20 files changed, 116 insertions, 62 deletions
diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5
index a5e9059a..e59d839d 100644
--- a/data/doc/sisu/CHANGELOG_v5
+++ b/data/doc/sisu/CHANGELOG_v5
@@ -49,6 +49,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.3.1.orig.tar.xz
(various changes, e.g. ocn [url]#37 only available as [url]#o37)
* tags
+* ocn turn on/off rules
+ * txt
+ * odt
+
* error/warn messages, including wrappers round require
%% 5.3.0.orig.tar.xz (2014-01-26:03/7)
diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6
index 27269b3f..a1183d8f 100644
--- a/data/doc/sisu/CHANGELOG_v6
+++ b/data/doc/sisu/CHANGELOG_v6
@@ -39,6 +39,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.1.orig.tar.xz
(various changes, e.g. ocn [url]#37 only available as [url]#o37)
* tags
+* ocn turn on/off rules
+ * txt
+ * odt
+
* error/warn messages, including wrappers round require
%% 6.0.0.orig.tar.xz (2014-01-26:03/7)
diff --git a/lib/sisu/v5/concordance.rb b/lib/sisu/v5/concordance.rb
index 55892ab7..b9030123 100644
--- a/lib/sisu/v5/concordance.rb
+++ b/lib/sisu/v5/concordance.rb
@@ -240,12 +240,13 @@ WOK
end
end
protected
- def location_scroll(wordlocation,show)
- %{<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}\##{wordlocation}">#{wordlocation}</a>; }
+ def location_scroll(wordlocation,show) # not used
+ %{<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}\##{Mx[:ocn_id_char]}#{wordlocation}">#{wordlocation}</a>; }
end
- def location_seg(wordlocation,show) ##fix
+ def location_seg(wordlocation,show)
unless wordlocation.nil?
- wl=wordlocation.gsub(/(.+?)\#(\d+)/,"\\1#{@md.lang_code_insert}#{Sfx[:html]}#\\2")
+ wl=wordlocation.gsub(/(.+?)\#(\d+)/,
+ "\\1#{@md.lang_code_insert}#{Sfx[:html]}##{Mx[:ocn_id_char]}\\2") # id="o\d+" always available; a name="\d+" not available if html strict used
case wordlocation
when /#{@rxp_t1}|@rxp_t2}|#{@rxp_t3}/
%{[<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}##{show}">H</a>]#{show}, }
diff --git a/lib/sisu/v5/constants.rb b/lib/sisu/v5/constants.rb
index e84c0901..fea57ce8 100644
--- a/lib/sisu/v5/constants.rb
+++ b/lib/sisu/v5/constants.rb
@@ -101,6 +101,7 @@ Xx={
html_relative1: '※',
}
Mx={
+ ocn_id_char: 'o',
meta_o: '〔@', meta_c: '〕',
lv_o_0: 0,
lv_o_1: 1,
diff --git a/lib/sisu/v5/html.rb b/lib/sisu/v5/html.rb
index 1b738561..ef62b9bd 100644
--- a/lib/sisu/v5/html.rb
+++ b/lib/sisu/v5/html.rb
@@ -245,6 +245,7 @@ module SiSU_HTML
def initialize(md=nil,data='')
@data,@md=data,md
@vz=SiSU_Viz::Defaults.new
+ @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
@tell=SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set]) if @md
end
def songsheet #extracts toc for scroll & seg
@@ -356,7 +357,7 @@ WOK
title=if dob.ocn ==0 then linkname
else
@@toc[:scr] << '<br />'
- %{<b><a href="##{dob.ocn}">#{linkname}</a></b>}
+ %{<b><a href="##{@ocn_html_identifier}#{dob.ocn}">#{linkname}</a></b>}
end
txt_obj={ txt: title }
format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
@@ -398,7 +399,7 @@ WOK
end
else
@@toc[:scr] << '<br />'
- %{<b><a href="##{dob.ocn}">#{linkname}</a></b>}
+ %{<b><a href="##{@ocn_html_identifier}#{dob.ocn}">#{linkname}</a></b>}
end
txt_obj={ txt: title }
format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
@@ -515,7 +516,7 @@ WOK
}
f=@md.file.base_filename.html_seg(fnh)
p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)
- lnk_n_txt=%{ <a href="#{f}##{ocn}">
+ lnk_n_txt=%{ <a href="#{f}##{@ocn_html_identifier}#{ocn}">
#{linkname}
</a>}
txt_obj={ txt: lnk_n_txt }
@@ -540,7 +541,7 @@ WOK
}
f=@md.file.base_filename.html_seg(fnh)
p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)
- lnk_n_txt=%{ <a href="#{f}##{ocn}">
+ lnk_n_txt=%{ <a href="#{f}##{@ocn_html_identifier}#{ocn}">
#{linkname}
</a>}
txt_obj={ txt: lnk_n_txt }
diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb
index 0dc65a06..e0be4f8a 100644
--- a/lib/sisu/v5/html_format.rb
+++ b/lib/sisu/v5/html_format.rb
@@ -66,30 +66,36 @@ module SiSU_HTML_Format
def initialize(md,ocn)
@md,@ocn=md,ocn.to_s
@ocn ||=''
+ @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
+ @make=SiSU_Env::ProcessingSettings.new(@md)
end
def ocn_display
- make=SiSU_Env::ProcessingSettings.new(@md)
- if make.build.ocn?
- ocn_class='ocn'
+ if @make.build.ocn?
if @ocn.to_i==0 \
or @ocn.empty?
- %{<label class="ocn_off">&nbsp;</label>}
+ ''
else
+ name=(@make.build.html_strict?) ? '' : %{ name="#{@ocn}"}
@ocn.gsub(/^(\d+|)$/,
- %{<label class="#{ocn_class}"><a name="#{@ocn}" href="##{@ocn}" class="lnk#{ocn_class}">\\1</a></label>})
+ %{<label class="ocn"><a#{name} href="##{@ocn_html_identifier}#{@ocn}" class="lnkocn">\\1</a></label>})
end
else
- %{<label class="ocn_off">&nbsp;</label>}
+ ''
end
end
def name
- (@ocn==nil || @ocn.empty?) ? '' : %{<a name="#{@ocn}"></a>}
+ if @make.build.html_strict? \
+ or @ocn==(nil || @ocn.empty?)
+ ''
+ else
+ %{<a name="#{@ocn}"></a>}
+ end
end
def id #w3c? "tidy" complains about numbers as identifiers ! annoying
(@ocn==nil || @ocn.empty?) ? '' : %{id="o#{@ocn}"}
end
def goto
- (@ocn==nil || @ocn.empty?) ? '' : %{<a href="##{@ocn}">}
+ (@ocn==nil || @ocn.empty?) ? '' : %{<a href="##{@ocn_html_identifier}#{@ocn}">}
end
end
class HeadInformation
@@ -1233,6 +1239,7 @@ WOK
end
def subtoc_lev(tag,attrib)
@txt=clean(@txt)
+ @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
txt=if @txt \
and @txt =~/<\/?i>|<a\s+name="\S+?">/mi
@txt.gsub(/<\/?i>|<a\s+name="\S+?">/mi,'') #removes name markers from subtoc, go directly to substantive text
@@ -1246,7 +1253,7 @@ WOK
gsub(/<a[\n\s]+name="-\d+"[\n\s]+href="#_\d+">&nbsp;<sup>\d+<\/sup>&nbsp;/m,'')
end
%{<#{tag} class="#{attrib}">