#{@translate.manifest_description}
-#{@md.dc_title}
-#{@md.dc_creator}
+#{@md.full_title}
+#{@md.author}
diff --git a/lib/sisu/v0/manpage.rb b/lib/sisu/v0/manpage.rb index d4b315f4..d369cc8c 100644 --- a/lib/sisu/v0/manpage.rb +++ b/lib/sisu/v0/manpage.rb @@ -418,7 +418,7 @@ WOK def publish(manpage) divider='=' content=[] - date=if @md.dc_date; @md.dc_date + date=if @md.date; @md.date else '2007' #date missing decide on action end proj=SiSU_Env::Info_version.new.get_version diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb index ec80e0dd..bcf6f97b 100644 --- a/lib/sisu/v0/param.rb +++ b/lib/sisu/v0/param.rb @@ -118,9 +118,9 @@ module SiSU_Param @doc={ :lv=>[] } @doc[:fns],@doc[:fnb],@doc[:scr_suffix]='','','' @@publisher='SiSU scribe' - attr_accessor :cmd,:mod,:env,:fn,:fns,:fnb,:fnn,:fnt,:fnl,:flv,:fnz,:fnstex,:ocn,:sfx_src,:sfx,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:site_skin,:sisu,:sisu_version,:ruby_version,:title,:dc_title,:html_title,:subtitle,:subtitle_tex,:creator_home,:dc_creator,:author_title,:author_nationality,:authors,:authorship,:translator,:illustrator,:prepared_by,:digitized_by,:dc_subject,:dc_description,:dc_publisher,:dc_contributor,:dc_date,:dc_date_created,:dc_date_issued,:dc_date_available,:dc_date_valid,:dc_date_modified,:date_translated,:date_added_to_site,:date_scheme,:date_created_scheme,:date_issued_scheme,:date_available_scheme,:date_valid_scheme,:date_modified_scheme,:dc_type,:dc_format,:dc_identifier,:dc_source,:dc_language,:language_original,:dc_relation,:dc_coverage,:dc_rights,:keywords,:comments,:abstract,:cls_loc,:cls_dewey,:cls_pg,:cls_isbn,:papersize,:papersize_array,:toc,:lv1,:lv2,:lv3,:lv4,:lv5,:lv6,:pagenew,:pagebreak,:num_top,:toc_lev_limit,:flag_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:flag_auto_heading_num,:markup,:markup_instruction,:markup_version,:markup_declared,:make_bold,:make_italic,:flag_tables,:vocabulary,:doc_skin,:doc_css,:yaml,:lnk,:prefix_a,:prefix_b,:suffix,:information,:contact,:icon,:image,:ad_url,:ad_png,:ad_alt,:ad_began,:flag_promo,:promo,:ad_home,:stmp,:stmpd,:sc_filename,:sc_number,:sc_date,:sc_time,:sc_info,:yamladdr,:locale,:wc_lines,:wc_words,:wc_bytes,:file_encoding,:file_size,:user,:home,:hostname,:pwd,:firstseg,:programs,:creator_copymark,:lang,:en,:dgst,:dgst_skin,:generated,:tags,:tag_array,:concord_make,:seg_names,:seg_autoname_safe,:set_header_title,:set_heading_top,:set_heading_seg,:heading_seg_first,:heading_seg_first_flag,:base_program,:man_section,:man_name,:man_synopsis,:ec,:opt,:sem_tag,:book_idx,:topic_register,:topic_register_array,:original_publication,:original_publication_date,:original_publication_nationality,:original_publication_institution,:writing_focus + attr_accessor :cmd,:mod,:env,:fn,:fns,:fnb,:fnn,:fnt,:fnl,:flv,:fnz,:fnstex,:ocn,:sfx_src,:sfx,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:site_skin,:sisu,:sisu_version,:ruby_version,:title,:subtitle,:full_title,:html_title,:subtitle_tex,:author_home,:author,:author_title,:author_nationality,:authors,:authorship,:translator,:illustrator,:prepared_by,:digitized_by,:subject,:description,:publisher,:contributor,:date,:date_created,:date_issued,:date_available,:date_valid,:date_modified,:date_translated,:date_added_to_site,:date_scheme,:date_created_scheme,:date_issued_scheme,:date_available_scheme,:date_valid_scheme,:date_modified_scheme,:type,:format,:identifier,:source,:language,:language_original,:relation,:coverage,:rights,:keywords,:comments,:abstract,:cls_loc,:cls_dewey,:cls_pg,:cls_isbn,:papersize,:papersize_array,:toc,:lv1,:lv2,:lv3,:lv4,:lv5,:lv6,:pagenew,:pagebreak,:num_top,:toc_lev_limit,:flag_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:flag_auto_heading_num,:markup,:markup_instruction,:markup_version,:markup_declared,:make_bold,:make_italic,:flag_tables,:vocabulary,:doc_skin,:doc_css,:yaml,:lnk,:prefix_a,:prefix_b,:suffix,:information,:contact,:icon,:image,:ad_url,:ad_png,:ad_alt,:ad_began,:flag_promo,:promo,:ad_home,:stmp,:stmpd,:sc_filename,:sc_number,:sc_date,:sc_time,:sc_info,:yamladdr,:locale,:wc_lines,:wc_words,:wc_bytes,:file_encoding,:file_size,:user,:home,:hostname,:pwd,:firstseg,:programs,:author_copymark,:lang,:en,:dgst,:dgst_skin,:generated,:tags,:tag_array,:concord_make,:seg_names,:seg_autoname_safe,:set_header_title,:set_heading_top,:set_heading_seg,:heading_seg_first,:heading_seg_first_flag,:base_program,:man_section,:man_name,:man_synopsis,:ec,:opt,:sem_tag,:book_idx,:topic_register,:topic_register_array,:original_publication,:original_publication_date,:original_publication_nationality,:original_publication_institution,:writing_focus def initialize(fns_array,opt) - @env=@fn=@fns=@fnb=@fnn=@fnt=@fnl=@flv=@fnz=@fnstex=@ocn=@sfx_src=@sfx=@pdf=@file_type=@dir_out=@dir_tex=@dir_lout=@txt_path=@flag_endnotes=@flag_auto_endnotes=@flag_separate_endnotes=@flag_separate_endnotes_make=@site_skin=@sisu=@sisu_version=@ruby_version=@title=@dc_title=@html_title=@subtitle=@subtitle_tex=@creator_home=@dc_creator=@author_title=@author_nationality=@translator=@illustrator=@prepared_by=@digitized_by=@dc_subject=@dc_description=@dc_publisher=@dc_contributor=@dc_date=@dc_date_created=@dc_date_issued=@dc_date_available=@dc_date_valid=@dc_date_modified=@date_translated=@date_added_to_site=@date_scheme=@date_created_scheme=@date_issued_scheme=@date_available_scheme=@date_valid_scheme=@date_modified_scheme=@dc_type=@dc_format=@dc_identifier=@dc_source=@dc_language=@language_original=@dc_relation=@dc_coverage=@dc_rights=@keywords=@comments=@abstract=@cls_loc=@cls_dewey=@cls_pg=@cls_isbn=@papersize=@toc=@lv1=@lv2=@lv3=@lv4=@lv5=@lv6=@pagenew=@pagebreak=@num_top=@toc_lev_limit=@flag_auto_heading_num=@make_bold=@make_italic=@flag_tables=@vocabulary=@doc_skin=@doc_css=@yaml=@lnk=@prefix_a=@prefix_b=@suffix=@information=@contact=@icon=@ad_url=@ad_png=@ad_alt=@ad_began=@promo=@ad_home=@stmp=@stmpd=@sc_filename=@sc_number=@sc_date=@sc_time=@sc_info=@yamladdr=@locale=@wc_lines=@wc_words=@wc_bytes=@file_encoding=@file_size=@firstseg=@programs=@creator_copymark=@lang=@en=@dgst=@dgst_skin=@generated=@heading_seg_first=@base_program=@man_synopsis=@topic_register=@original_publication_details=@original_publication=@original_publication_date=@original_publication_nationality=@original_publication_institution=@writing_focus=nil + @env=@fn=@fns=@fnb=@fnn=@fnt=@fnl=@flv=@fnz=@fnstex=@ocn=@sfx_src=@sfx=@pdf=@file_type=@dir_out=@dir_tex=@dir_lout=@txt_path=@flag_endnotes=@flag_auto_endnotes=@flag_separate_endnotes=@flag_separate_endnotes_make=@site_skin=@sisu=@sisu_version=@ruby_version=@title=@subtitle=@full_title=@html_title=@subtitle_tex=@author_home=@author=@author_title=@author_nationality=@translator=@illustrator=@prepared_by=@digitized_by=@subject=@description=@publisher=@contributor=@date=@date_created=@date_issued=@date_available=@date_valid=@date_modified=@date_translated=@date_added_to_site=@date_scheme=@date_created_scheme=@date_issued_scheme=@date_available_scheme=@date_valid_scheme=@date_modified_scheme=@type=@format=@identifier=@source=@language=@language_original=@relation=@coverage=@rights=@keywords=@comments=@abstract=@cls_loc=@cls_dewey=@cls_pg=@cls_isbn=@papersize=@toc=@lv1=@lv2=@lv3=@lv4=@lv5=@lv6=@pagenew=@pagebreak=@num_top=@toc_lev_limit=@flag_auto_heading_num=@make_bold=@make_italic=@flag_tables=@vocabulary=@doc_skin=@doc_css=@yaml=@lnk=@prefix_a=@prefix_b=@suffix=@information=@contact=@icon=@ad_url=@ad_png=@ad_alt=@ad_began=@promo=@ad_home=@stmp=@stmpd=@sc_filename=@sc_number=@sc_date=@sc_time=@sc_info=@yamladdr=@locale=@wc_lines=@wc_words=@wc_bytes=@file_encoding=@file_size=@firstseg=@programs=@author_copymark=@lang=@en=@dgst=@dgst_skin=@generated=@heading_seg_first=@base_program=@man_synopsis=@topic_register=@original_publication_details=@original_publication=@original_publication_date=@original_publication_nationality=@original_publication_institution=@writing_focus=nil @man_section=1 @man_name='man page "name/whatis" information not provided, set in header @man: name=[whatis information]' @data,@fns,@cmd,@mod,@opt=fns_array,opt.fns,opt.cmd,opt.mod,opt #@data used as data @@ -189,7 +189,7 @@ module SiSU_Param end def extract @user,@home,@hostname,@pwd=ENV['USER'],ENV['HOME'],ENV['HOSTNAME'],ENV['PWD'] - @programs,@wc,@dc_language,@language_original={},{},{},{} + @programs,@wc,@language,@language_original={},{},{},{} @en={ :sum=>0,:mark=>0,:note=>0,:mismatch=>0 } @prog=SiSU_Env::Info_settings.new @sys=SiSU_Env::System_call.new @@ -309,7 +309,7 @@ module SiSU_Param when /^(?:@ocn:|0~ocn)\s+(.+?)$/m; @ocn=$1 #% processing when /^(?:@title:|0~title)\s+(.+?)$/m #% metainfo DC @title=$1.strip - @dc_title=@title.dup + @full_title=@title.dup @html_title=@title.gsub(/(|
||
)/,'') @set_header_title=true @title.chomp!(' ') @@ -318,11 +318,11 @@ module SiSU_Param tell.txt_grey unless @cmd =~/q/ when /^(?:@subtitle:|0~subtitle)\s+(.+?)$/m #% metainfo @subtitle=$1.strip - @dc_title="#{@title} - #{@subtitle}" + @full_title="#{@title} - #{@subtitle}" @subtitle_tex=@subtitle when /^(?:@(?:creator|author)-?:|0~(?:creator|author)-?)\s+(.+?)$/ #% metainfo DC names=name_format($1) - @authorship=@dc_creator=names[:name_str] + @authorship=@author=names[:name_str] @authors=names[:name_a_h] when /^@(?:creator|author)\.title:\s+(.+?)$/; @author_title=$1 # Prof. Dr. etc. when /^@(?:creator|author)\.nationality:\s+(.+?)$/; @author_nationality=$1 @@ -338,12 +338,12 @@ module SiSU_Param when /^(?:@digitized_by:|0~digitized_by)\s+(.+?)$/m #% metainfo DC names=name_format($1) @digitized_by=names[:name_str] - when /^(?:@subject:|0~subject)\s+(.+?)$/m; @dc_subject=$1 #% metainfo DC - when /^(?:@description:|0~description)\s+(.+?)$/m; @dc_description=$1 #% metainfo DC & rss feed + when /^(?:@subject:|0~subject)\s+(.+?)$/m; @subject=$1 #% metainfo DC + when /^(?:@description:|0~description)\s+(.+?)$/m; @description=$1 #% metainfo DC & rss feed when /^(?:@contributor:|0~contributor)\s+(.+?)$/m #% metainfo DC names=name_format($1) - @dc_contributor=names[:name_str] - when /^(?:@publisher:|0~publisher)\s+(.+?)$/m; @dc_publisher=$1 #% metainfo DC + @contributor=names[:name_str] + when /^(?:@publisher:|0~publisher)\s+(.+?)$/m; @publisher=$1 #% metainfo DC when /^@original_publication:\s+(.+?)$/m; @original_publication=$1 when /^@original_publication\.date:\s+(.+?)$/; @original_publication_date=$1 when /^@original_publication\.nationality:\s+(.+?)$/; @original_publication_nationality=$1 @@ -351,13 +351,13 @@ module SiSU_Param when /^@writing_focus\.nationality:\s+(.+?)$/; @writing_focus=$1 # e.g. Finland (where and article on Finnish law) when /^(?:@|0~)date.+?$/m #% metainfo DC if para =~/(?:@date:|0~date)\s+(.+?)$/m - @dc_date=$1.strip #% original publication date unless the substantive text is updated/modified, then date of update - if @dc_date !~regx_date \ - and not @dc_date.empty? - tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',@dc_date) + @date=$1.strip #% original publication date unless the substantive text is updated/modified, then date of update + if @date !~regx_date \ + and not @date.empty? + tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',@date) tell.instruct if @cmd =~/v/ end - @date_scheme='scheme="ISO-8601"' if @dc_date =~/\d{4}-\d{2}-\d{2}/ + @date_scheme='scheme="ISO-8601"' if @date =~/\d{4}-\d{2}-\d{2}/ end if para =~/(?:@date\.added_to_site:|0~date\.added_to_site)\s+(.+?)$/m @date_added_to_site=$1.strip @@ -375,7 +375,7 @@ module SiSU_Param tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date) tell.instruct if @cmd =~/v/ end - @dc_date_created=date + @date_created=date @date_created_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/ end if para =~/(?:@date\.issued:|0~date\.issued)\s*(.+?)$/m @@ -385,7 +385,7 @@ module SiSU_Param tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date) tell.instruct if @cmd =~/v/ end - @dc_date_issued=date + @date_issued=date @date_issued_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/ end if para =~/(?:@date\.available:|0~date\.available)\s*(.+?)$/m @@ -395,7 +395,7 @@ module SiSU_Param tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date) tell.instruct if @cmd =~/v/ end - @dc_date_available=date + @date_available=date @date_available_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/ end if para =~/^(?:@date\.valid:|0~date\.valid)\s*(.+?)$/m @@ -405,7 +405,7 @@ module SiSU_Param tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date) tell.instruct if @cmd =~/v/ end - @dc_date_valid=date + @date_valid=date @date_valid_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/ end if para =~/^(?:@date\.modified:|0~date\.modified)\s*(.+?)$/m #% of interest rss feed & sitemap @@ -415,7 +415,7 @@ module SiSU_Param tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date) tell.instruct if @cmd =~/v/ end - @dc_date_modified=date + @date_modified=date @date_modified_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/ end if para =~/^(?:@date\.translated:|0~date\.translated)\s*(.+?)$/m @@ -428,22 +428,22 @@ module SiSU_Param @date_translated=date @date_translated_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/ end - when /^(?:@type:|0~type)\s+(.+?)$/m; @dc_type=$1 #% metainfo DC - when /^(?:@format:|0~format)\s+(.+?)$/m; @dc_format=$1 #% metainfo DC - #when /^(?:@identifier:|0~identifier)\s+(.+?)$/m; @dc_identifier=$1 #% metainfo DC - when /^(?:@source:|0~source)\s+(.+?)$/m; @dc_source=$1 #% metainfo DC + when /^(?:@type:|0~type)\s+(.+?)$/m; @type=$1 #% metainfo DC + when /^(?:@format:|0~format)\s+(.+?)$/m; @format=$1 #% metainfo DC + #when /^(?:@identifier:|0~identifier)\s+(.+?)$/m; @identifier=$1 #% metainfo DC + when /^(?:@source:|0~source)\s+(.+?)$/m; @source=$1 #% metainfo DC when /^(?:@language(?:\.document)?:|0~language(?:\.document)?)\s+(.+?)$/m #% metainfo DC x=$1.strip lang=SiSU_Env::Standardise_language.new(x.dup) - @dc_language[:code]=lang.code - @dc_language[:name]=lang.title + @language[:code]=lang.code + @language[:name]=lang.title when /^(?:@language\.original:|0~language\.original)\s+(.+?)$/m #% metainfo DC x=$1.strip lang=SiSU_Env::Standardise_language.new(x.dup) @language_original[:name]=lang.title - when /^(?:@relation:|0~relation)\s+(.+?)$/m; @dc_relation=$1 #% metainfo DC - when /^(?:@coverage:|0~coverage)\s+(.+?)$/m; @dc_coverage=$1 #% metainfo DC - when /^(?:@rights:|0~rights)\s+(.+?)$/m; @dc_rights=$1.gsub(/<(?:\/\s*)?br(?:\s*\/)?>/,Mx[:br_line]) #% metainfo DC copyright, public domain, copyleft, creative commons, etc. + when /^(?:@relation:|0~relation)\s+(.+?)$/m; @relation=$1 #% metainfo DC + when /^(?:@coverage:|0~coverage)\s+(.+?)$/m; @coverage=$1 #% metainfo DC + when /^(?:@rights:|0~rights)\s+(.+?)$/m; @rights=$1.gsub(/<(?:\/\s*)?br(?:\s*\/)?>/,Mx[:br_line]) #% metainfo DC copyright, public domain, copyleft, creative commons, etc. when /^(?:@papersize:|0~papersize)\s+(.+?)$/m #% metainfo DC l=$1 if @mod.inspect !~/--papersize[=-]\S+/ @@ -736,11 +736,11 @@ module SiSU_Param @man_synopsis.gsub!(/\n/,"\n.BR\n") @man_synopsis.gsub!(/\A/,"\n.SH SYNOPSIS\n") end - unless @dc_rights - if @dc_creator - @dc_rights ||=if @dc_date =~/([12][890]\d{2})/ #matches years 1800 through 20\d\d 2004w19 - "Copyright (C) #{$1} #@dc_creator" - else 'Copyright (C)' + @dc_creator + unless @rights + if @author + @rights ||=if @date =~/([12][890]\d{2})/ #matches years 1800 through 20\d\d 2004w19 + "Copyright (C) #{$1} #@author" + else 'Copyright (C)' + @author end end end @@ -793,17 +793,17 @@ module SiSU_Param end end end - @dc_publisher ||= "#@@publisher (this copy)" + @publisher ||= "#@@publisher (this copy)" fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(@fns) - unless @dc_language[:code] \ - and @dc_language[:name] + unless @language[:code] \ + and @language[:name] lang=@env.i18n.language #default language settings for directory by name, or in sysrc.yml - @dc_language[:code] ||= lang.code - @dc_language[:name] ||= lang.title + @language[:code] ||= lang.code + @language[:name] ||= lang.title end unless fn_set_lang[:d]==true #decide, naming convention overrides other settings, within document, etc. - @dc_language[:code]=fn_set_lang[:c] - @dc_language[:name]=fn_set_lang[:l] + @language[:code]=fn_set_lang[:c] + @language[:name]=fn_set_lang[:l] end @fnl=@env.i18n.lang_filename(fn_set_lang[:c]) @flv.each do |l| @@ -817,7 +817,7 @@ module SiSU_Param end if @flv @lang.uniq! @fn=SiSU_Env::Env_call.new(@fns).lang(fn_set_lang[:c]) - @dc_identifier="#{@env.url.root}/#@fnb/#{@fn[:toc]}" #DC note constructed dc identifier + @identifier="#{@env.url.root}/#@fnb/#{@fn[:toc]}" #DC note constructed dc identifier if @en[:note] > 0 \ and @en[:sum] > 0 if @en[:sum] > 0 @@ -836,8 +836,8 @@ module SiSU_Param tell=SiSU_Screen::Ansi.new(@cmd,'Document Title Missing','please provide it') tell.warn if @cmd =~/v/ end - if @dc_creator !~/[\S]/ - tell=SiSU_Screen::Ansi.new(@cmd,'Document Creator/Author Missing','please provide it') + if @author !~/[\S]/ + tell=SiSU_Screen::Ansi.new(@cmd,'Document Author/Creator Missing','please provide it') tell.warn if @cmd =~/v/ end # Elementary Document Structure Analysis - adds complexity may remove - need to develop - appears to work, proof of concept diff --git a/lib/sisu/v0/shared_txt.rb b/lib/sisu/v0/shared_txt.rb index 91389538..3dfadeb3 100644 --- a/lib/sisu/v0/shared_txt.rb +++ b/lib/sisu/v0/shared_txt.rb @@ -156,7 +156,7 @@ module SiSU_text_utils end def start_is_match meta=case @p - when /^#{Mx[:meta_o]}(title)#{Mx[:meta_c]}\s*(.+?)$/; header($1,@md.dc_title,'meta','dc') #dc 1 + when /^#{Mx[:meta_o]}(title)#{Mx[:meta_c]}\s*(.+?)$/; header($1,@md.full_title,'meta','dc') #dc 1 #when /^@(subtitle):\s+(.+?)$/; header($1,$2,'meta','extra') when /^#{Mx[:meta_o]}(creator|author)#{Mx[:meta_c]}\s*(.+?)$/; header('creator',$2,'meta','dc') #dc 2 when /^#{Mx[:meta_o]}(subject)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 3 diff --git a/lib/sisu/v0/shared_xml.rb b/lib/sisu/v0/shared_xml.rb index aad7c17e..ffd4bc15 100644 --- a/lib/sisu/v0/shared_xml.rb +++ b/lib/sisu/v0/shared_xml.rb @@ -541,109 +541,109 @@ module SiSU_XML_tags #Format include SiSU_Viz class RDF def initialize(md='',seg_name=[],tracker=0) - @dc_title=@dc_subtitle=@dc_creator=@dc_subject=@dc_description=@dc_publisher=@dc_contributor=@dc_date=@dc_date_created=@dc_date_issued=@dc_date_available=@dc_date_valid=@dc_date_modified=@dc_type=@dc_format=@dc_identifier=@dc_source=@dc_language=@dc_relation=@dc_coverage=@dc_rights=@copyright=@owner=@keywords='' + @full_title=@subtitle=@author=@subject=@description=@publisher=@contributor=@date=@date_created=@date_issued=@date_available=@date_valid=@date_modified=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@copyright=@owner=@keywords='' #seg_name=%{#{@@seg_name[@@tracker]} - } if @@seg_name[@@tracker] @md=md @sfx,@pdf=@md.sfx,@md.pdf @rdfurl=%{ rdf:about="http://www.jus.uio.no/lm/toc"\n} - if @md.dc_title # DublinCore 1 - title - @rdf_title=%{ dc.title="#{seg_name}#{@md.dc_title}"\n} - @dc_title=%{ \n} - #@dc_title=%{ \n} - end - if @md.dc_creator # DublinCore 2 - creator/author (author) - @rdf_creator=%{ dc.creator="#{@md.dc_creator}"\n} - content=meta_content_clean(@md.dc_creator) - @dc_creator=%{ \n} - end - if @md.dc_subject # DublinCore 3 - subject (us library of congress, eric or udc, or schema???) - @rdf_subject=%{ dc.subject="#{@md.dc_subject}"\n} - content=meta_content_clean(@md.dc_subject) - @dc_subject=%{ \n} - end - if @md.dc_description # DublinCore 4 - description - @rdf_description=%{ dc.description="#{@md.dc_description}"\n} - content=meta_content_clean(@md.dc_description) - @dc_description=%{ \n} - end - if @md.dc_publisher # DublinCore 5 - publisher (current copy published by) - @rdf_publisher=%{ dc.publisher="#{@md.dc_publisher}"\n} - content=meta_content_clean(@md.dc_publisher) - @dc_publisher=%{ \n} - end - if @md.dc_contributor # DublinCore 6 - contributor - @rdf_contributor=%{ dc.contributor="#{@md.dc_contributor}"\n} - content=meta_content_clean(@md.dc_contributor) - @dc_contributor=%{ \n} - end - if @md.dc_date # DublinCore 7 - date year-mm-dd - @rdf_date=%{ dc.date="#{@md.dc_date}"\n} - @dc_date=%{ \n} - end - if @md.dc_date_created # DublinCore 7 - date.created year-mm-dd - @rdf_date_created=%{ dc.date.created="#{@md.dc_date_created}"\n} - @dc_date_created=%{ \n} - end - if @md.dc_date_issued # DublinCore 7 - date.issued year-mm-dd - @rdf_date_issued=%{ dc.date.issued="#{@md.dc_date_issued}"\n} - @dc_date_issued=%{ \n} - end - if @md.dc_date_available # DublinCore 7 - date.available year-mm-dd - @rdf_date_available=%{ dc.date.available="#{@md.dc_date_available}"\n} - @dc_date_available=%{ \n} - end - if @md.dc_date_valid # DublinCore 7 - date.valid year-mm-dd - @rdf_date_valid=%{ dc.date.valid="#{@md.dc_date_valid}"\n} - @dc_date_valid=%{ \n} - end - if @md.dc_date_modified # DublinCore 7 - date.modified year-mm-dd - @rdf_date_modified=%{ dc.date.modified="#{@md.dc_date_modified}"\n} - @dc_date_modified=%{ \n} - end - if @md.dc_type # DublinCore 8 - type (genre eg. report, convention etc) - @rdf_type=%{ dc.type="#{@md.dc_type}"\n} - content=meta_content_clean(@md.dc_type) - @dc_type=%{ \n} - end - if @md.dc_format # DublinCore 9 - format (use your mime type) - @rdf_format=%{ dc.format="#{@md.dc_format}"\n} - content=meta_content_clean(@md.dc_format) - @dc_format=%{ \n} - end - if @md.dc_identifier # DublinCore 10 - identifier (your identifier, could use urn which is free) - @rdf_identifier=%{ dc.identifier="#{@md.dc_identifier}"\n} - content=meta_content_clean(@md.dc_identifier) - @dc_identifier=%{ \n} - end - if @md.dc_source # DublinCore 11 - source (document source) - @rdf_source=%{ dc.source="#{@md.dc_source}"\n} - content=meta_content_clean(@md.dc_source) - @dc_source=%{ \n} - end - if @md.dc_language \ - and @md.dc_language[:name] # DublinCore 12 - language (English) - @rdf_language=%{ dc.language="#{@md.dc_language[:name]}"\n} - @dc_language=%{ \n} + if @md.full_title # DublinCore 1 - title + @rdf_title=%{ dc.title="#{seg_name}#{@md.full_title}"\n} + @full_title=%{ \n} + #@full_title=%{ \n} + end + if @md.author # DublinCore 2 - creator/author (author) + @rdf_author=%{ dc.author="#{@md.author}"\n} + content=meta_content_clean(@md.author) + @author=%{ \n} + end + if @md.subject # DublinCore 3 - subject (us library of congress, eric or udc, or schema???) + @rdf_subject=%{ dc.subject="#{@md.subject}"\n} + content=meta_content_clean(@md.subject) + @subject=%{ \n} + end + if @md.description # DublinCore 4 - description + @rdf_description=%{ dc.description="#{@md.description}"\n} + content=meta_content_clean(@md.description) + @description=%{ \n} + end + if @md.publisher # DublinCore 5 - publisher (current copy published by) + @rdf_publisher=%{ dc.publisher="#{@md.publisher}"\n} + content=meta_content_clean(@md.publisher) + @publisher=%{ \n} + end + if @md.contributor # DublinCore 6 - contributor + @rdf_contributor=%{ dc.contributor="#{@md.contributor}"\n} + content=meta_content_clean(@md.contributor) + @contributor=%{ \n} + end + if @md.date # DublinCore 7 - date year-mm-dd + @rdf_date=%{ dc.date="#{@md.date}"\n} + @date=%{ \n} + end + if @md.date_created # DublinCore 7 - date.created year-mm-dd + @rdf_date_created=%{ dc.date.created="#{@md.date_created}"\n} + @date_created=%{ \n} + end + if @md.date_issued # DublinCore 7 - date.issued year-mm-dd + @rdf_date_issued=%{ dc.date.issued="#{@md.date_issued}"\n} + @date_issued=%{ \n} + end + if @md.date_available # DublinCore 7 - date.available year-mm-dd + @rdf_date_available=%{ dc.date.available="#{@md.date_available}"\n} + @date_available=%{ \n} + end + if @md.date_valid # DublinCore 7 - date.valid year-mm-dd + @rdf_date_valid=%{ dc.date.valid="#{@md.date_valid}"\n} + @date_valid=%{ \n} + end + if @md.date_modified # DublinCore 7 - date.modified year-mm-dd + @rdf_date_modified=%{ dc.date.modified="#{@md.date_modified}"\n} + @date_modified=%{ \n} + end + if @md.type # DublinCore 8 - type (genre eg. report, convention etc) + @rdf_type=%{ dc.type="#{@md.type}"\n} + content=meta_content_clean(@md.type) + @type=%{ \n} + end + if @md.format # DublinCore 9 - format (use your mime type) + @rdf_format=%{ dc.format="#{@md.format}"\n} + content=meta_content_clean(@md.format) + @format=%{ \n} + end + if @md.identifier # DublinCore 10 - identifier (your identifier, could use urn which is free) + @rdf_identifier=%{ dc.identifier="#{@md.identifier}"\n} + content=meta_content_clean(@md.identifier) + @identifier=%{ \n} + end + if @md.source # DublinCore 11 - source (document source) + @rdf_source=%{ dc.source="#{@md.source}"\n} + content=meta_content_clean(@md.source) + @source=%{ \n} + end + if @md.language \ + and @md.language[:name] # DublinCore 12 - language (English) + @rdf_language=%{ dc.language="#{@md.language[:name]}"\n} + @language=%{ \n} end if @md.language_original \ and @md.language_original[:name] @rdf_language_original=%{ dc.language="#{@md.language_original[:name]}"\n} @language_original=%{ \n} end - if @md.dc_relation # DublinCore 13 - relation - @rdf_relation=%{ dc.relation="#{@md.dc_relation}"\n} - content=meta_content_clean(@md.dc_relation) - @dc_relation=%{ \n} + if @md.relation # DublinCore 13 - relation + @rdf_relation=%{ dc.relation="#{@md.relation}"\n} + content=meta_content_clean(@md.relation) + @relation=%{ \n} end - if @md.dc_coverage # DublinCore 14 - coverage - @rdf_coverage=%{ dc.coverage="#{@md.dc_coverage}"\n} - content=meta_content_clean(@md.dc_coverage) - @dc_coverage=%{ \n} + if @md.coverage # DublinCore 14 - coverage + @rdf_coverage=%{ dc.coverage="#{@md.coverage}"\n} + content=meta_content_clean(@md.coverage) + @coverage=%{ \n} end - if @md.dc_rights # DublinCore 15 - rights - @rdf_rights=%{ dc.rights="#{@md.dc_rights}"\n} - content=meta_content_clean(@md.dc_rights) - @dc_rights=%{ \n} + if @md.rights # DublinCore 15 - rights + @rdf_rights=%{ dc.rights="#{@md.rights}"\n} + content=meta_content_clean(@md.rights) + @rights=%{ \n} end content=meta_content_clean(@md.keywords) @keywords=%{ \n} if @md.keywords @@ -725,7 +725,7 @@ WOK def metatag_html #values strung together, because some empty, and resulting output (line breaks) is much better #{@vz.js_head} <
#{@md.date_available} Initial version
" else '' end - date_modified=if defined? @md.dc_date_available; "\n#{@md.dc_date_modified} Last Modified
" + date_modified=if defined? @md.date_available; "\n#{@md.date_modified} Last Modified
" else '' end head=<|
)/,'') @@ -316,42 +316,42 @@ module SiSU_Param @html_title.chomp!(' ') tell=SiSU_Screen::Ansi.new(@cmd,'Parameters',@html_title) tell.txt_grey unless @cmd =~/q/ - when /^(?:@subtitle:|0~subtitle)\s+(.+?)$/m #% metainfo + when /^(?:@subtitle:|0~subtitle)\s+(.+?)$/m #% metainfo @subtitle=$1.strip @full_title="#{@title} - #{@subtitle}" @subtitle_tex=@subtitle - when /^(?:@(?:creator|author)-?:|0~(?:creator|author)-?)\s+(.+?)$/ #% metainfo DC + when /^(?:@(?:creator|author)-?:|0~(?:creator|author)-?)\s+(.+?)$/ #% metainfo DC names=name_format($1) @authorship=@author=names[:name_str] @authors=names[:name_a_h] - when /^@(?:creator|author)\.title:\s+(.+?)$/; @author_title=$1 # Prof. Dr. etc. + when /^@(?:creator|author)\.title:\s+(.+?)$/; @author_title=$1 # Prof. Dr. etc. when /^@(?:creator|author)\.nationality:\s+(.+?)$/; @author_nationality=$1 - when /^(?:@(?:translator|translated_by):|0~(?:translator|translated_by))\s+(.+?)$/m #% metainfo + when /^(?:@(?:translator|translated_by):|0~(?:translator|translated_by))\s+(.+?)$/m #% metainfo names=name_format($1) @translator=names[:name_str] - when /^(?:@(?:illustrator|illustrated_by):|0~(?:illustrator|illustrated_by))\s+(.+?)$/m #% metainfo + when /^(?:@(?:illustrator|illustrated_by):|0~(?:illustrator|illustrated_by))\s+(.+?)$/m #% metainfo names=name_format($1) @illustrator=names[:name_str] - when /^(?:@prepared_by:|0~prepared_by)\s+(.+?)$/m #% metainfo + when /^(?:@prepared_by:|0~prepared_by)\s+(.+?)$/m #% metainfo names=name_format($1) @prepared_by=names[:name_str] - when /^(?:@digitized_by:|0~digitized_by)\s+(.+?)$/m #% metainfo DC + when /^(?:@digitized_by:|0~digitized_by)\s+(.+?)$/m #% metainfo DC names=name_format($1) @digitized_by=names[:name_str] - when /^(?:@subject:|0~subject)\s+(.+?)$/m; @subject=$1 #% metainfo DC - when /^(?:@description:|0~description)\s+(.+?)$/m; @description=$1 #% metainfo DC & rss feed - when /^(?:@contributor:|0~contributor)\s+(.+?)$/m #% metainfo DC + when /^(?:@subject:|0~subject)\s+(.+?)$/m; @subject=$1 #% metainfo DC + when /^(?:@description:|0~description)\s+(.+?)$/m; @description=$1 #% metainfo DC & rss feed + when /^(?:@contributor:|0~contributor)\s+(.+?)$/m #% metainfo DC names=name_format($1) @contributor=names[:name_str] - when /^(?:@publisher:|0~publisher)\s+(.+?)$/m; @publisher=$1 #% metainfo DC + when /^(?:@publisher:|0~publisher)\s+(.+?)$/m; @publisher=$1 #% metainfo DC when /^@original_publication:\s+(.+?)$/m; @original_publication=$1 when /^@original_publication\.date:\s+(.+?)$/; @original_publication_date=$1 when /^@original_publication\.nationality:\s+(.+?)$/; @original_publication_nationality=$1 when /^@original_publication\.institution:\s+(.+?)$/; @original_publication_institution=$1 - when /^@writing_focus\.nationality:\s+(.+?)$/; @writing_focus=$1 # e.g. Finland (where and article on Finnish law) - when /^(?:@|0~)date.+?$/m #% metainfo DC + when /^@writing_focus\.nationality:\s+(.+?)$/; @writing_focus=$1 # e.g. Finland (where and article on Finnish law) + when /^(?:@|0~)date.+?$/m #% metainfo DC if para =~/(?:@date:|0~date)\s+(.+?)$/m - @date=$1.strip #% original publication date unless the substantive text is updated/modified, then date of update + @date=$1.strip #% original publication date unless the substantive text is updated/modified, then date of update if @date !~regx_date \ and not @date.empty? tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',@date) @@ -408,7 +408,7 @@ module SiSU_Param @date_valid=date @date_valid_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/ end - if para =~/^(?:@date\.modified:|0~date\.modified)\s*(.+?)$/m #% of interest rss feed & sitemap + if para =~/^(?:@date\.modified:|0~date\.modified)\s*(.+?)$/m #% of interest rss feed & sitemap date=$1.strip if date !~regx_date \ and not date.empty? @@ -428,32 +428,32 @@ module SiSU_Param @date_translated=date @date_translated_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/ end - when /^(?:@type:|0~type)\s+(.+?)$/m; @type=$1 #% metainfo DC - when /^(?:@format:|0~format)\s+(.+?)$/m; @format=$1 #% metainfo DC + when /^(?:@type:|0~type)\s+(.+?)$/m; @type=$1 #% metainfo DC + when /^(?:@format:|0~format)\s+(.+?)$/m; @format=$1 #% metainfo DC #when /^(?:@identifier:|0~identifier)\s+(.+?)$/m; @identifier=$1 #% metainfo DC - when /^(?:@source:|0~source)\s+(.+?)$/m; @source=$1 #% metainfo DC - when /^(?:@language(?:\.document)?:|0~language(?:\.document)?)\s+(.+?)$/m #% metainfo DC + when /^(?:@source:|0~source)\s+(.+?)$/m; @source=$1 #% metainfo DC + when /^(?:@language(?:\.document)?:|0~language(?:\.document)?)\s+(.+?)$/m #% metainfo DC x=$1.strip lang=SiSU_Env::Standardise_language.new(x.dup) @language[:code]=lang.code @language[:name]=lang.title - when /^(?:@language\.original:|0~language\.original)\s+(.+?)$/m #% metainfo DC + when /^(?:@language\.original:|0~language\.original)\s+(.+?)$/m #% metainfo DC x=$1.strip lang=SiSU_Env::Standardise_language.new(x.dup) @language_original[:name]=lang.title - when /^(?:@relation:|0~relation)\s+(.+?)$/m; @relation=$1 #% metainfo DC - when /^(?:@coverage:|0~coverage)\s+(.+?)$/m; @coverage=$1 #% metainfo DC - when /^(?:@rights:|0~rights)\s+(.+?)$/m; @rights=$1.gsub(/<(?:\/\s*)?br(?:\s*\/)?>/,Mx[:br_line]) #% metainfo DC copyright, public domain, copyleft, creative commons, etc. - when /^(?:@papersize:|0~papersize)\s+(.+?)$/m #% metainfo DC + when /^(?:@relation:|0~relation)\s+(.+?)$/m; @relation=$1 #% metainfo DC + when /^(?:@coverage:|0~coverage)\s+(.+?)$/m; @coverage=$1 #% metainfo DC + when /^(?:@rights:|0~rights)\s+(.+?)$/m; @rights=$1.gsub(/<(?:\/\s*)?br(?:\s*\/)?>/,Mx[:br_line]) #% metainfo DC copyright, public domain, copyleft, creative commons, etc. + when /^(?:@papersize:|0~papersize)\s+(.+?)$/m #% metainfo DC l=$1 if @mod.inspect !~/--papersize[=-]\S+/ l=determine_papersize(l.dup) @papersize=l end - when /^(?:@keywords?:|0~keywords?)\s+(.+?)$/m; @keywords=$1 #% metainfo DC - when /^(?:@comments?:|0~comments?)\s+(.+?)$/m; @comments=$1.gsub(/<(?:\/\s*)?br(?:\s*\/)?>/,Mx[:br_line]) #% metainfo DC - when /^(?:@abstract:|0~abstract)\s+(.+?)$/m; @abstract=$1.gsub(/<(?:\/\s*)?br(?:\s*\/)?>/,Mx[:br_line]) #% metainfo DC - when /^(?:@tags?:|0~tags?)\s+\S/m #% metainfo + when /^(?:@keywords?:|0~keywords?)\s+(.+?)$/m; @keywords=$1 #% metainfo DC + when /^(?:@comments?:|0~comments?)\s+(.+?)$/m; @comments=$1.gsub(/<(?:\/\s*)?br(?:\s*\/)?>/,Mx[:br_line]) #% metainfo DC + when /^(?:@abstract:|0~abstract)\s+(.+?)$/m; @abstract=$1.gsub(/<(?:\/\s*)?br(?:\s*\/)?>/,Mx[:br_line]) #% metainfo DC + when /^(?:@tags?:|0~tags?)\s+\S/m #% metainfo tags=para.match(/^(?:@tags?:|0~tags?)\s+(.+)\Z/m)[1] tags.split(/,|$/).each do |tag| tag.strip! @@ -463,23 +463,23 @@ module SiSU_Param tag_a=tag_a.split(/:/).join('][') @tag_a << tag_a end - when /^(?:@catalogue:|0~catalogue)\s+(.+)?$/m #% metainfo + when /^(?:@catalogue:|0~catalogue)\s+(.+)?$/m #% metainfo m=$1 @cls_pg=m.match(/pg=(\S+)/)[1] if m =~/pg=/ @cls_isbn=m.match(/isbn=(\S+)/)[1] if m =~/isbn=/ @cls_dewey=m.match(/dewey=(\S+)/)[1] if m =~/dewey=/ @cls_loc=m.match(/loc=(\S+)/)[1] if m =~/loc=/ - when /^(?:@class(?:ify)?_loc:|0~class(?:ify)?_loc)\s+(.+?)$/m; @cls_loc=$1 #% metainfo - when /^(?:@class(?:ify)?_dewey:|0~class(?:ify)?_dewey)\s+(.+?)$/m; @cls_dewey=$1 #% metainfo - when /^(?:@class(?:ify)?_pg:|0~class(?:ify)?_pg)\s+(.+?)$/m; @cls_pg=$1 #% metainfo - when /^(?:@(?:class(?:ify)?_)?isbn:|0~(?:class(?:ify)?_)?isbn)\s+(\S+?)$/m; @cls_isbn=$1 #% metainfo - when /^(?:@images?:|0~images?)\s+(.+?)$/m; @image=$1 #% processing - when /^(?:@(?:toc|structure):|0~(?:toc|structure))\s+(.+?)\Z/m #% processing + when /^(?:@class(?:ify)?_loc:|0~class(?:ify)?_loc)\s+(.+?)$/m; @cls_loc=$1 #% metainfo + when /^(?:@class(?:ify)?_dewey:|0~class(?:ify)?_dewey)\s+(.+?)$/m; @cls_dewey=$1 #% metainfo + when /^(?:@class(?:ify)?_pg:|0~class(?:ify)?_pg)\s+(.+?)$/m; @cls_pg=$1 #% metainfo + when /^(?:@(?:class(?:ify)?_)?isbn:|0~(?:class(?:ify)?_)?isbn)\s+(\S+?)$/m; @cls_isbn=$1 #% metainfo + when /^(?:@images?:|0~images?)\s+(.+?)$/m; @image=$1 #% processing + when /^(?:@(?:toc|structure):|0~(?:toc|structure))\s+(.+?)\Z/m #% processing doc_toc_str=$1 @toc=doc_toc_str.split(/;\s*/) @toc=[ @toc ] if @toc == String #@toc.each {|x| x.gsub!(/\{/,'\{') } #FIX~ - lv1=@toc[0] ||='1~ ' #some arbitrary changes made + lv1=@toc[0] ||='1~ ' #some arbitrary changes made @lv1=/^#{lv1}/ lv2=@toc[1] ||='2~ ' @lv2=/^#{lv2}/ @@ -491,7 +491,7 @@ module SiSU_Param @lv5=/^#{lv5}/ lv6=@toc[5] ||='6~ ' @lv6=/^#{lv6}/ - when /^(?:@(?:level|page|markup):|0~(?:level|page|markup))\s+(.+?)$/m #% processing revisit..., use syntax 0~level new=1,2,3; break=4 + when /^(?:@(?:level|page|markup):|0~(?:level|page|markup))\s+(.+?)$/m #% processing revisit..., use syntax 0~level new=1,2,3; break=4 if para =~/(?:@|0~)(?:markup|level|page):?\s+(.+?)\Z/m page_break_str=$1 pagebreaks=page_break_str.split(/;\s*/) @@ -509,11 +509,11 @@ module SiSU_Param @toc_lev_limit=toc_lev_limit if toc_lev_limit @flag_auto_heading_num=true if para =~/num_top/ end - if para =~/^(?:@markup:|0~markup)\s+(.+?)$/m #%use of markup depreciated for num_top + if para =~/^(?:@markup:|0~markup)\s+(.+?)$/m #%use of markup depreciated for num_top @markup=$1 @flag_auto_heading_num=true if para =~/num_top/ end - when /^(?:@bold:|0~bold)\s+(.+?)$/m #% processing + when /^(?:@bold:|0~bold)\s+(.+?)$/m #% processing m=$1.strip x=case m when /\/i$/; 'i' @@ -527,7 +527,7 @@ module SiSU_Param else /#{rgx}/ end @make_bold - when /^(?:@(?:italics?|itali[sz]e):|0~(?:italics?|itali[sz]e))\s+(.+?)$/m #% processing Dublin Core - dublin core within + when /^(?:@(?:italics?|itali[sz]e):|0~(?:italics?|itali[sz]e))\s+(.+?)$/m #% processing Dublin Core - dublin core within m=$1.strip x=case m when /\/i$/; 'i' @@ -541,11 +541,11 @@ module SiSU_Param else /#{rgx}/ end @make_italic - when /^(?:@(?:vocabulary|wordlist):|0~(?:vocabulary|wordlist))\s+(.+?)$/m #% processing - @vocabulary=$1 #not actually used by concordance - when /^(?:@skin:|0~skin)\s+(.+?)$/; @doc_skin=$1.strip #% processing - when /^(?:@(?:css|stylesheet):|0~(?:css|stylesheet))\s+(.+?)$/; @doc_css=$1.strip #% processing - when /^(?:@links:|0~links)\s+(.+?)\Z/m #% processing + when /^(?:@(?:vocabulary|wordlist):|0~(?:vocabulary|wordlist))\s+(.+?)$/m #% processing + @vocabulary=$1 #not actually used by concordance + when /^(?:@skin:|0~skin)\s+(.+?)$/; @doc_skin=$1.strip #% processing + when /^(?:@(?:css|stylesheet):|0~(?:css|stylesheet))\s+(.+?)$/; @doc_css=$1.strip #% processing + when /^(?:@links:|0~links)\s+(.+?)\Z/m #% processing doc_links_str=$1 @lnk=[] if doc_links_str=~/\{.+?\}(?:(?:https?|file|ftp):\/|\.\.)\/\S+(?:\s|$)/ @@ -569,16 +569,16 @@ module SiSU_Param end end end - when /^(?:@prefix(?:_[ab])?:|0~prefix(?:_[ab])?)\s/ #% metainfo + when /^(?:@prefix(?:_[ab])?:|0~prefix(?:_[ab])?)\s/ #% metainfo if para =~/prefix_a:?\s+/ @prefix_a=para[/(?:@prefix_a:|0~prefix_a)\s+(.+?)$/im,1] end if para =~/prefix(?:_b)?:?\s+/ @prefix_b=para[/(?:@prefix(?:_b)?:|0~prefix(?:_b)?)\s+(.+?)$/im,1] end - when /^(?:@suffix:|0~suffix)\s+(.+?)$/m; @suffix=$1 #% metainfo - when /^(?:@information:|0~information)\s+(.+?)$/m; @information=$1 #% metainfo - when /^(?:@topic_register:|0~topic_register)\s+(.+?)$/m; @topic_register=$1 #% metainfo, similar syntax to book index, leave out the ={} i.e. use equivalent of ={(.+?)} + when /^(?:@suffix:|0~suffix)\s+(.+?)$/m; @suffix=$1 #% metainfo + when /^(?:@information:|0~information)\s+(.+?)$/m; @information=$1 #% metainfo + when /^(?:@topic_register:|0~topic_register)\s+(.+?)$/m; @topic_register=$1 #% metainfo, similar syntax to book index, leave out the ={} i.e. use equivalent of ={(.+?)} u=@topic_register.scan(/[^;]+/) v=[] u.each do |l| @@ -589,19 +589,19 @@ module SiSU_Param @topic_register_array << m end @topic_register_array.sort! - when /^(?:@contact:|0~contact)\s+(.+?)$/m; @contact=$1 #% metainfo - when /^(?:@original_publication:|0~original_publication)\s+(.+?)$/m; @original_publication=$1 #% details of original publication - when /^(?:@icon:|0~icon)\s+(.+?)$/m; @icon=$1 #% processing + when /^(?:@contact:|0~contact)\s+(.+?)$/m; @contact=$1 #% metainfo + when /^(?:@original_publication:|0~original_publication)\s+(.+?)$/m; @original_publication=$1 #% details of original publication + when /^(?:@icon:|0~icon)\s+(.+?)$/m; @icon=$1 #% processing when /^(?:@promo:|0~promo)\s+(.+?)$/m @flag_promo=true @promo=$1.split(/[,;]\s*/) - when /^(?:@ad:|0~ad)\s+(\S+)?\s+(\S+\.png)?\s+(.+?!)\s+(\d+)\s*$/m #% processing + when /^(?:@ad:|0~ad)\s+(\S+)?\s+(\S+\.png)?\s+(.+?!)\s+(\d+)\s*$/m #% processing @ad_url,@ad_png,@ad_alt,@ad_began=$1,$2,$3,$4 - when /0~ad\.home\s+(.+)?\s*$/m #% processing + when /0~ad\.home\s+(.+)?\s*$/m #% processing ad_home_str=$1 @ad_home=ad_home_str.split(/\s+!/) - when /^(?:@sta?mp(?:ed)?:|0~sta?mp(?:ed)?)\s+(.+?)$/m; @stmp= $1.downcase! #% processing - when /^(?:@(?:rcs|cvs):|0~(?:rcs|cvs))\+?\s+/ #% processing + when /^(?:@sta?mp(?:ed)?:|0~sta?mp(?:ed)?)\s+(.+?)$/m; @stmp= $1.downcase! #% processing + when /^(?:@(?:rcs|cvs):|0~(?:rcs|cvs))\+?\s+/ #% processing m=/(?:@(?:rcs|cvs):|0~(?:rcs|cvs))\+?\s+/ #note the + sign to turn on use of rcs or cvs id ver=para[/#{m}(.+)/,1] #RCS or CVS ID tag # eg. # $Id$ contains=/[\$]Id:\s+(\S+),v\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+Exp\s+(?:\S+\s+)?[\$]/ # reason for [$] which is apparently unnecessary is that rcs or cvs will otherwise expand id! @@ -610,9 +610,9 @@ module SiSU_Param @sc_filename,@sc_number,@sc_date,@sc_time=filename,vnumber,date,time end @sc_info=true if para[/(?:@(?:rcs|cvs):|0~(?:rcs|cvs))\+/] - when /^@base_program:\s+(.+?)$/; @base_program=$1 #% processing + when /^@base_program:\s+(.+?)$/; @base_program=$1 #% processing #% break - break, not necessary to process headers further :-) but necessary to extract endnotes etc. ;-( - when /^(?:@man:|0~man)\s+(.+?)\Z/m #% man pages + when /^(?:@man:|0~man)\s+(.+?)\Z/m #% man pages maninfo_str=$1 maninfo=maninfo_str.split(/;\s*/m) maninfo.each do |x| @@ -627,8 +627,8 @@ module SiSU_Param @lv4 ||=/^#{Mx[:lv_o]}4:/ @lv5 ||=/^#{Mx[:lv_o]}5:/ @lv6 ||=/^#{Mx[:lv_o]}6:/ - else #% - if para =~ /^(?:1|:?A)~/ #% processing + else #% + if para =~ /^(?:1|:?A)~/ #% processing if para=~/^:?A~/ if @markup.nil? \ or @markup.empty? @@ -653,13 +653,13 @@ module SiSU_Param end unless @code_flag case para - when /~\{\s+.+?\}~/m #% processing + when /~\{\s+.+?\}~/m #% processing en=para.scan(/~\{.+?\}~/m) en.each { |e| @en[:sum] +=1 } - when /~\^(?:\s|$)/m #% processing + when /~\^(?:\s|$)/m #% processing mk=para.scan(/~\^(?:\s|$)/) mk.each { |e| @en[:mark] +=1 } - when /^\^~\s+\S/; @en[:note] +=1 #% processing + when /^\^~\s+\S/; @en[:note] +=1 #% processing end end if para =~/~\{|\^~ |~\^|<:ee>|\{.+?\[[1-6]\]\}\S+?\.ss[tm]/m; @flag_auto_endnotes,@flag_endnotes=true,true @@ -697,11 +697,11 @@ module SiSU_Param and para =~/^4~\s+(.+)$/ t=$1 end - unless @heading_seg_first_flag # extract first segment name + unless @heading_seg_first_flag # extract first segment name @heading_seg_first=t @heading_seg_first_flag=true end - if m # list all segment names + if m # list all segment names @seg_names << m @set_heading_seg=true if m=~/^\d{1,3}/ \ @@ -719,7 +719,7 @@ module SiSU_Param unless @sem_tag @sem_tag=true if para=~/[:;]\{.+?\}[:;][a-z+]/ #refix later end - end #% here endeth the document loop + end #% here endeth the document loop if @ec[:image].length > 0 @ec[:image].flatten! @ec[:image].uniq! @@ -926,8 +926,8 @@ module SiSU_Param tell=SiSU_Screen::Ansi.new(@cmd,"doc_skin <- #@doc_skin") tell.txt_grey if @cmd =~/v/ end - @data=nil #else whole file's contents are stored in md pstore & is not required to be... big waste actually - Store.new(self,@env).store #% pstore + @data=nil #else whole file's contents are stored in md pstore & is not required to be... big waste actually + Store.new(self,@env).store #% pstore self end private -- cgit v1.2.3