From e7ce21ab4a724ee6743b4bb7d53c02aef06b805d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 19 Mar 2015 23:47:17 -0400 Subject: d: bibliography marked up section of citations & metadata * if any order is as follows: endnotes; bibliography; index * to trigger, identify the bibliography section using heading 1~biblio * and either: * provide tagged bibliography at end of document, along with an id for use in footnotes & the short title that should be used to substitute the id or: * tag citations in footnotes that should appear in bibliography * bibliography currently sorted on last name year and title * first pass (see documentation to be provided) --- lib/sisu/develop/ao_syntax.rb | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'lib/sisu/develop/ao_syntax.rb') diff --git a/lib/sisu/develop/ao_syntax.rb b/lib/sisu/develop/ao_syntax.rb index 5782f7d1..4632fb2d 100644 --- a/lib/sisu/develop/ao_syntax.rb +++ b/lib/sisu/develop/ao_syntax.rb @@ -61,8 +61,8 @@ module SiSU_AO_Syntax end end class Markup - def initialize(md='',data='') - @md,@data=md,data + def initialize(md='',data='',biblio=[]) + @md,@data,@bibliography=md,data,biblio @data_new=[] url_and_stub=SiSU_Env::InfoEnv.new.url @output_url="#{url_and_stub.remote}" @@ -221,6 +221,24 @@ module SiSU_AO_Syntax end def substitutions(dob) dob=dob.dup + dob=if @md.flag_auto_biblio \ + and @bibliography.length > 0 + dob=if dob.is !=:meta \ + && dob.is !=:heading_insert \ + && dob.is !=:code \ + && dob.is !=:comment \ + && dob.is !=:table + @bibliography.each do |c| + if c[:id] and not c[:id].nil? and not c[:id].empty? + dob.obj=dob.obj.gsub(/#{c[:id]}/mi,c[:short_name]) + end + end + dob + else dob + end + dob + else dob + end dob=if defined? @md.substitution_match_list[:match_and_replace] \ and @md.substitution_match_list[:match_and_replace].is_a?(Array) dob=if dob.is !=:meta \ -- cgit v1.2.3