diff options
author | Ralph Amissah <ralph@amissah.com> | 2015-03-19 23:47:17 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2015-03-23 21:46:12 -0400 |
commit | e7ce21ab4a724ee6743b4bb7d53c02aef06b805d (patch) | |
tree | 8bddf44cc19feb036ee2a1c6c439b81ba43a6234 /lib/sisu/develop/ao_syntax.rb | |
parent | d: ao & elsewhere, use of map & select (diff) |
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)
Diffstat (limited to 'lib/sisu/develop/ao_syntax.rb')
-rw-r--r-- | lib/sisu/develop/ao_syntax.rb | 22 |
1 files changed, 20 insertions, 2 deletions
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 \ |