aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/urls.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/urls.rb')
-rw-r--r--lib/sisu/v3/urls.rb93
1 files changed, 53 insertions, 40 deletions
diff --git a/lib/sisu/v3/urls.rb b/lib/sisu/v3/urls.rb
index 31614a37..ddb62fa7 100644
--- a/lib/sisu/v3/urls.rb
+++ b/lib/sisu/v3/urls.rb
@@ -93,20 +93,18 @@ module SiSU_Urls
else 'not recognised file'
end
@u ||= {
- 'a --txt (Plain-text (footnotes))'=>@fn[:plain],
'b --xhtml (XHTML)'=>@fn[:xhtml],
'D[iu] --psql (DBI import/update postgresql)'=>'dbi psql',
- 'd[iu] --sqlite (DBI import/update sqlite)'=>'dbi sqlite3',
+ 'd --sqlite (DBI sqlite)'=>'dbi sqlite3',
+ 'd[iu] --sqlite (DBI sqlite)'=>'dbi sqlite3',
'e --epub (EPUB)'=>@fn[:epub],
'P --pot (Pot)'=>@fn[:pot],
'h --html (HTML segmented)'=>@fn[:toc],
- 'H --html (HTML segmented)'=>@fn[:toc],
'h --html (HTML scroll)'=>@fn[:doc],
- 'H --html (HTML scroll)'=>@fn[:doc],
'I --texinfo (Info file)'=>'info',
- 'i --man (manpage)'=>'manpage',
+ 'i --manpage (manpage)'=>'manpage',
'm --dal (Document Abstraction)'=>'dal',
- 'N (Digests md5/sha256)'=>@fn[:digest],
+ 'N --hash-digests (Digests md5/sha256)'=>@fn[:digest],
'o --odt (ODF:ODT - Open Document)'=>@fn[:odf],
'p --pdf (PDF landscape)'=>@fn[:pdf_l],
'p --pdf (PDF portrait)'=>@fn[:pdf_p],
@@ -116,6 +114,7 @@ module SiSU_Urls
't --txt (Plain-text (endnotes))'=>@fn[:plain],
'x --xml-sax (XML sax type)'=>@fn[:sax],
'X --xml-dom (XML dom type)'=>@fn[:dom],
+ 'Q --qrcode (QR Code jpg)'=>@fn[:qrcode],
'y --manifest (Manifest, html)'=>@fn[:manifest],
'Y (Sitemap, xml)'=>@fn[:sitemap],
'w --concordance (Concordance, html)'=>@fn[:concordance],
@@ -160,6 +159,9 @@ module SiSU_Urls
def concordance(x)
SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.html_concordance.dir}/#{@md.file.base_filename.html_concordance}").result
end
+ def qrcode(x)
+ SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}").result
+ end
def manifest(x)
SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}").result
end
@@ -215,7 +217,10 @@ module SiSU_Urls
SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x} DBI psql","#{@pwd_stub}::#{@opt.fns}",y).result
end
def sqlite(x,y)
- SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x} DBI sqlite","sqlite3 #{@md.file.output_path.sqlite_discreet.dir}/#{@md.file.base_filename.sqlite_discreet}\n sqlite3 #{@env.path.webserv}/#{@md.opt.f_pth[:pth_stub]}/sisu_sqlite.db\n", "#{y}").result
+ SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x} DBI sqlite","sqlite3 #{@env.path.webserv}/#{@md.opt.f_pth[:pth_stub]}/sisu_sqlite.db").result
+ end
+ def sqlite_discreet(x,y)
+ SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","sqlite3 #{@md.file.output_path.sqlite_discreet.dir}/#{@md.file.base_filename.sqlite_discreet}").result
end
self
end
@@ -284,48 +289,52 @@ module SiSU_Urls
@u.each do |x,y|
if @opt.fns =~ @m_regular
if @opt.cmd =~/[MVv]/
- if (x=~/^a/ and @opt.cmd =~/a/) \
- or (x=~/^t/ and @opt.cmd =~/t/)
+ if x=~/--txt\b/ \
+ and @opt.act[:txt][:set]==:on
show.text(x)
end
- if x=~/^b/ \
- and @opt.cmd =~/b/
+ if x=~/--xhtml\b/ \
+ and @opt.act[:xhtml][:set]==:on
show.xhtml(x)
end
- if x=~/^D/ \
- and @opt.cmd =~/D/
+ if x=~/--psql\b/ \
+ and @opt.act[:psql][:set]==:on
show.db.psql(x,y)
end
- if x=~/^d/ \
- and @opt.cmd =~/d/
+ if x=~/d\s+--sqlite\b|--sql\b/ \
+ and @opt.act[:sqlite_discreet][:set]==:on
+ show.db.sqlite_discreet(x,y)
+ end
+ if x=~/d\[iu\]\s+--sqlite\b/ \
+ and @opt.act[:sqlite][:set]==:on
show.db.sqlite(x,y)
end
- if x=~/^e/ \
- and @opt.cmd =~/e/
+ if x=~/--epub\b/ \
+ and @opt.act[:epub][:set]==:on
show.epub(x)
end
- if x=~/^h/ \
- and @opt.cmd =~/h/
+ if x=~/--html\b/ \
+ and @opt.act[:html][:set]==:on
if x =~/scroll/
show.html.scroll(x)
else
show.html.toc(x)
end
end
- if x=~/^I/ \
+ if x=~/--texinfo\b/ \
and @opt.cmd =~/I/
show.pinfo(x,y)
end
- if x=~/^i/ \
- and @opt.cmd =~/i/
+ if x=~/--manpage\b/ \
+ and @opt.act[:manpage][:set]==:on
show.manpage(x)
end
- if x=~/^N/ \
+ if x=~/--hash-digests\b/ \
and @opt.cmd =~/N/
show.hash_digest(x)
end
- if x=~/^o/ \
- and @opt.cmd =~/o/
+ if x=~/--odt\b|--odf\b/ \
+ and @opt.act[:odt][:set]==:on
show.odt(x)
end
if x=~/^P/ \
@@ -337,43 +346,47 @@ module SiSU_Urls
show.po4a.pot(x,f)
end
end
- if x=~/^p/ \
- and @opt.cmd =~/p/
+ if x=~/--pdf\b/ \
+ and @opt.act[:pdf][:set]==:on
if x =~/portrait/
show.pdf.portrait(x)
else
show.pdf.landscape(x)
end
end
- if x=~/^S/ \
- and @opt.cmd =~/S/
+ if x=~/--sisupod\b/ \
+ and @opt.act[:sisupod][:set]==:on
(@opt.fns =~/\.ssm\.sst$/) \
? y.gsub(/(?:\~\S{2,3})?(\.ssm.sst\.txz)$/,'.ssm.txz')
: y.gsub(/(?:\~\S{2,3})?(\.sst\.txz)$/,'\1')
show.source.pod(x,y)
end
- if x=~/^s/ \
- and @opt.cmd =~/s/
+ if x=~/--source\b/ \
+ and @opt.act[:share_source][:set]==:on
show.source.src(x,y)
end
- if x=~/^w/ \
- and @opt.cmd =~/w/
+ if x=~/--concordance\b/ \
+ and @opt.act[:concordance][:set]==:on
show.html.concordance(x)
end
- if x=~/^X/ \
- and @opt.cmd =~/X/
+ if x=~/--xml-dom\b/ \
+ and @opt.act[:xml_dom][:set]==:on
show.xml.dom(x)
end
- if x=~/^x/ \
- and @opt.cmd =~/x/
+ if x=~/--xml-sax\b/ \
+ and @opt.act[:xml_sax][:set]==:on
show.xml.sax(x)
end
- if x=~/^Y/ \
+ if x=~/--qrcode\b/ \
+ and @opt.act[:qrcode][:set]==:on
+ show.qrcode(x)
+ end
+ if x=~/--sitemap\b/ \
and @opt.cmd =~/Y/ #BROKEN
show.xml.sitemap(x)
end
- if x=~/^y/ \
- and @opt.cmd =~/y/
+ if x=~/--manifest\b/ \
+ and @opt.act[:manifest][:set]==:on
show.html.manifest(x)
end
end