From 5dce93cc882b3d21116a8a461fc73d244de7c71a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 12 Sep 2014 21:28:27 -0400 Subject: v5 v6: ao, expansion of links to internal filepaths (re: syntax based shortcut) * expansion of sisu output filepaths (sync with use of --act0 to --act9) --- data/doc/sisu/CHANGELOG_v5 | 3 ++ data/doc/sisu/CHANGELOG_v6 | 3 ++ lib/sisu/v5/ao_expand_insertions.rb | 56 ++++++++++++++++++++++++++----------- lib/sisu/v6/ao_expand_insertions.rb | 56 ++++++++++++++++++++++++++----------- 4 files changed, 86 insertions(+), 32 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index cbd764d3..5a09b662 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.6.orig.tar.xz sisu_5.6.6.orig.tar.xz sisu_5.6.6-1.dsc +* ao, expansion of links to internal filepaths (re: syntax based shortcut) + (expansion of sisu output filepaths, sync with use of --act0 to --act9) + * se, processing, adjustments to default settings for --act0 to --act9 * se, env, lingual: mono / multi, rc settings diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index e1691f20..f95cb51c 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -28,6 +28,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.7.orig.tar.xz sisu_6.2.7.orig.tar.xz sisu_6.2.7-1.dsc +* ao, expansion of links to internal filepaths (re: syntax based shortcut) + (expansion of sisu output filepaths, sync with use of --act0 to --act9) + * se, processing, adjustments to default settings for --act0 to --act9 * se, env, lingual: mono / multi, rc settings diff --git a/lib/sisu/v5/ao_expand_insertions.rb b/lib/sisu/v5/ao_expand_insertions.rb index 483e9fdb..4f4f7ae5 100644 --- a/lib/sisu/v5/ao_expand_insertions.rb +++ b/lib/sisu/v5/ao_expand_insertions.rb @@ -81,52 +81,61 @@ module SiSU_AO_Insertions end file_type_names={} file_type_names[:gen],file_type_names[:src]=[],[] - file_type_names[:gen] <<= if cmd_list =~ /y/ + file_type_names[:gen] <<= if cmd_list =~ /\b--manifest\b/ "~^ { document manifest }#{lnk[:manifest]}" end - file_type_names[:gen] <<= if cmd_list =~ /h/ + file_type_names[:gen] <<= if cmd_list =~ /\b--html\b/ [ " { html, segmented text }#{lnk[:html_toc]}", " { html, scroll, document in one }#{lnk[:html_doc]}", ] end - file_type_names[:gen] <<= if cmd_list =~ /e/ + file_type_names[:gen] <<= if cmd_list =~ /\b--epub\b/ [" { epub }#{lnk[:epub]}"] end - file_type_names[:gen] <<= if cmd_list =~ /p/ + file_type_names[:gen] <<= if cmd_list =~ /\b--pdf\b/ \ + or cmd_list =~ /--pdf-landscape/ [ " { pdf, landscape }#{lnk[:pdf_landscape]}", + ] + end + file_type_names[:gen] <<= if cmd_list =~ /\b--pdf\b/ \ + or cmd_list =~ /--pdf-portrait/ + [ " { pdf, portrait }#{lnk[:pdf_portrait]}", ] end - file_type_names[:gen] <<= if cmd_list =~ /o/ + file_type_names[:gen] <<= if cmd_list =~ /\b(?:--odt|--odf)\b/ " { odf:odt, open document text }#{lnk[:odt]}" end - file_type_names[:gen] <<= if cmd_list =~ /b/ + file_type_names[:gen] <<= if cmd_list =~ /\b--xhtml\b/ " { xhtml scroll }#{lnk[:xhtml]}" end - file_type_names[:gen] <<= if cmd_list =~ /x/ + file_type_names[:gen] <<= if cmd_list =~ /\b--docbook\b/ + " { docbook }#{lnk[:docbook]}" #CHECK + end + file_type_names[:gen] <<= if cmd_list =~ /\b--xml-sax\b/ " { xml, sax }#{lnk[:xml_sax]}" end - file_type_names[:gen] <<= if cmd_list =~ /X/ + file_type_names[:gen] <<= if cmd_list =~ /\b--xml-dom\b/ " { xml, dom }#{lnk[:xml_dom]}" end - file_type_names[:gen] <<= if cmd_list =~ /a/ + file_type_names[:gen] <<= if cmd_list =~ /\b(?:--txt|--text|--plaintext)\b/ " { plain text utf-8 }#{lnk[:txt]}" end - file_type_names[:gen] <<= if cmd_list =~ /g/ - 'wiki.txt' - end - file_type_names[:gen] <<= if cmd_list =~ /w/ + #file_type_names[:gen] <<= if cmd_list =~ /g/ + # 'wiki.txt' + #end + file_type_names[:gen] <<= if cmd_list =~ /\b--concordance\b/ " { concordance }#{lnk[:html_concordance]}" end - file_type_names[:gen] <<= if cmd_list =~ /N/ + file_type_names[:gen] <<= if cmd_list =~ /\b--digest\b/ " { dcc, document content certificate (digests) }#{lnk[:digest]}" end - file_type_names[:src] <<= if source and cmd_shortcut =~ /s/ + file_type_names[:src] <<= if source and cmd_shortcut =~ /\b--source\b/ " { markup source text }#{lnk[:source]}" end - file_type_names[:src] <<= if cmd_shortcut =~ /S/ + file_type_names[:src] <<= if cmd_shortcut =~ /\b--sisupod\b/ " { markup source (zipped) pod }#{lnk[:sisupod]}" end file_type_names[:gen]=file_type_names[:gen].flatten @@ -180,6 +189,10 @@ module SiSU_AO_Insertions fn=@md.file.base_filename.xhtml(fnh) path_and_file(fn,'xhtml') end + def docbook + fn=@md.file.base_filename.xml_docbook_book(fnh) + path_and_file(fn,'docbook') + end def xml_sax fn=@md.file.base_filename.xml_sax(fnh) path_and_file(fn,'xml_sax') @@ -254,6 +267,10 @@ module SiSU_AO_Insertions fn=@md.file.base_filename.xhtml(fnh) path_and_file(fn,'xhtml') end + def docbook + fn=@md.file.base_filename.xml_docbook_book(fnh) + path_and_file(fn,'docbook') + end def xml_sax fn=@md.file.base_filename.xml_sax(fnh) path_and_file(fn,'xml_sax') @@ -329,6 +346,10 @@ module SiSU_AO_Insertions fn=@md.file.base_filename.xhtml(fnh) path_and_file(fn) end + def docbook + fn=@md.file.base_filename.xml_docbook_book(fnh) + path_and_file(fn) + end def xml_sax fn=@md.file.base_filename.xml_sax(fnh) path_and_file(fn) @@ -418,6 +439,7 @@ module SiSU_AO_Insertions pdf_portrait: by_language(m_linked_doc,m_linked_doc_lang).pdf_landscape, odt: by_language(m_linked_doc,m_linked_doc_lang).odt, xhtml: by_language(m_linked_doc,m_linked_doc_lang).xhtml, + docbook: by_language(m_linked_doc,m_linked_doc_lang).docbook, xml_sax: by_language(m_linked_doc,m_linked_doc_lang).xml_sax, xml_dom: by_language(m_linked_doc,m_linked_doc_lang).xml_dom, txt: by_language(m_linked_doc,m_linked_doc_lang).txt, @@ -436,6 +458,7 @@ module SiSU_AO_Insertions pdf_portrait: by_filetype(m_linked_doc,m_linked_doc_lang).pdf_landscape, odt: by_filetype(m_linked_doc,m_linked_doc_lang).odt, xhtml: by_filetype(m_linked_doc,m_linked_doc_lang).xhtml, + docbook: by_filetype(m_linked_doc,m_linked_doc_lang).docbook, xml_sax: by_filetype(m_linked_doc,m_linked_doc_lang).xml_sax, xml_dom: by_filetype(m_linked_doc,m_linked_doc_lang).xml_dom, txt: by_filetype(m_linked_doc,m_linked_doc_lang).txt, @@ -454,6 +477,7 @@ module SiSU_AO_Insertions pdf_portrait: by_filename(m_linked_doc,m_linked_doc_lang).pdf_landscape, odt: by_filename(m_linked_doc,m_linked_doc_lang).odt, xhtml: by_filename(m_linked_doc,m_linked_doc_lang).xhtml, + docbook: by_filename(m_linked_doc,m_linked_doc_lang).docbook, xml_sax: by_filename(m_linked_doc,m_linked_doc_lang).xml_sax, xml_dom: by_filename(m_linked_doc,m_linked_doc_lang).xml_dom, txt: by_filename(m_linked_doc,m_linked_doc_lang).txt, diff --git a/lib/sisu/v6/ao_expand_insertions.rb b/lib/sisu/v6/ao_expand_insertions.rb index 8eb0e5c4..bcbec588 100644 --- a/lib/sisu/v6/ao_expand_insertions.rb +++ b/lib/sisu/v6/ao_expand_insertions.rb @@ -81,52 +81,61 @@ module SiSU_AO_Insertions end file_type_names={} file_type_names[:gen],file_type_names[:src]=[],[] - file_type_names[:gen] <<= if cmd_list =~ /y/ + file_type_names[:gen] <<= if cmd_list =~ /\b--manifest\b/ "~^ { document manifest }#{lnk[:manifest]}" end - file_type_names[:gen] <<= if cmd_list =~ /h/ + file_type_names[:gen] <<= if cmd_list =~ /\b--html\b/ [ " { html, segmented text }#{lnk[:html_toc]}", " { html, scroll, document in one }#{lnk[:html_doc]}", ] end - file_type_names[:gen] <<= if cmd_list =~ /e/ + file_type_names[:gen] <<= if cmd_list =~ /\b--epub\b/ [" { epub }#{lnk[:epub]}"] end - file_type_names[:gen] <<= if cmd_list =~ /p/ + file_type_names[:gen] <<= if cmd_list =~ /\b--pdf\b/ \ + or cmd_list =~ /--pdf-landscape/ [ " { pdf, landscape }#{lnk[:pdf_landscape]}", + ] + end + file_type_names[:gen] <<= if cmd_list =~ /\b--pdf\b/ \ + or cmd_list =~ /--pdf-portrait/ + [ " { pdf, portrait }#{lnk[:pdf_portrait]}", ] end - file_type_names[:gen] <<= if cmd_list =~ /o/ + file_type_names[:gen] <<= if cmd_list =~ /\b(?:--odt|--odf)\b/ " { odf:odt, open document text }#{lnk[:odt]}" end - file_type_names[:gen] <<= if cmd_list =~ /b/ + file_type_names[:gen] <<= if cmd_list =~ /\b--xhtml\b/ " { xhtml scroll }#{lnk[:xhtml]}" end - file_type_names[:gen] <<= if cmd_list =~ /x/ + file_type_names[:gen] <<= if cmd_list =~ /\b--docbook\b/ + " { docbook }#{lnk[:docbook]}" #CHECK + end + file_type_names[:gen] <<= if cmd_list =~ /\b--xml-sax\b/ " { xml, sax }#{lnk[:xml_sax]}" end - file_type_names[:gen] <<= if cmd_list =~ /X/ + file_type_names[:gen] <<= if cmd_list =~ /\b--xml-dom\b/ " { xml, dom }#{lnk[:xml_dom]}" end - file_type_names[:gen] <<= if cmd_list =~ /a/ + file_type_names[:gen] <<= if cmd_list =~ /\b(?:--txt|--text|--plaintext)\b/ " { plain text utf-8 }#{lnk[:txt]}" end - file_type_names[:gen] <<= if cmd_list =~ /g/ - 'wiki.txt' - end - file_type_names[:gen] <<= if cmd_list =~ /w/ + #file_type_names[:gen] <<= if cmd_list =~ /g/ + # 'wiki.txt' + #end + file_type_names[:gen] <<= if cmd_list =~ /\b--concordance\b/ " { concordance }#{lnk[:html_concordance]}" end - file_type_names[:gen] <<= if cmd_list =~ /N/ + file_type_names[:gen] <<= if cmd_list =~ /\b--digest\b/ " { dcc, document content certificate (digests) }#{lnk[:digest]}" end - file_type_names[:src] <<= if source and cmd_shortcut =~ /s/ + file_type_names[:src] <<= if source and cmd_shortcut =~ /\b--source\b/ " { markup source text }#{lnk[:source]}" end - file_type_names[:src] <<= if cmd_shortcut =~ /S/ + file_type_names[:src] <<= if cmd_shortcut =~ /\b--sisupod\b/ " { markup source (zipped) pod }#{lnk[:sisupod]}" end file_type_names[:gen]=file_type_names[:gen].flatten @@ -180,6 +189,10 @@ module SiSU_AO_Insertions fn=@md.file.base_filename.xhtml(fnh) path_and_file(fn,'xhtml') end + def docbook + fn=@md.file.base_filename.xml_docbook_book(fnh) + path_and_file(fn,'docbook') + end def xml_sax fn=@md.file.base_filename.xml_sax(fnh) path_and_file(fn,'xml_sax') @@ -254,6 +267,10 @@ module SiSU_AO_Insertions fn=@md.file.base_filename.xhtml(fnh) path_and_file(fn,'xhtml') end + def docbook + fn=@md.file.base_filename.xml_docbook_book(fnh) + path_and_file(fn,'docbook') + end def xml_sax fn=@md.file.base_filename.xml_sax(fnh) path_and_file(fn,'xml_sax') @@ -329,6 +346,10 @@ module SiSU_AO_Insertions fn=@md.file.base_filename.xhtml(fnh) path_and_file(fn) end + def docbook + fn=@md.file.base_filename.xml_docbook_book(fnh) + path_and_file(fn) + end def xml_sax fn=@md.file.base_filename.xml_sax(fnh) path_and_file(fn) @@ -418,6 +439,7 @@ module SiSU_AO_Insertions pdf_portrait: by_language(m_linked_doc,m_linked_doc_lang).pdf_landscape, odt: by_language(m_linked_doc,m_linked_doc_lang).odt, xhtml: by_language(m_linked_doc,m_linked_doc_lang).xhtml, + docbook: by_language(m_linked_doc,m_linked_doc_lang).docbook, xml_sax: by_language(m_linked_doc,m_linked_doc_lang).xml_sax, xml_dom: by_language(m_linked_doc,m_linked_doc_lang).xml_dom, txt: by_language(m_linked_doc,m_linked_doc_lang).txt, @@ -436,6 +458,7 @@ module SiSU_AO_Insertions pdf_portrait: by_filetype(m_linked_doc,m_linked_doc_lang).pdf_landscape, odt: by_filetype(m_linked_doc,m_linked_doc_lang).odt, xhtml: by_filetype(m_linked_doc,m_linked_doc_lang).xhtml, + docbook: by_filetype(m_linked_doc,m_linked_doc_lang).docbook, xml_sax: by_filetype(m_linked_doc,m_linked_doc_lang).xml_sax, xml_dom: by_filetype(m_linked_doc,m_linked_doc_lang).xml_dom, txt: by_filetype(m_linked_doc,m_linked_doc_lang).txt, @@ -454,6 +477,7 @@ module SiSU_AO_Insertions pdf_portrait: by_filename(m_linked_doc,m_linked_doc_lang).pdf_landscape, odt: by_filename(m_linked_doc,m_linked_doc_lang).odt, xhtml: by_filename(m_linked_doc,m_linked_doc_lang).xhtml, + docbook: by_filename(m_linked_doc,m_linked_doc_lang).docbook, xml_sax: by_filename(m_linked_doc,m_linked_doc_lang).xml_sax, xml_dom: by_filename(m_linked_doc,m_linked_doc_lang).xml_dom, txt: by_filename(m_linked_doc,m_linked_doc_lang).txt, -- cgit v1.2.3