From 809034240a1be22cc00cb3b4c1df1dd2facdc8f8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 8 Aug 2014 00:32:27 -0400 Subject: v5: merged v6 libraries * commandline, --act0 to --act9, rc-config with flag:act[0-9] * configurable command line options increased to 0 - 9 (instead of 0 - 5) * use --act0 to --act9 (previous flags -1 to -5; -0 to -9 now available) * default --act0 * rc config with flag:act0 to flag:act9 (previously roman numerals) * legacy roman numeral configuration works (for now) * use opt.act, code internals (simplify, cleaner; remove opt.cmd & opt.mod) * hub, further changes related to use of opt.act; hub file split --- lib/sisu/v5/urls.rb | 910 +++++++++++++++++++++++++++------------------------- 1 file changed, 467 insertions(+), 443 deletions(-) (limited to 'lib/sisu/v5/urls.rb') diff --git a/lib/sisu/v5/urls.rb b/lib/sisu/v5/urls.rb index 815fe65a..4ecad1f9 100644 --- a/lib/sisu/v5/urls.rb +++ b/lib/sisu/v5/urls.rb @@ -74,7 +74,7 @@ module SiSU_Urls begin SiSU_Urls::OutputUrls.new(@opt).songsheet if @opt.fnb rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -82,11 +82,20 @@ module SiSU_Urls end end class OutputUrls - attr_reader :fns,:fnb,:cmd,:dir,:m_regular,:u + attr_reader :fns,:fnb,:act,:dir,:m_regular,:u def initialize(opt) @opt=opt @particulars=SiSU_Particulars::CombinedSingleton.instance.get_env_md(opt) - @cmd=@opt.cmd + if @particulars.is_a?(NilClass) + if @opt.act[:verbose_plus][:set]==:on \ + or @opt.act[:maintenance][:set]==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + mark("@particulars is NilClass, acceptable e.g. for --harvest") + end + exit + end + @selections=@opt.selections.str + @act=@opt.act @md=@particulars.md @env=@particulars.env @fnb=@env.fnb @@ -95,308 +104,29 @@ module SiSU_Urls @fn=SiSU_Env::EnvCall.new(@opt.fns).lang(fn_set_lang[:c]) @m_regular=/(.+?)\.(?:(?:-|ssm\.)?sst|ssm)$/ @prog=@env.program - @u ||= { - 'b --xhtml (XHTML)'=>@fn[:xhtml], - 'D[iu] --psql (DBI import/update postgresql)'=>'dbi psql', - '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 scroll)'=>@fn[:doc], - 'I --texinfo (Info file)'=>'info', - 'i --manpage (manpage)'=>'manpage', - 'm --ao (Document Abstraction)'=>'ao', - 'N --hash-digests (Digests sha512/sha256/md5)'=>@fn[:digest], - 'o --odt (ODF:ODT - Open Document)'=>@fn[:odf], - 'p --pdf (PDF landscape)'=>@fn[:pdf_l], - 'p --pdf (PDF portrait)'=>@fn[:pdf_p], - 'E --profile (Ruby profiler)'=>'profile', - 's --source (sisu markup)'=>@opt.fno, - 'S --sisupod (sisupod)'=>@fn[:sisupod], - 't --txt (Plain-text (endnotes))'=>@fn[:plain], - ' --textile (textile txt)'=>@fn[:txt_textile], - ' --asciidoc (AsciiDoc txt)'=>@fn[:txt_asciidoc], - ' --markdown (markdown txt)'=>@fn[:txt_markdown], - ' --rst (rST restructured-text)'=>@fn[:txt_rst], - ' --docbook-book (DocBook Book)'=>@fn[:xml_docbook_book], - ' --fictionbook (Fictionbook)'=>@fn[:xml_fictionbook], - 'x --xml-sax (XML sax type)'=>@fn[:sax], - 'X --xml-dom (XML dom type)'=>@fn[:dom], - ' --xml-scaffold-sisu (XML scaffold)'=>@fn[:xml_scaffold_structure_sisu], - ' --xml-scaffold-collapse (XML scaffold)'=>@fn[:xml_scaffold_structure_collapse], - 'Q --qrcode (QR Code jpg)'=>@fn[:qrcode], - 'y --manifest (Manifest, html)'=>@fn[:manifest], - 'Y (Sitemap, xml)'=>@fn[:sitemap], - 'w --concordance (Concordance, html)'=>@fn[:concordance], - }.sort {|a,b| a[0].downcase<=>b[0].downcase} end def songsheet begin - @opt.cmd=~/U/ ? urls_all : (urls_select unless @opt.act[:quiet][:set]==:on) + (@opt.act[:urls_all][:set]==:on) \ + ? urls_all \ + : (urls_select unless @opt.act[:quiet][:set]==:on) rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure end end def show - def source - def src(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.text_editor} #{@md.file.output_path.src.dir}/#{y}" - ).result - end - def pod(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.sisupod.dir}/#{y}" - ).result - end - self - end - def generic(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} #{@env.url.output_tell}/#{@fnb}/#{y}" - ).result - end - def meta(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.text_editor} ~#{y}/#{@fnb}.#{y}" - ).result - end - def text(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.txt.dir}/#{@md.file.base_filename.txt}" - ).result - end - def textile(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.textile.dir}/#{@md.file.base_filename.textile}" - ).result - end - def asciidoc(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.asciidoc.dir}/#{@md.file.base_filename.asciidoc}" - ).result - end - def markdown(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.markdown.dir}/#{@md.file.base_filename.markdown}" - ).result - end - def rst(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.rst.dir}/#{@md.file.base_filename.rst}" - ).result - end - def epub(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.epub_viewer} #{@md.file.output_path.epub.dir}/#{@md.file.base_filename.epub}" - ).result - end - def html - def scroll(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.html_scroll.dir}/#{@md.file.base_filename.html_scroll}" - ).result - end - def toc(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.html_seg.dir}/#{@md.file.base_filename.html_segtoc}" - ).result - end - def concordance(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@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 manifest(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}" - ).result - end - self - end - def qrcode(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}" - ).result - end - def odt(x) + def report(x) SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.odf_viewer} file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}" + "[#{@opt.f_pth[:lng_is]}]", + x[:cmd], + x[:viewer] + ' ' \ + + x[:f_pth] ).result end - def pdf - def portrait(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.pdf_viewer} #{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p}#{@md.papersize_array[0]}.pdf" - ).result - end - def landscape(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.pdf_viewer} #{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l}#{@md.papersize_array[0]}.pdf" - ).result - end - self - end - def manpage(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.manpage_viewer} #{@md.file.output_path.manpage.dir}/#{@md.file.base_filename.manpage}" - ).result - end - def pinfo(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "cd #{@md.file.output_path.texinfo.dir} && #{@env.program.texinfo} #{@md.file.base_filename.info}; cd -" - ).result - end - def po4a - def po(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "-#{x}", - "#{@prog.text_editor} #{@md.file.output_path.po.dir}/#{y}" - ).result - end - def pot(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "-#{x}", - "#{@prog.text_editor} #{@md.file.output_path.pot.dir}/#{y}" - ).result - end - self - end - def xhtml(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xhtml.dir}/#{@md.file.base_filename.xhtml}" - ).result - end - def xml - def sax(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_sax.dir}/#{@md.file.base_filename.xml_sax}" - ).result - end - def dom(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set],"[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_dom.dir}/#{@md.file.base_filename.xml_dom}" - ).result - end - def docbook_book(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_docbook_book.dir}/#{@md.file.base_filename.xml_docbook_book}" - ).result - end - def fictionbook(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_fictionbook.dir}/#{@md.file.base_filename.xml_fictionbook}" - ).result - end - def scaffold_structure_sisu(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_scaffold_structure_sisu.dir}/#{@md.file.base_filename.xml_scaffold_structure_sisu}" - ).result - end - def scaffold_structure_collapse(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_scaffold_structure_collapse.dir}/#{@md.file.base_filename.xml_scaffold_structure_collapse}" - ).result - end - def sitemap(x) #BROKEN - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.sitemaps.dir}/#{@md.file.base_filename.sitemap}" - ).result - end - self - end - def hash_digest(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}" - ).result - end - def db - def psql(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x} DBI psql","#{@pwd_stub}::#{@opt.fns}", - y - ).result - end - def sqlite(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@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_discrete(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "sqlite3 #{@md.file.output_path.sqlite_discrete.dir}/#{@md.file.base_filename.sqlite_discrete}" - ).result - end - self - end self end def urls_maintenance(opt,x,y) @@ -472,8 +202,341 @@ module SiSU_Urls end end end + def report_info + def dal + { + cmd: '--ao', + fn: 'ao', + } + end + def hash_digests + { + cmd: '--hash-digests (sha512/sha256/md5)', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.hash_digest.dir + '/' \ + + @md.file.base_filename.hash_digest, + fn: @fn[:digest], + } + end + def text + def txt + { + cmd: '--txt', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.txt.dir + '/' \ + + @md.file.base_filename.txt, + fn: @fn[:plain], + } + end + def asciidoc + { + cmd: '--asciidoc', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.asciidoc.dir + '/' \ + + @md.file.base_filename.asciidoc, + fn: @fn[:txt_asciidoc], + } + end + def markdown + { + cmd: '--markdown', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.markdown.dir + '/' \ + + @md.file.base_filename.markdown, + fn: @fn[:txt_markdown], + } + end + def rst + { + cmd: '--rst', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.rst.dir + '/' \ + + @md.file.base_filename.rst, + fn: @fn[:txt_rst], + } + end + def textile + { + cmd: '--textile', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.textile.dir + '/' \ + + @md.file.base_filename.textile, + fn: @fn[:txt_textile], + } + end + self + end + def html + def seg + { + cmd: '--html-seg', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.html_seg.dir + '/' \ + + @md.file.base_filename.html_segtoc, + fn: @fn[:toc], + } + end + def scroll + { + cmd: '--html-scroll', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.html_scroll.dir + '/' \ + + @md.file.base_filename.html_scroll, + fn: @fn[:doc], + } + end + def concordance + { + cmd: '--concordance', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.html_concordance.dir + '/' \ + + @md.file.base_filename.html_concordance, + fn: @fn[:concordance], + } + end + self + end + def xhtml + def xhtml + { + cmd: '--xhtml', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xhtml.dir + '/' \ + + @md.file.base_filename.xhtml, + fn: @fn[:xhtml], + } + end + def epub + { + cmd: '--epub', + viewer: @prog.epub_viewer, + f_pth: @md.file.output_path.epub.dir + '/' \ + + @md.file.base_filename.epub, + fn: @fn[:epub], + } + end + self + end + def xml + def odt + { + cmd: '--odt (ODF:ODT)', + viewer: @prog.odf_viewer, + f_pth: @md.file.output_path.odt.dir + '/' \ + + @md.file.base_filename.odt, + fn: @fn[:odf], + } + end + def docbook + { + cmd: '--docbook', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_docbook_book.dir + '/' \ + + @md.file.base_filename.xml_docbook_book, + fn: @fn[:xml_docbook_book], + } + end + def fictionbook + { + cmd: '--fictionbook', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_fictionbook.dir + '/' \ + + @md.file.base_filename.xml_fictionbook, + fn: @fn[:xml_fictionbook], + } + end + def sax + { + cmd: '--xml-sax', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_sax.dir + '/' \ + + @md.file.base_filename.xml_sax, + fn: @fn[:sax], + } + end + def dom + { + cmd: '--xml-dom', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_dom.dir + '/' \ + + @md.file.base_filename.xml_dom, + fn: @fn[:dom], + } + end + def scaffold_sisu + { + cmd: '--xml-scaffold-sisu', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_scaffold_structure_sisu.dir + '/' \ + + @md.file.base_filename.xml_scaffold_structure_sisu, + fn: @fn[:xml_scaffold_structure_sisu], + } + end + def scaffold_collapse + { + cmd: '--xml-scaffold-collapse', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_scaffold_structure_collapse.dir + '/' \ + + @md.file.base_filename.xml_scaffold_structure_collapse, + fn: @fn[:xml_scaffold_structure_collapse], + } + end + self + end + def pdf + def landscape + { + cmd: '--pdf (landscape)', + viewer: @prog.pdf_viewer, + f_pth: @md.file.output_path.pdf.dir + '/' \ + + @md.file.base_filename.pdf_l \ + + @md.papersize_array[0] + '.pdf', + fn: @fn[:pdf_l], + } + end + def portrait + { + cmd: '--pdf (portrait)', + viewer: @prog.pdf_viewer, + f_pth: @md.file.output_path.pdf.dir + '/' \ + + @md.file.base_filename.pdf_p \ + + @md.papersize_array[0] + '.pdf', + fn: @fn[:pdf_p], + } + end + self + end + def manpage + { + cmd: '--manpage', + viewer: @prog.manpage_viewer, + f_pth: @md.file.output_path.manpage.dir + '/' \ + + @md.file.base_filename.manpage, + fn: 'manpage', + } + end + def texinfo + { + cmd: '--texinfo', + viewer: '', + f_pth: 'cd ' \ + + @md.file.output_path.texinfo.dir + ' && ' \ + + @env.program.texinfo + ' ' \ + + @md.file.base_filename.info \ + + '; cd -', + fn: 'info', + } + end + def db + def psql + { + cmd: '--psql --update/--import', + viewer: '', + f_pth: @pwd_stub + '::' \ + + @opt.fns \ + + 'dbi psql', + fn: 'dbi psql', + } + end + def sqlite + { + cmd: '--sqlite --update/--import', + viewer: 'sqlite3 ', + f_pth: @env.path.webserv + '/' \ + + @md.opt.f_pth[:pth_stub] + '/' \ + + 'sisu_sqlite.db', + fn: 'dbi sqlite3', + } + end + def sqlite_discrete + { + cmd: '--sqlite --update/--import', + viewer: 'sqlite3 ', + f_pth: @md.file.output_path.sqlite_discrete.dir + '/' \ + + @md.file.base_filename.sqlite_discrete, + fn: 'dbi sqlite3', + } + end + self + end + def po4a + def po + { + cmd: '--po4a/--pot', + viewer: @prog.web_browser, + f_pth: @prog.text_editor + ' ' \ + + @md.file.output_path.po.dir \ + + '/' + y, + fn: @fn[:pot], + } + end + def pot + { + cmd: '--po4a/--pot', + viewer: @prog.web_browser, + f_pth: @prog.text_editor + ' ' \ + + @md.file.output_path.pot.dir \ + + '/' + y, + fn: @fn[:pot], + } + end + self + end + def source + { + cmd: '--source (sisu markup)', + viewer: @prog.text_editor, + f_pth: @md.file.output_path.src.dir + '/' \ + + @opt.fno, + fn: @opt.fno, + } + end + def sisupod + { + cmd: '--sisupod', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.sisupod.dir + '/' \ + + @opt.fno, + fn: @fn[:sisupod], + } + end + def ruby_profile + { + cmd: '--profile (ruby profiler)', + fn: 'profile', + } + end + def qrcode + { + cmd: '--qrcode', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.manifest.dir + '/' \ + + @md.file.base_filename.manifest, + fn: @fn[:qrcode], + } + end + def manifest + { + cmd: '--manifest', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.manifest.dir + '/' \ + + @md.file.base_filename.manifest, + fn: @fn[:manifest], + } + end + def sitemap + { + cmd: '--sitemap', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.sitemaps.dir + '/' \ + + @md.file.base_filename.sitemap, + fn: @fn[:sitemap], + } + end + self + end def urls_select - unless @opt.cmd =~/q/ + unless @opt.act[:quiet][:set]==:on i1='[' + @opt.f_pth[:lng_is] + ']' i2='file://' \ + @md.file.output_path.manifest.dir + '/' \ @@ -490,168 +553,129 @@ module SiSU_Urls 'URL (output manifest)', i1, i2 ).grey_title_grey_blue - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - i1, i2, - ).flow if @opt.cmd =~/[MVv]/ + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + i1, i2, + ).flow + end end m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m @pwd_stub="#{@env.url.output_tell}"[m,1] unless @opt.act[:quiet][:set]==:on - @u.each do |x,y| - if @opt.fns =~ @m_regular - if (@opt.act[:verbose][:set]==:on \ - || @opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - if x=~/--txt\b/ \ - and @opt.act[:txt][:set]==:on - show.text(x) - end - if x=~/--textile\b/ \ - and @opt.act[:txt_textile][:set]==:on - show.textile(x) - end - if x=~/--asciidoc\b/ \ - and @opt.act[:txt_asciidoc][:set]==:on - show.asciidoc(x) - end - if x=~/--markdown\b/ \ - and @opt.act[:txt_markdown][:set]==:on - show.markdown(x) - end - if x=~/--rst\b/ \ - and @opt.act[:txt_rst][:set]==:on - show.rst(x) - end - if x=~/--xhtml\b/ \ - and @opt.act[:xhtml][:set]==:on - show.xhtml(x) - end - if x=~/--psql\b/ \ - and @opt.act[:psql][:set]==:on - show.db.psql(x,y) - end - if x=~/d\s+--sqlite\b|--sql\b/ \ - and @opt.act[:sqlite_discrete][:set]==:on - show.db.sqlite_discrete(x,y) - end - if x=~/d\[iu\]\s+--sqlite\b/ \ - and @opt.act[:sqlite][:set]==:on - show.db.sqlite(x,y) - end - if x=~/--epub\b/ \ - and @opt.act[:epub][:set]==:on - show.epub(x) - end - if x=~/--html\b/ \ - and (@opt.act[:html][:set]==:on \ - or @opt.act[:html_scroll][:set]==:on \ - or @opt.act[:html_seg][:set]==:on) - if x =~/scroll/ - if @opt.act[:html_scroll][:set]==:on - show.html.scroll(x) - end - else - if @opt.act[:html_seg][:set]==:on - show.html.toc(x) - end - end - end - if x=~/--texinfo\b/ \ - and @opt.cmd =~/I/ - show.pinfo(x,y) - end - if x=~/--manpage\b/ \ - and @opt.act[:manpage][:set]==:on - show.manpage(x) - end - if x=~/--hash-digests\b/ \ - and @opt.cmd =~/N/ - show.hash_digest(x) - end - if x=~/--odt\b|--odf\b/ \ - and @opt.act[:odt][:set]==:on - show.odt(x) - end - if x=~/^P/ \ - and @opt.cmd =~/P/ - if @opt.fns =~/\S+?~\S{2}(?:_\S{2})?\.ss[mt]/ - f=y.gsub(/\.pot$/,'.po') - show.po4a.po(x,f) - else - show.po4a.pot(x,f) - end - end - if x=~/--pdf\b/ \ - and (@opt.act[:pdf][:set]==:on \ - or @opt.act[:pdf_p][:set]==:on \ - or @opt.act[:pdf_l][:set]==:on) - if x =~/portrait/ - if @opt.act[:pdf_p][:set]==:on - show.pdf.portrait(x) - end - else - if @opt.act[:pdf_l][:set]==:on - show.pdf.landscape(x) - end - end - end - if x=~/--sisupod\b/ \ - and @opt.act[:sisupod][:set]==:on - (@opt.fno =~/\.ssm$/) \ - ? 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=~/--source\b/ \ - and @opt.act[:share_source][:set]==:on - show.source.src(x,y) - end - if x=~/--concordance\b/ \ - and @opt.act[:concordance][:set]==:on - show.html.concordance(x) - end - if x=~/--xml-dom\b/ \ - and @opt.act[:xml_dom][:set]==:on - show.xml.dom(x) - end - if x=~/--xml-sax\b/ \ - and @opt.act[:xml_sax][:set]==:on - show.xml.sax(x) - end - if x=~/--docbook-book\b/ \ - and @opt.act[:xml_docbook_book][:set]==:on - show.xml.docbook_book(x) - end - if x=~/--fictionbook\b/ \ - and @opt.act[:xml_fictionbook][:set]==:on - show.xml.fictionbook(x) - end - if x=~/--xml-scaffold-sisu\b/ \ - and @opt.act[:xml_scaffold_structure_sisu][:set]==:on - show.xml.scaffold_structure_sisu(x) + if @opt.fns =~ @m_regular + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + if @opt.act[:txt][:set]==:on + show.report(report_info.text.txt) + end + if @opt.act[:txt_textile][:set]==:on + show.report(report_info.text.textile) + end + if @opt.act[:txt_asciidoc][:set]==:on + show.report(report_info.text.asciidoc) + end + if @opt.act[:txt_markdown][:set]==:on + show.report(report_info.text.markdown) + end + if @opt.act[:txt_rst][:set]==:on + show.report(report_info.text.rst) + end + if (@opt.act[:html][:set]==:on \ + or @opt.act[:html_scroll][:set]==:on \ + or @opt.act[:html_seg][:set]==:on) + if @opt.act[:html_scroll][:set]==:on + show.report(report_info.html.scroll) end - if x=~/--xml-scaffold-collapse\b/ \ - and @opt.act[:xml_scaffold_structure_collapse][:set]==:on - show.xml.scaffold_structure_collapse(x) + if @opt.act[:html_seg][:set]==:on + show.report(report_info.html.seg) end - if x=~/--qrcode\b/ \ - and @opt.act[:qrcode][:set]==:on - show.qrcode(x) + end + if @opt.act[:concordance][:set]==:on + show.report(report_info.html.concordance) + end + if @opt.act[:xhtml][:set]==:on + show.report(report_info.xhtml.xhtml) + end + if @opt.act[:epub][:set]==:on + show.report(report_info.xhtml.epub) + end + if @opt.act[:odt][:set]==:on + show.report(report_info.xml.odt) + end + if @opt.act[:xml_dom][:set]==:on + show.report(report_info.xml.dom) + end + if @opt.act[:xml_sax][:set]==:on + show.report(report_info.xml.sax) + end + if @opt.act[:xml_docbook_book][:set]==:on + show.report(report_info.xml.docbook) + end + if @opt.act[:xml_fictionbook][:set]==:on + show.report(report_info.xml.fictionbook) + end + if @opt.act[:xml_scaffold_structure_sisu][:set]==:on + show.report(report_info.xml.scaffold_structure_sisu) + end + if @opt.act[:xml_scaffold_structure_collapse][:set]==:on + show.report(report_info.xml.scaffold_collapse) + end + if (@opt.act[:pdf][:set]==:on \ + or @opt.act[:pdf_p][:set]==:on \ + or @opt.act[:pdf_l][:set]==:on) + if @opt.act[:pdf_p][:set]==:on + show.report(report_info.pdf.portrait) end - if x=~/--sitemap\b/ \ - and @opt.cmd =~/Y/ #BROKEN - show.xml.sitemap(x) + if @opt.act[:pdf_l][:set]==:on + show.report(report_info.pdf.landscape) end - if x=~/--manifest\b/ \ - and @opt.act[:manifest][:set]==:on - show.html.manifest(x) + end + if @opt.act[:psql][:set]==:on + show.report(report_info.db.psql) + end + if @opt.act[:sqlite_discrete][:set]==:on + show.report(report_info.db.sqlite_discrete) + end + if @opt.act[:sqlite][:set]==:on + show.report(report_info.db.sqlite) + end + if @opt.act[:texinfo][:set]==:on + show.report(report_info.texinfo) + end + if @opt.act[:manpage][:set]==:on + show.report(report_info.manpage) + end + if @opt.act[:hash_digests][:set]==:on + show.report(report_info.hash_digests) + end + if @opt.act[:po4a][:set]==:on + if @opt.fns =~/\S+?~\S{2}(?:_\S{2})?\.ss[mt]/ + f=y.gsub(/\.pot$/,'.po') + show.po4a.po(x,f) + else + show.po4a.pot(x,f) end end - if (@opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - urls_maintenance(@opt,x,y) + if @opt.act[:share_source][:set]==:on + show.report(report_info.source) + end + if @opt.act[:sisupod][:set]==:on + show.report(report_info.sisupod) end + if @opt.act[:qrcode][:set]==:on + show.report(report_info.qrcode) + end + if @opt.act[:manifest][:set]==:on + show.report(report_info.manifest) + end + end + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + urls_maintenance(@opt,x,y) end end end -- cgit v1.2.3