aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/ao_expand_insertions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v6/ao_expand_insertions.rb')
-rw-r--r--lib/sisu/v6/ao_expand_insertions.rb63
1 files changed, 43 insertions, 20 deletions
diff --git a/lib/sisu/v6/ao_expand_insertions.rb b/lib/sisu/v6/ao_expand_insertions.rb
index 45a3a4ab..8eb0e5c4 100644
--- a/lib/sisu/v6/ao_expand_insertions.rb
+++ b/lib/sisu/v6/ao_expand_insertions.rb
@@ -142,7 +142,7 @@ module SiSU_AO_Insertions
}
end
def path_and_file(fn,pth)
- "#{@base_path}/#{pth}/#{fn}"
+ @base_path + '/' + pth + '/' + fn
end
def manifest
fn=@md.file.base_filename.manifest(fnh)
@@ -150,7 +150,7 @@ module SiSU_AO_Insertions
end
def html_toc
fn=@md.file.base_filename.html_segtoc(fnh)
- "#{@base_path}/html/#{@linked_doc}/#{fn}"
+ @base_path + '/html/' + @linked_doc + '/' + fn
end
def html_doc
fn=@md.file.base_filename.html_scroll(fnh)
@@ -158,7 +158,7 @@ module SiSU_AO_Insertions
end
def html_concordance
fn=@md.file.base_filename.html_concordance
- "#{@base_path}/html/#{@linked_doc}/#{fn}"
+ @base_path + '/html/' + @linked_doc + '/' + fn
end
def epub
fn=@md.file.base_filename.epub(fnh)
@@ -197,16 +197,17 @@ module SiSU_AO_Insertions
path_and_file(fn,'digest')
end
def source
- "#{@base_path}/src/#{@src}"
+ @base_path + '/src/' + @src
end
def sisupod
- "#{@base_path}/src/#{@src}.zip"
+ @base_path + '/src/' + @src + '.zip'
end
self
end
def by_filetype(linked_doc,lng,src=nil)
@linked_doc,@lng,@src=linked_doc,lng,src
- @lc=SiSU_Env::FilenameLanguageCodeInsert.new(@md.opt,lng).language_code_insert
+ @lc=SiSU_Env::FilenameLanguageCodeInsert.new(@md.opt,lng).
+ language_code_insert
@base_path="#{@md.file.output_path.base.url}"
def fnh
{
@@ -215,7 +216,7 @@ module SiSU_AO_Insertions
}
end
def path_and_file(fn,pth)
- "#{@base_path}/#{pth}/#{fn}"
+ @base_path + '/' + pth + '/' + fn
end
def manifest
fn=@md.file.base_filename.manifest(fnh)
@@ -270,10 +271,10 @@ module SiSU_AO_Insertions
path_and_file(fn,'digest')
end
def source
- "#{@base_path}/src/#{@src}"
+ @base_path + '/src/' + @src
end
def sisupod
- "#{@base_path}/src/#{@src}.zip"
+ @base_path + '/src/' + @src + '.zip'
end
self
end
@@ -289,8 +290,8 @@ module SiSU_AO_Insertions
end
def path_and_file(fn,pth=nil)
(pth.nil?) \
- ? "#{@base_path}/#{fn}"
- : "#{@base_path}/#{pth}/#{fn}"
+ ? @base_path + '/' + fn
+ : @base_path + '/' + pth + '/' + fn
end
def manifest
fn=@md.file.base_filename.manifest(fnh)
@@ -345,28 +346,50 @@ module SiSU_AO_Insertions
path_and_file(fn)
end
def source
- "#{@base_path}/#{@src}"
+ @base_path + '/' + @src
end
def sisupod
- "#{@base_path}/#{@src}.zip"
+ @base_path + '/' + @src + '.zip'
end
self
end
def expand_insertions?
data=@data
tuned_file,tuned_file_tmp=[],[]
- codeblock_=false
+ codeblock_={
+ status: :false,
+ type: :na,
+ }
data.each do |para|
- codeblock_=if para =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?)/
- true
- elsif para =~/^(?:\}code|```(?:\s|$))/m
- false
+ codeblock_=if para =~/^code(?:\.[a-z][0-9a-z_]+)?\{/ \
+ and codeblock_[:status]==:false
+ {
+ status: :true,
+ type: :curl,
+ }
+ elsif para =~/^```[ ]+code(?:\.[a-z][0-9a-z_]+)?/ \
+ and codeblock_[:status]==:false
+ {
+ status: :true,
+ type: :tics,
+ }
+ elsif codeblock_[:type]==:curl \
+ and para =~/^\}code/m
+ {
+ status: :false,
+ type: :na,
+ }
+ elsif codeblock_[:type]==:tics \
+ and para =~/^```(?:\s|$)/m
+ {
+ status: :false,
+ type: :na,
+ }
else codeblock_
end
if para !~/^%+\s/ \
- and not codeblock_ \
+ and codeblock_[:status] != :true \
and para =~/\{(?:~\^\s+)?(.+?)\s\[(?:\d(?:[sS]*))\]\}(?:\.\.\/\S+?\/|\S+?\.ss[tm]\b)/
- manifest=nil
@u=SiSU_Env::InfoEnv.new.url
m_cmd=''
if defined? @u.remote