aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/sisu/v0/html_format.rb6
-rw-r--r--lib/sisu/v0/texpdf.rb16
2 files changed, 18 insertions, 4 deletions
diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb
index e1109a6a..090c779a 100644
--- a/lib/sisu/v0/html_format.rb
+++ b/lib/sisu/v0/html_format.rb
@@ -63,9 +63,13 @@ module SiSU_HTML_Format
@md=md
@paranum=paranum[/(\d+)/m,1]
@paranum ||=''
+ vz=SiSU_Env::Get_init.instance.skin
+ @skin_no_ocn=if defined? vz.ocn_display_off and vz.ocn_display_off == true; true
+ else false
+ end
end
def ocn_display
- if @md.markup.inspect =~/no_ocn/ or @md.mod.inspect =~/--no-ocn/
+ if @md.markup.inspect =~/no_ocn/ or @md.mod.inspect =~/--no-ocn/ or @skin_no_ocn
ocn_class='ocn_off'
@paranum.gsub(/^(\d+|)$/,
%{ <p class="#{ocn_class}">
diff --git a/lib/sisu/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb
index be8c973e..4b4613b0 100644
--- a/lib/sisu/v0/texpdf.rb
+++ b/lib/sisu/v0/texpdf.rb
@@ -240,6 +240,10 @@ module SiSU_TeX
@tex=SiSU_TeX_Pdf::Use_TeX.new(@md,@orientation)
@vz=SiSU_Env::Get_init.instance.skin
@dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ vz=SiSU_Env::Get_init.instance.skin
+ @skin_no_ocn=if defined? vz.ocn_display_off and vz.ocn_display_off == true; true
+ else false
+ end
end
def songsheet
begin
@@ -268,7 +272,11 @@ module SiSU_TeX
if @md.flag_tables
data=tables(data)
end
- data=number_paras(data) if @md.markup.inspect !~/no_ocn/ and @md.mod.inspect !~/--no-ocn/ #check
+ ocn=if @md.markup.inspect =~/no_ocn/ or @md.mod.inspect =~/--no-ocn/ or @skin_no_ocn
+ false
+ else true
+ end
+ data=number_paras(data,ocn)
data=markup(data)
output(data)
rescue; SiSU_Errors::Info_error.new($!,$@,@md.fns,@md.cmd).error
@@ -554,13 +562,15 @@ WOK
end
@tex_file << "\n\\end{document}"
end
- def number_paras(data)
+ def number_paras(data,ocn)
@tex_file=[]
data.each do |para|
if para =~/<\\~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ and para !~/\\end\{longtable\}|<EOF>/ #catch <!TZ!>
m=/(.+?)<\\~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m
parablock=para[m,1]
- paranum=para[m,2]
+ paranum=if ocn; para[m,2]
+ else ''
+ end
do_duo=SiSU_TeX_Pdf::Format_text_object.new(@md,parablock,paranum)
para=do_duo.para_num if parablock
elsif para =~/^<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ #2005 this is added for tables, rationalise