diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v0/hub.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v0/manpage.rb | 3 | ||||
-rw-r--r-- | lib/sisu/v0/param.rb | 29 |
3 files changed, 26 insertions, 8 deletions
diff --git a/lib/sisu/v0/hub.rb b/lib/sisu/v0/hub.rb index 47326b88..82ccc614 100644 --- a/lib/sisu/v0/hub.rb +++ b/lib/sisu/v0/hub.rb @@ -547,7 +547,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ if @opt.mod.inspect =~/--help/ and not @opt.what.empty?; SiSU_Help::Help.new(@opt.what).help_request elsif @opt.mod.inspect =~/--help/; SiSU_Help::Help.new('list').help_request else SiSU_Help::Help.new('env',@opt).sisu_version - puts " for HELP type:\n\tsisu --help [help request]\n\tman sisu\n or see the system or online documentation" + tell=SiSU_Screen::Ansi.new(''," for HELP type:\n\tsisu --help [help request]\n\tman sisu\n or see the system or online documentation on SiSU:\n #{Config::CONFIG['datadir']}/doc/sisu/\n <http://www.jus.uio.no/sisu/>\n <http://sisudoc.org/>"); tell.puts_grey end end end diff --git a/lib/sisu/v0/manpage.rb b/lib/sisu/v0/manpage.rb index 5b2cef6f..768fbc48 100644 --- a/lib/sisu/v0/manpage.rb +++ b/lib/sisu/v0/manpage.rb @@ -473,7 +473,7 @@ WOK else '2007' #date missing decide on action end proj=SiSU_Env::Info_version.new.get_version - manpage[:open] = %{.TH "#{@md.fnb}" "1" "#{date}" "#{proj[:version]}" "#{@md.title}"} + manpage[:open] = %{.TH "#{@md.fnb}" "1" "#{date}" "#{proj[:version]}" "#{@md.title}"#{@md.man_name}#{@md.man_synopsis}} content << manpage[:open] content << manpage[:head] content << manpage[:body] @@ -493,6 +493,7 @@ WOK end def manpage #%manpage output SiSU_Env::SiSU_file.new(@md).mkdir + #filename_manpage=SiSU_Env::SiSU_file.new(@md,"#{@md.fnb}.#{@md.man_section}").mkfile_man filename_manpage=SiSU_Env::SiSU_file.new(@md,@md.fn[:manpage]).mkfile_man @sisu=[] @content.each do |para| # this is a hack diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb index 446c2d46..a2036b8a 100644 --- a/lib/sisu/v0/param.rb +++ b/lib/sisu/v0/param.rb @@ -113,9 +113,11 @@ 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,: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,: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_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_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_pdf,: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 + attr_accessor :cmd,:mod,:env,:fn,:fns,:fnb,:fnn,:fnt,:fnl,:flv,: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,: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_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_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_pdf,: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 def initialize(fns_array,opt) - @env=@fn=@fns=@fnb=@fnn=@fnt=@fnl=@flv=@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=@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_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_pdf=@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=nil + @env=@fn=@fns=@fnb=@fnn=@fnt=@fnl=@flv=@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=@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_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_pdf=@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=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 @flag_tables,@set_header_title,@set_heading_top,@set_heading_seg,@heading_seg_first_flag,@flag_promo=false,false,false,false,false,false @seg_autoname_safe=true @@ -235,12 +237,11 @@ module SiSU_Param tell.warn unless @cmd =~/q/ end @code_flag=false - fns_array.each do |par| #% Scan document - para=par.gsub(/\n/,' ') + fns_array.each do |para| #% Scan document if para !~/^\%+\s/ and para =~/<![abcdeghijklmnopqrstuvwxyz]/i # <!f not included raise "Old markup style in file #@fns, current version #{@sisu_version[:project]} #{@sisu_version[:version]} #{@sisu_version[:date_stamp]} #{@sisu_version[:date]}:\n\t\t#{para}\n\n" end - @code_flag=case par + @code_flag=case para when /^code\{\s*$/; true when /^\}code\s*$/; false else @code_flag @@ -364,7 +365,7 @@ module SiSU_Param when /^(?:0~comments?|@comments?:?)\s+(.+?)$/m; @comments=$1 #% metainfo DC when /^(?:0~abstract|@abstract)\s+(.+?)$/m; @abstract=$1 #% metainfo DC when /^(?:0~tags?|@tags?:)\s+\S/m #% metainfo - tags=par.match(/^(?:0~tags?|@tags?:)\s+(.+)$/m)[1] + tags=para.match(/^(?:0~tags?|@tags?:)\s+(.+)$/m)[1] tags.split(/,|$/).each do |tag| tag.strip! @tags << tag @@ -511,6 +512,14 @@ module SiSU_Param @sc_info=true if para[/(?:0~(?:rcs|cvs)|@(?:rcs|cvs):)\+/] when /^@base_program:\s+(.+?)$/; @base_program=$1 #% processing #% break - break, not necessary to process headers further :-) but necessary to extract endnotes etc. ;-( + when /^(?:0~man|@man:)\s+(.+?)\Z/m #% man pages + maninfo_str=$1 + maninfo=maninfo_str.split(/;\s*/m) + maninfo.each do |x| + @man_section= x[/^([1-8])/] if x =~/^([1-8])/ + @man_name= x[/name=(.+)/,1] if x =~/name=.+/ + @man_synopsis= x[/synopsis=(.+)/m,1] if x =~/synopsis=.+/ + end end @lv1 ||=/^1~/ @lv2 ||=/^2~/ @@ -583,6 +592,14 @@ module SiSU_Param end end end #% here endeth the document loop + @man_name.gsub!(/(-)/,"\\\\\\1") + @man_name.gsub!(/\n/,"\n.BR\n") + @man_name.gsub!(/\A/,"\n.SH NAME\n") + unless @man_synopsis.nil? + @man_synopsis.gsub!(/(-)/,"\\\\\\1") + @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 |