sisu 7.0.0 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18bd00a4b80ceebf2fe0f79c8b231a22b5352f9b
4
- data.tar.gz: 053d72c0dbb92e47f87581ba2416925f63907e4d
3
+ metadata.gz: ec1967070776c6a1ed4417c8ce4873bfcfe5721e
4
+ data.tar.gz: be2dcbe200bdad9a10d6177f2226bb81d9c622af
5
5
  SHA512:
6
- metadata.gz: cf5b3acd8b1dd03cbbedd9e3e615fec972477174563ad0f27b60b8a8ed03914262a0e6d81c77ae03ddb805d5f3be77e7040ac72e0136bf6f6c9107159d81a302
7
- data.tar.gz: cc379aaae9efc40470efaa3dd7dfadba3a131a2d4662d60d0ed78d5438f2198d36b4aa4b40937936ff662ea332c655fc7f911b50e6fcaea5cf0ee6e41c2a0d6f
6
+ metadata.gz: e8a3d8f61a14b83d02c2cf7c45dfd9631f0c50a167c746462a2ba401e961810bca5d6a1e19d2f42b7973f88cae114ee68e2f6a2d78f4af41a15840ccbc826482
7
+ data.tar.gz: d24d3987935d8b6f0d4cf26576c21abaf8d94e0ff94a572888eeac200e9cd80478669c65637543ec20583a81537c2e0174ec2a019cb8316dade4151bf1120a65
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :project: SiSU
3
- :version: 7.0.0
4
- :date_stamp: 2015w17/5
5
- :date: "2015-05-01"
3
+ :version: 7.1.0
4
+ :date_stamp: 2015w19/5
5
+ :date: "2015-05-15"
data/lib/sisu/ao.rb CHANGED
@@ -64,7 +64,7 @@ module SiSU_AO
64
64
  require_relative 'ao_syntax' # ao_syntax.rb
65
65
  include SiSU_AO_Syntax
66
66
  require_relative 'ao_doc_str' # ao_doc_str.rb
67
- require_relative 'ao_references' # ao_references.rb
67
+ require_relative 'ao_appendices' # ao_appendices.rb
68
68
  require_relative 'ao_idx' # ao_idx.rb
69
69
  require_relative 'ao_numbering' # ao_numbering.rb
70
70
  require_relative 'ao_hash_digest' # ao_hash_digest.rb
@@ -534,38 +534,38 @@ module SiSU_AO
534
534
  reset
535
535
  data_txt=@data
536
536
  data_txt=
537
- SiSU_AO_Insertions::Insertions.new(@md,data_txt). # ao_expand_insertions.rb
537
+ SiSU_AO_Insertions::Insertions.new(@md,data_txt). # ao_expand_insertions.rb
538
538
  expand_insertions?
539
539
  data_txt=
540
- SiSU_AO_MiscArrangeText::SI.new(@md,data_txt). # ao_misc_arrange.rb
540
+ SiSU_AO_MiscArrangeText::SI.new(@md,data_txt). # ao_misc_arrange.rb
541
541
  prepare_text
542
542
  data_obj,
543
543
  metadata,
544
544
  bibliography=
545
- SiSU_AO_DocumentStructureExtract::Build.new(@md,data_txt). # ao_doc_str.rb
545
+ SiSU_AO_DocumentStructureExtract::Build.new(@md,data_txt). # ao_doc_str.rb
546
546
  identify_parts
547
547
  data_obj=
548
- SiSU_AO_Syntax::Markup.new(@md,data_obj,bibliography).songsheet # ao_syntax.rb
548
+ SiSU_AO_Syntax::Markup.new(@md,data_obj,bibliography).songsheet # ao_syntax.rb
549
549
  data_obj,
550
550
  endnote_array=
551
- SiSU_AO_CharacterCheck::Check.new(data_obj). # ao_character_check.rb
551
+ SiSU_AO_CharacterCheck::Check.new(data_obj). # ao_character_check.rb
552
552
  character_check_and_oldstyle_endnote_array
553
553
  data_obj=
554
- SiSU_AO_Images::Images.new(@md,data_obj).images # ao_images.rb
554
+ SiSU_AO_Images::Images.new(@md,data_obj).images # ao_images.rb
555
555
  data_obj,
556
556
  tags_map,
557
557
  ocn_html_seg_map=
558
- SiSU_AO_Numbering::Numbering.new(@md,data_obj,@fnx,@process). # ao_numbering.rb
558
+ SiSU_AO_Numbering::Numbering.new(@md,data_obj,@fnx,@process). # ao_numbering.rb
559
559
  numbering_song
560
560
  data_obj,
561
561
  book_index_rel,
562
562
  book_index_rel_html_seg,
563
563
  html_idx,
564
564
  xhtml_idx=
565
- SiSU_AO_BookIndex::BookIndex.new(@md,data_obj,@env). # ao_idx.rb
565
+ SiSU_AO_BookIndex::BookIndex.new(@md,data_obj,@env). # ao_idx.rb
566
566
  indexing_song if @md.book_idx
567
567
  data_obj=
568
- SiSU_AO_Endnotes::Endnotes.new(@md,data_obj,endnote_array). # ao_endnotes.rb
568
+ SiSU_AO_Endnotes::Endnotes.new(@md,data_obj,endnote_array). # ao_endnotes.rb
569
569
  endnotes
570
570
  outputdata=data_obj
571
571
  if (@md.opt.act[:ao][:set]==:on \
@@ -51,154 +51,284 @@
51
51
 
52
52
  ** Git
53
53
  <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary>
54
- <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/ao_references.rb;hb=HEAD>
54
+ <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/ao_appendices.rb;hb=HEAD>
55
55
 
56
56
  =end
57
- module SiSU_AO_References
57
+ module SiSU_AO_Appendices
58
+ class Glossary
59
+ def initialize(md,data)
60
+ @md,@data=md,data
61
+ end
62
+ def glossary_extraction
63
+ glossary=[]
64
+ glossaryflag=false
65
+ code_flag=false
66
+ flag_code_curly=:not_code_curly
67
+ flag_code_tics=:not_code_tics
68
+ @data=@data.select do |t_o|
69
+ if t_o =~/^code\{/
70
+ flag_code_curly=:code_curly
71
+ elsif t_o =~/^\}code/
72
+ flag_code_curly=:not_code_curly
73
+ elsif t_o =~/^``` code/
74
+ flag_code_tics=:code_tics
75
+ elsif flag_code_tics ==:code_tics \
76
+ and t_o =~/^```/
77
+ flag_code_tics=:not_code_tics
78
+ end
79
+ code_flag=if flag_code_curly==:code_curly \
80
+ or flag_code_tics==:code_tics
81
+ true
82
+ else false
83
+ end
84
+ unless code_flag
85
+ if @md.flag_glossary
86
+ if t_o =~/^1~!glossary/
87
+ glossaryflag = true
88
+ next
89
+ elsif t_o =~/^:?[B-D]~/
90
+ next
91
+ elsif t_o =~/^:?[B-D1]~/
92
+ glossaryflag = false
93
+ t_o
94
+ elsif glossaryflag
95
+ if t_o !~/\A%+ /
96
+ glossary << t_o
97
+ next
98
+ else
99
+ t_o
100
+ end
101
+ else t_o
102
+ end
103
+ else t_o
104
+ end
105
+ else t_o
106
+ end
107
+ end.compact
108
+ [@data,glossary]
109
+ end
110
+ end
58
111
  class Bibliography
59
112
  def initialize(md,data)
60
113
  @md,@data=md,data
61
114
  end
62
- def sort_bibliography_array_by_author_year_title(bib)
115
+ def sort_bibliography_array_by_deemed_author_year_title(bib)
63
116
  if bib
64
117
  bib.compact.sort_by do |c|
65
- [c[:author_arr][0],c[:year],c[:title]]
118
+ [c[:deemed_author],c[:ymd],c[:title]]
66
119
  end
67
120
  end
68
121
  end
69
122
  def citation_in_prepared_bibliography(cite)
70
123
  @cite=cite
71
- def article
124
+ def generic
72
125
  {
73
- is: :article,
126
+ is: nil, # :book, :article, :magazine, :newspaper, :blog, :other
74
127
  author_raw: nil,
75
128
  author: nil,
76
129
  author_arr: nil,
77
- title: nil,
78
- language: nil,
79
- journal: nil,
80
- volume: nil,
130
+ editor_raw: nil,
81
131
  editor: nil,
82
- year: nil,
83
- where: nil,
84
- url: nil,
85
- note: nil,
86
- short_name: nil,
87
- id: nil,
88
- }
89
- end
90
- def book
91
- {
92
- is: :book,
93
- author_raw: nil,
94
- author: nil,
95
- author_arr: nil,
96
- #editor: nil,
132
+ editor_arr: nil,
97
133
  title: nil,
98
134
  subtitle: nil,
99
135
  fulltitle: nil,
100
136
  language: nil,
101
- publisher: nil,
137
+ trans: nil,
138
+ src: nil,
139
+ journal: nil,
140
+ in: nil,
141
+ volume: nil,
102
142
  edition: nil,
103
143
  year: nil,
104
- where: nil,
144
+ place: nil,
145
+ publisher: nil,
105
146
  url: nil,
147
+ pages: nil,
106
148
  note: nil,
149
+ #format: nil, #consider list of fields arranged with markup
107
150
  short_name: nil,
108
151
  id: nil,
109
152
  }
110
153
  end
111
154
  def citation_metadata
112
- type=if @cite =~/^jo: \S+/m
113
- :article
114
- elsif @cite =~/^au: \S+/m
115
- :book
116
- end
155
+ type=:generic
117
156
  if type
157
+ citation=generic
118
158
  citeblock=@cite.split("\n")
119
- if type == :article
120
- citation=article
121
- citeblock.select do |meta|
122
- case meta
123
- when /^((?:au|author):\s+)\S+/ #req
124
- citation[:author_raw]=/^#{$1}(.+)/.match(meta)[1]
125
- when /^((?:ti|title):\s+)\S+/ #req
126
- citation[:title]=/^#{$1}(.+)/.match(meta)[1]
127
- when /^((?:lng|language):\s+)\S+/
128
- citation[:language]=/^#{$1}(.+)/.match(meta)[1]
129
- when /^((?:jo|journal):\s+)\S+/ #req?
130
- citation[:journal]=/^#{$1}(.+)/.match(meta)[1]
131
- when /^((?:vo|volume):\s+)\S+/
132
- citation[:volume]=/^#{$1}(.+)/.match(meta)[1]
133
- when /^((?:edr|editor):\s+)\S+/
134
- citation[:editor]=/^#{$1}(.+)/.match(meta)[1]
135
- when /^((?:yr|year):\s+)\S+/ #req?
136
- citation[:year]=/^#{$1}(.+)/.match(meta)[1]
137
- when /^((?:pst|publisher_state):\s+)\S+/
138
- citation[:where]=/^#{$1}(.+)/.match(meta)[1]
139
- when /^(url:\s+)\S+/
140
- citation[:url]=/^#{$1}(.+)/.match(meta)[1]
141
- when /^(note:\s+)\S+/
142
- citation[:note]=/^#{$1}(.+)/.match(meta)[1]
143
- when /^((?:sn|shortname):\s+)\S+/
144
- citation[:short_name]=/^#{$1}(.+)/.match(meta)[1]
145
- when /^(id:\s+)\S+/
146
- citation[:id]=/^#{$1}(.+)/.match(meta)[1]
147
- end
159
+ citeblock.select do |meta|
160
+ case meta
161
+ when /^((?:au|author):\s+)\S+/ #req
162
+ citation[:author_raw]=/^#{$1}(.+)/.match(meta)[1]
163
+ when /^((?:ti|title):\s+)\S+/ #req
164
+ citation[:title]=/^#{$1}(.+)/.match(meta)[1]
165
+ when /^((?:st|subtitle):\s+)\S+/
166
+ citation[:subtitle]=/^#{$1}(.+)/.match(meta)[1]
167
+ when /^((?:lng|language):\s+)\S+/
168
+ citation[:language]=/^#{$1}(.+)/.match(meta)[1]
169
+ when /^((?:edr?|editor):\s+)\S+/
170
+ citation[:editor_raw]=/^#{$1}(.+)/.match(meta)[1]
171
+ when /^((?:tr|trans(:?lator)?):\s+)\S+/
172
+ citation[:editor_raw]=/^#{$1}(.+)/.match(meta)[1]
173
+ when /^((?:pb|publisher):\s+)\S+/
174
+ citation[:publisher]=/^#{$1}(.+)/.match(meta)[1]
175
+ when /^((?:edn|edition):\s+)\S+/
176
+ citation[:edition]=/^#{$1}(.+)/.match(meta)[1]
177
+ when /^((?:yr|year):\s+)\S+/ #req?
178
+ citation[:year]=/^#{$1}(.+)/.match(meta)[1]
179
+ when /^((?:pl|publisher_state):\s+)\S+/
180
+ citation[:place]=/^#{$1}(.+)/.match(meta)[1]
181
+ when /^((?:jo|journal):\s+)\S+/ #req?
182
+ citation[:journal]=/^#{$1}(.+)/.match(meta)[1]
183
+ when /^((?:vol?|volume):\s+)\S+/
184
+ citation[:volume]=/^#{$1}(.+)/.match(meta)[1]
185
+ when /^((?:in):\s+)\S+/
186
+ citation[:in]=/^#{$1}(.+)/.match(meta)[1]
187
+ when /^((?:src):\s+)\S+/
188
+ citation[:src]=/^#{$1}(.+)/.match(meta)[1]
189
+ when /^((?:pg|pages?):\s+)\S+/
190
+ citation[:pages]=/^#{$1}(.+)/.match(meta)[1]
191
+ when /^(url:\s+)\S+/
192
+ citation[:url]=/^#{$1}(.+)/.match(meta)[1]
193
+ when /^(note:\s+)\S+/
194
+ citation[:note]=/^#{$1}(.+)/.match(meta)[1]
195
+ when /^((?:sn|shortname):\s+)\S+/ # substitution: (/#{id}/,"#{sn}")
196
+ citation[:short_name]=/^#{$1}(.+)/.match(meta)[1]
197
+ when /^(id:\s+)\S+/ # substitution: (/#{id}/,"#{sn}")
198
+ citation[:id]=/^#{$1}(.+)/.match(meta)[1]
148
199
  end
149
200
  end
150
- if type == :book
151
- citation=book
152
- citeblock.select do |meta|
153
- case meta
154
- when /^((?:au|author):\s+)\S+/ #req
155
- citation[:author_raw]=/^#{$1}(.+)/.match(meta)[1]
156
- when /^((?:ti|title):\s+)\S+/ #req
157
- citation[:title]=/^#{$1}(.+)/.match(meta)[1]
158
- when /^((?:st|subtitle):\s+)\S+/
159
- citation[:subtitle]=/^#{$1}(.+)/.match(meta)[1]
160
- when /^((?:lng|language):\s+)\S+/
161
- citation[:language]=/^#{$1}(.+)/.match(meta)[1]
162
- when /^((?:pb|publisher):\s+)\S+/
163
- citation[:publisher]=/^#{$1}(.+)/.match(meta)[1]
164
- when /^((?:edn|edition):\s+)\S+/
165
- citation[:edition]=/^#{$1}(.+)/.match(meta)[1]
166
- when /^((?:yr|year):\s+)\S+/ #req?
167
- citation[:year]=/^#{$1}(.+)/.match(meta)[1]
168
- when /^((?:pst|publisher_state):\s+)\S+/
169
- citation[:where]=/^#{$1}(.+)/.match(meta)[1]
170
- when /^(url:\s+)\S+/
171
- citation[:url]=/^#{$1}(.+)/.match(meta)[1]
172
- when /^(note:\s+)\S+/
173
- citation[:note]=/^#{$1}(.+)/.match(meta)[1]
174
- when /^((?:sn|shortname):\s+)\S+/
175
- citation[:short_name]=/^#{$1}(.+)/.match(meta)[1]
176
- when /^(id:\s+)\S+/
177
- citation[:id]=/^#{$1}(.+)/.match(meta)[1]
178
- end
179
- end
201
+ if citation[:subtitle]
202
+ citation[:fulltitle] = citation[:title] \
203
+ + ' - ' \
204
+ + citation[:subtitle]
205
+ else
206
+ citation[:fulltitle] = citation[:title]
180
207
  end
181
- if citation[:is]==:book
182
- if citation[:subtitle]
183
- citation[:fulltitle] = citation[:title] \
184
- + ' - ' \
185
- + citation[:subtitle]
186
- else
187
- citation[:fulltitle] = citation[:title]
188
- end
208
+ if citation[:author_raw]
209
+ citation[:author_arr]=citation[:author_raw].split(/;\s*/)
210
+ citation[:author]=citation[:author_arr].map do |author|
211
+ author.gsub(/(.+?),\s+(.+)/,'\2 \1').strip
212
+ end.join(', ').strip
213
+ end
214
+ if citation[:editor_raw]
215
+ citation[:editor_arr]=citation[:editor_raw].split(/;\s*/)
216
+ citation[:editor]=citation[:editor_arr].map do |editor|
217
+ editor.gsub(/(.+?),\s+(.+)/,'\2 \1').strip
218
+ end.join(', ').strip
219
+ end
220
+ citation[:ymd]=if not citation[:year] =~/^[0-9]{4}/
221
+ '9999'
222
+ else citation[:year]
223
+ end
224
+ citation[:deemed_author]=if not citation[:author_raw] \
225
+ and citation[:editor_raw]
226
+ citation[:editor_arr][0]
227
+ elsif citation[:author_raw]
228
+ citation[:author_arr][0]
229
+ else
230
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).
231
+ warn('Citation needs an author or editor, title: "' \
232
+ + citation[:title] + '"')
233
+ '000'
189
234
  end
190
- citation[:author_arr]=citation[:author_raw].split(/;\s*/)
191
- citation[:author]=citation[:author_arr].map do |author|
192
- author.gsub(/(.+?),\s+(.+)/,'\2 \1').strip
193
- end.join(', ').strip
194
235
  unless citation[:short_name]
195
- citation[:short_name]=%{#{c[:author]}, "#{c[:short_name]}" (#{c[:date]})}
236
+ citation[:short_name]=%{#{citation[:author]}, "#{citation[:title]}" (#{citation[:date]})}
196
237
  end
197
238
  end
198
239
  citation
199
240
  end
200
241
  self
201
242
  end
243
+ def biblio_format
244
+ def generic(c)
245
+ cite=%{#{c[:author]}. /{"#{c[:fulltitle]}".}/}
246
+ cite=(c[:journal]) \
247
+ ? cite + %{ #{c[:journal]},}
248
+ : cite
249
+ cite=(c[:source]) \
250
+ ? cite + %{ #{c[:source]},}
251
+ : cite
252
+ cite=(c[:in]) \
253
+ ? cite + %{ in #{c[:in]},}
254
+ : cite
255
+ cite=(c[:volume]) \
256
+ ? cite + %{ #{c[:volume]},}
257
+ : cite
258
+ cite=(c[:trans]) \
259
+ ? cite + %{ trans. #{c[:trans]},}
260
+ : cite
261
+ cite=(c[:editor]) \
262
+ ? cite + %{ ed. #{c[:editor]},}
263
+ : cite
264
+ cite=(c[:place]) \
265
+ ? cite + %{ #{c[:place]},}
266
+ : cite
267
+ cite=(c[:publisher]) \
268
+ ? cite + %{ #{c[:publisher]},}
269
+ : cite
270
+ cite=(c[:year]) \
271
+ ? cite + %{ (#{c[:year]})}
272
+ : cite
273
+ cite=(c[:pages]) \
274
+ ? cite + %{ #{c[:pages]}}
275
+ : cite
276
+ cite=(c[:url]) \
277
+ ? cite + %{ #{c[:url]}}
278
+ : cite
279
+ cite=(c[:note]) \
280
+ ? cite + %{ #{c[:note]}}
281
+ : cite
282
+ cite
283
+ end
284
+ def generic_editor(c)
285
+ cite=%{#{c[:editor]} ed. /{"#{c[:fulltitle]}".}/}
286
+ cite=(c[:journal]) \
287
+ ? cite + %{ #{c[:journal]}, }
288
+ : cite
289
+ cite=(c[:source]) \
290
+ ? cite + %{ #{c[:source]}, }
291
+ : cite
292
+ cite=(c[:in]) \
293
+ ? cite + %{ in #{c[:in]},}
294
+ : cite
295
+ cite=(c[:volume]) \
296
+ ? cite + %{ #{c[:volume]},}
297
+ : cite
298
+ cite=(c[:trans]) \
299
+ ? cite + %{ trans. #{c[:trans]},}
300
+ : cite
301
+ cite=(c[:place]) \
302
+ ? cite + %{ #{c[:place]},}
303
+ : cite
304
+ cite=(c[:publisher]) \
305
+ ? cite + %{ #{c[:publisher]}}
306
+ : cite
307
+ cite=(c[:year]) \
308
+ ? cite + %{ (#{c[:year]})}
309
+ : cite
310
+ cite=(c[:pages]) \
311
+ ? cite + %{ #{c[:pages]}}
312
+ : cite
313
+ cite=(c[:url]) \
314
+ ? cite + %{ #{c[:url]}}
315
+ : cite
316
+ cite=(c[:note]) \
317
+ ? cite + %{ #{c[:note]}}
318
+ : cite
319
+ cite
320
+ end
321
+ self
322
+ end
323
+ def biblio_make(cite)
324
+ if cite[:author]
325
+ biblio_format.generic(cite)
326
+ elsif cite[:editor]
327
+ biblio_format.generic_editor(cite)
328
+ else
329
+ biblio_format.generic(cite)
330
+ end
331
+ end
202
332
  def biblio_extraction
203
333
  bibliography=[]
204
334
  biblioflag=false
@@ -223,7 +353,7 @@ module SiSU_AO_References
223
353
  end
224
354
  unless code_flag
225
355
  if @md.flag_auto_biblio
226
- if t_o =~/^1~biblio(?:graphy)?/
356
+ if t_o =~/^1~!biblio(?:graphy)?/
227
357
  biblioflag = true
228
358
  t_o
229
359
  elsif t_o =~/^:?[B-D1]~/
@@ -239,7 +369,7 @@ module SiSU_AO_References
239
369
  else t_o
240
370
  end
241
371
  elsif @md.flag_biblio
242
- if t_o =~/^1~biblio(?:graphy)?/
372
+ if t_o =~/^1~!biblio(?:graphy)?/
243
373
  biblioflag = true
244
374
  next
245
375
  elsif t_o =~/^:?[B-D]~/
@@ -264,30 +394,22 @@ module SiSU_AO_References
264
394
  if @md.flag_auto_biblio \
265
395
  and bibliography.length > 0
266
396
  data_new=[]
267
- bibliography=sort_bibliography_array_by_author_year_title(bibliography)
397
+ bib=sort_bibliography_array_by_deemed_author_year_title(bibliography)
398
+ biblio_done=[]
268
399
  @data.select do |t_o|
269
- if t_o =~/^1~biblio(?:graphy)?/
270
- bibliography.each do |c|
271
- if c[:is]==:book
272
- <<-WOK
273
-
274
- !_ #{c[:author]}
275
- /{"#{c[:fulltitle]}"}/ #{c[:publisher]} (#{c[:year]})
276
- WOK
277
- elsif c[:is]==:article
278
- <<-WOK
279
-
280
- !_ #{c[:author]}
281
- /{"#{c[:title]}"}/ #{c[:journal]} (#{c[:year]})
282
- WOK
283
- end
400
+ if t_o =~/^1~!biblio(?:graphy)?/
401
+ bib.each do |c|
402
+ d=c
403
+ d.store(:obj, biblio_make(c))
404
+ biblio_done << d
405
+ #biblio_done << { obj: biblio_make(c), id: c[:id] }
284
406
  end
285
407
  else data_new << t_o
286
408
  end
287
409
  end
288
410
  @data=data_new
289
411
  end
290
- [@data,bibliography]
412
+ [@data,biblio_done]
291
413
  end
292
414
  end
293
415
  class Citations
@@ -1072,7 +1072,13 @@ module SiSU_AO_DocumentStructureExtract
1072
1072
  table: 0,
1073
1073
  }
1074
1074
  @metadata={}
1075
- @data,bibliography=SiSU_AO_References::Bibliography.new(@md,@data).biblio_extraction
1075
+ if @md.flag_auto_biblio \
1076
+ or @md.flag_biblio
1077
+ @data,bibliography=SiSU_AO_Appendices::Bibliography.new(@md,@data).biblio_extraction
1078
+ end
1079
+ if @md.flag_glossary
1080
+ @data,glossary=SiSU_AO_Appendices::Glossary.new(@md,@data).glossary_extraction
1081
+ end
1076
1082
  tuned_file=extract_structure_loop(@data,tuned_file)
1077
1083
  if @md.flag_endnotes
1078
1084
  tuned_file << @pb
@@ -1095,6 +1101,30 @@ module SiSU_AO_DocumentStructureExtract
1095
1101
  obj: 'Endnotes'
1096
1102
  }
1097
1103
  end
1104
+ if @md.flag_glossary
1105
+ tuned_file << @pb
1106
+ h={
1107
+ ln: 1,
1108
+ lc: 1,
1109
+ obj: 'Glossary',
1110
+ autonum_: false,
1111
+ }
1112
+ tuned_file << SiSU_AO_DocumentStructure::ObjectHeading.new.heading_insert(h)
1113
+ h={
1114
+ ln: 4,
1115
+ lc: 2,
1116
+ obj: 'Glossary',
1117
+ name: 'glossary',
1118
+ autonum_: false,
1119
+ }
1120
+ tuned_file << SiSU_AO_DocumentStructure::ObjectHeading.new.heading_insert(h)
1121
+ h={
1122
+ obj: 'Glossary'
1123
+ }
1124
+ if glossary.length > 0
1125
+ tuned_file=extract_structure_loop(glossary,tuned_file)
1126
+ end
1127
+ end
1098
1128
  if @md.flag_auto_biblio
1099
1129
  tuned_file << @pb
1100
1130
  h={
@@ -1116,27 +1146,17 @@ module SiSU_AO_DocumentStructureExtract
1116
1146
  obj: 'Bibliography'
1117
1147
  }
1118
1148
  citenumber=0
1119
- bibliography.each do |c|
1120
- citenumber +=1 if c.is_a?(Hash)
1121
- if c[:is]==:book
1122
- h={
1123
- obj: %{[#{citenumber}] *{#{c[:author]}}* /{"#{c[:fulltitle]}"}/ #{c[:publisher]} (#{c[:year]}) #{c[:url]}},
1124
- tags: [c[:id]],
1125
- hang: 0,
1126
- indent: 2,
1127
- ocn_: false,
1128
- }
1129
- tuned_file << SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h)
1130
- elsif c[:is]==:article
1131
- h={
1132
- obj: %{[#{citenumber}] *{#{c[:author]}}* /{"#{c[:title]}"}/ #{c[:journal]} #{c[:volume]} (#{c[:year]}) #{c[:url]}},
1133
- tags: [c[:id]],
1134
- hang: 0,
1135
- indent: 2,
1136
- ocn_: false,
1137
- }
1138
- tuned_file << SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h)
1139
- end
1149
+ bibliography.each do |cite|
1150
+ citenumber +=1 if cite.is_a?(Hash)
1151
+ h={
1152
+ obj: cite[:obj],
1153
+ #obj: %{[#{citenumber}] } + cite[:obj],
1154
+ tags: [cite[:id]],
1155
+ hang: 0,
1156
+ indent: 2,
1157
+ ocn_: false,
1158
+ }
1159
+ tuned_file << SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h)
1140
1160
  end
1141
1161
  elsif @md.flag_biblio
1142
1162
  tuned_file << @pb
@@ -1158,17 +1178,19 @@ module SiSU_AO_DocumentStructureExtract
1158
1178
  h={
1159
1179
  obj: 'Bibliography'
1160
1180
  }
1161
- if bibliography.length > 0
1181
+ if not bibliography.nil? \
1182
+ and bibliography.length > 0
1162
1183
  tuned_file=extract_structure_loop(bibliography,tuned_file)
1163
1184
  else
1164
1185
  tuned_file, citations =
1165
- SiSU_AO_References::Citations.new(@md,tuned_file).songsheet # ao_references.rb
1186
+ SiSU_AO_Appendices::Citations.new(@md,tuned_file).songsheet # ao_appendices.rb
1166
1187
  citenumber=0
1167
1188
  citations.compact.each do |c|
1168
1189
  citenumber +=1 if c.is_a?(Hash)
1169
1190
  if c[:is]==:book
1170
1191
  h={
1171
- obj: %{[#{citenumber}] *{#{c[:author]}}* /{#{c[:publication]}}/ (#{c[:year]})},
1192
+ obj: %{#{c[:author]}. /{#{c[:publication]}}/ (#{c[:year]})},
1193
+ #obj: %{[#{citenumber}] *{#{c[:author]}}* /{#{c[:publication]}}/ (#{c[:year]})},
1172
1194
  hang: 0,
1173
1195
  indent: 2,
1174
1196
  ocn_: false,
@@ -1176,7 +1198,8 @@ module SiSU_AO_DocumentStructureExtract
1176
1198
  tuned_file << SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h)
1177
1199
  elsif c[:is]==:article
1178
1200
  h={
1179
- obj: %{[#{citenumber}] *{#{c[:author]}}* /{"#{c[:title]}"}/ #{c[:publication]} editor #{c[:editor]} (#{c[:year]})},
1201
+ obj: %{#{c[:author]}. /{"#{c[:title]}"}/ #{c[:publication]} editor #{c[:editor]} (#{c[:year]})},
1202
+ #obj: %{[#{citenumber}] *{#{c[:author]}}* /{"#{c[:title]}"}/ #{c[:publication]} editor #{c[:editor]} (#{c[:year]})},
1180
1203
  hang: 0,
1181
1204
  indent: 2,
1182
1205
  ocn_: false,
@@ -1229,7 +1252,7 @@ module SiSU_AO_DocumentStructureExtract
1229
1252
  obj: 'eof',
1230
1253
  }
1231
1254
  meta=SiSU_AO_DocumentStructure::ObjectMetadata.new.metadata(@metadata)
1232
- [tuned_file,meta,bibliography]
1255
+ [tuned_file,meta,bibliography,glossary]
1233
1256
  end
1234
1257
  def table_rows_and_columns_array(table_str)
1235
1258
  table=[]
data/lib/sisu/dp.rb CHANGED
@@ -897,9 +897,9 @@ module SiSU_Param
897
897
  @doc={ lv: [] }
898
898
  @doc[:fns],@doc[:fnb],@doc[:scr_suffix]='','',''
899
899
  @@publisher='SiSU scribe'
900
- attr_accessor :make,:env,:path,:file,:fn,:fns,:fno,:fnb,:fnn,:fnt,:fnl,:flv,:fnz,:fnstex,:ocn,:sfx_src,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:sisu,:project_details,:ruby_version,:title,:subtitle,:full_title,:html_title,:subtitle_tex,:creator,:classify,:author_home,:author,:author_title,:author_nationality,:authors,:authorship,:translator,:illustrator,:prepared_by,:digitized_by,:subject,:description,:publisher,:current_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,:lv0,:lv1,:lv2,:lv3,:lv4,:lv5,:lv6,:lvs,:pagenew,:pagebreak,:pageline,:num_top,:bold_match_list,:italics_match_list,:substitution_match_list,:emphasis_set_to,:toc_lev_limit,:flag_biblio,:flag_auto_biblio,:flag_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:markup,:markup_instruction,:flag_tables,:vocabulary,:doc_css,:yaml,:lnk,:links,: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,:filesize,:user,:home,:hostname,:pwd,:firstseg,:programs,:author_copymark,:i18n,:lang,:lang_code_insert,:en,:notes,:dgst,: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,:ec,:opt,:sem_tag,:book_idx,:topic_register,:topic_register_array,:original,:writing_focus,:audio,:daisy,:home_button_image,:home_button_links,:footer_links,:cover_image,:man_section
900
+ attr_accessor :make,:env,:path,:file,:fn,:fns,:fno,:fnb,:fnn,:fnt,:fnl,:flv,:fnz,:fnstex,:ocn,:sfx_src,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:sisu,:project_details,:ruby_version,:title,:subtitle,:full_title,:html_title,:subtitle_tex,:creator,:classify,:author_home,:author,:author_title,:author_nationality,:authors,:authorship,:translator,:illustrator,:prepared_by,:digitized_by,:subject,:description,:publisher,:current_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,:lv0,:lv1,:lv2,:lv3,:lv4,:lv5,:lv6,:lvs,:pagenew,:pagebreak,:pageline,:num_top,:bold_match_list,:italics_match_list,:substitution_match_list,:emphasis_set_to,:toc_lev_limit,:flag_biblio,:flag_auto_biblio,:flag_endnotes,:flag_auto_endnotes,:flag_glossary,:flag_separate_endnotes,:flag_separate_endnotes_make,:markup,:markup_instruction,:flag_tables,:vocabulary,:doc_css,:yaml,:lnk,:links,: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,:filesize,:user,:home,:hostname,:pwd,:firstseg,:programs,:author_copymark,:i18n,:lang,:lang_code_insert,:en,:notes,:dgst,: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,:ec,:opt,:sem_tag,:book_idx,:topic_register,:topic_register_array,:original,:writing_focus,:audio,:daisy,:home_button_image,:home_button_links,:footer_links,:cover_image,:man_section
901
901
  def initialize(fns_array,opt)
902
- @env=@path,@file=@fn=@fns=@fno=@fnb=@fnn=@fnt=@fnl=@flv=@fnz=@fnstex=@ocn=@sfx_src=@pdf=@file_type=@dir_out=@dir_tex=@dir_lout=@txt_path=@make=@flag_biblio=@flag_auto_biblio=@flag_endnotes=@flag_auto_endnotes=@flag_separate_endnotes=@flag_separate_endnotes_make=@sisu=@project_details=@ruby_version=@title=@subtitle=@full_title=@html_title=@subtitle_tex=@creator=@classify=@author_home=@author=@author_title=@author_nationality=@translator=@illustrator=@prepared_by=@digitized_by=@subject=@description=@publisher=@current_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=@lv0=@lv1=@lv2=@lv3=@lv4=@lv5=@lv6=@pagenew=@pagebreak=@pageline=@num_top=@bold_match_list=@italics_match_list=@substitution_match_list=@emphasis_set_to=@toc_lev_limit=@flag_tables=@vocabulary=@doc_css=@yaml=@lnk=@links=@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=@filesize=@firstseg=@programs=@author_copymark=@i18n=@lang=@lang_code_insert=@en=@notes=@dgst=@generated=@heading_seg_first=@base_program=@topic_register=@original=@writing_focus=@audio=@home_button_image=@home_button_links=@cover_image=@man_section=nil
902
+ @env=@path,@file=@fn=@fns=@fno=@fnb=@fnn=@fnt=@fnl=@flv=@fnz=@fnstex=@ocn=@sfx_src=@pdf=@file_type=@dir_out=@dir_tex=@dir_lout=@txt_path=@make=@flag_biblio=@flag_auto_biblio=@flag_endnotes=@flag_auto_endnotes=@flag_glossary=@flag_separate_endnotes=@flag_separate_endnotes_make=@sisu=@project_details=@ruby_version=@title=@subtitle=@full_title=@html_title=@subtitle_tex=@creator=@classify=@author_home=@author=@author_title=@author_nationality=@translator=@illustrator=@prepared_by=@digitized_by=@subject=@description=@publisher=@current_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=@lv0=@lv1=@lv2=@lv3=@lv4=@lv5=@lv6=@pagenew=@pagebreak=@pageline=@num_top=@bold_match_list=@italics_match_list=@substitution_match_list=@emphasis_set_to=@toc_lev_limit=@flag_tables=@vocabulary=@doc_css=@yaml=@lnk=@links=@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=@filesize=@firstseg=@programs=@author_copymark=@i18n=@lang=@lang_code_insert=@en=@notes=@dgst=@generated=@heading_seg_first=@base_program=@topic_register=@original=@writing_focus=@audio=@home_button_image=@home_button_links=@cover_image=@man_section=nil
903
903
  @data, @path, @fns, @fno, @opt=
904
904
  fns_array,opt.pth,opt.fns,opt.fno,opt #@data used as data
905
905
  @flag_tables,@set_header_title,@set_heading_top,@set_heading_seg,@heading_seg_first_flag,@flag_promo,@book_idx=
@@ -1014,6 +1014,7 @@ module SiSU_Param
1014
1014
  @fnstex=@fns.gsub(/_/,'\_\-').gsub(/\./,'.\-')
1015
1015
  @flag_endnotes,@flag_auto_endnotes,@flag_separate_endnotes=false,false,false
1016
1016
  @flag_separate_endnotes_make=true
1017
+ @flag_glossary=false
1017
1018
  @flag_biblio,@flag_auto_biblio=false,false
1018
1019
  ver=SiSU_Env::InfoVersion.instance
1019
1020
  @project_details=ver.get_version
@@ -1216,7 +1217,7 @@ module SiSU_Param
1216
1217
  ).txt_grey if @opt.act[:verbose][:set]==:on
1217
1218
  end
1218
1219
  unless @code_flag
1219
- if para =~/^1~biblio(?:graphy)?/
1220
+ if para =~/^1~!biblio(?:graphy)?/
1220
1221
  @flag_auto_biblio,@flag_biblio=false,true
1221
1222
  #@flag_biblio=true
1222
1223
  elsif @flag_biblio ==true \
@@ -1224,6 +1225,9 @@ module SiSU_Param
1224
1225
  and para =~/^(?:au|author):/m
1225
1226
  @flag_auto_biblio =true
1226
1227
  end
1228
+ if para =~/^1~!glossary/
1229
+ @flag_glossary=true
1230
+ end
1227
1231
  end
1228
1232
  if not @book_idx \
1229
1233
  and para =~/^=\{(.+?)\}[\s`]*\Z/m
@@ -883,7 +883,7 @@ WOK
883
883
  tags=''
884
884
  if defined? dob.tags \
885
885
  and dob.tags.length > 0 # insert tags "hypertargets"
886
- dob.tags.each do |t|
886
+ dob.tags.compact.each do |t| # .compact hides a problem, nil should not occur fix (upstream)
887
887
  t=t.gsub(/[^a-z0-9._-]/,'') #use for all html tags? consider limiting to strict? or implementing earlier
888
888
  tags=(t =~/^[0-9.]+$/) \
889
889
  ? tags #check what can be sorted in ao
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sisu
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ralph Amissah
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-01 00:00:00.000000000 Z
11
+ date: 2015-05-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: documents - structuring, publishing in multiple formats & search [7.0.0
14
- from git 7.0.0.r0.gc0f6a9e] (linux calls & without external dependencies)
13
+ description: documents - structuring, publishing in multiple formats & search [7.1.0]
14
+ (linux calls & without external dependencies)
15
15
  email: ralph.amissah@gmail.com
16
16
  executables:
17
17
  - sisugem
@@ -53,6 +53,7 @@ files:
53
53
  - lib/sisu.rb
54
54
  - lib/sisu/air.rb
55
55
  - lib/sisu/ao.rb
56
+ - lib/sisu/ao_appendices.rb
56
57
  - lib/sisu/ao_character_check.rb
57
58
  - lib/sisu/ao_composite.rb
58
59
  - lib/sisu/ao_doc_objects.rb
@@ -66,7 +67,6 @@ files:
66
67
  - lib/sisu/ao_misc_arrange.rb
67
68
  - lib/sisu/ao_numbering.rb
68
69
  - lib/sisu/ao_persist.rb
69
- - lib/sisu/ao_references.rb
70
70
  - lib/sisu/ao_syntax.rb
71
71
  - lib/sisu/cgi.rb
72
72
  - lib/sisu/cgi_pgsql.rb