]> pere.pagekite.me Git - text-madewithcc.git/blobdiff - fixup-docbook-translated.rb
Little little but unavoidable editorial changes
[text-madewithcc.git] / fixup-docbook-translated.rb
index 405a094e238bfaf08e41b827b81fcbe638681d6a..1d7e3a042e4776fcdcac94e5c1a10f2d4456f26a 100644 (file)
@@ -43,6 +43,21 @@ xml.search('imagedata').each do |img|
   end
 end
 
+log 0, 'Final editorial requests: Attributions on top, as in other chapters, also for prefaces'
+xml.search('preface').each do |pref|
+  title = pref.search('title').first
+  attrib = pref.search('blockquote').last
+  attrib_text =  attrib.inner_text.gsub(/\s+/,' ')
+
+  # Some formatting issues we need to modify
+  attrib_text.gsub!(/Paul y Sarah/, 'Paul <?latex \textup{>y<?latex } > Sarah')
+  attrib_text.gsub!(/Merkley (CEO.*)/, 'Merkley <citetitle>\1</citetitle>')
+
+  attrib.remove
+  title.after('<blockquote><attribution>%s</attribution></blockquote>' % attrib_text)
+  log 1, 'Moved: %s' % attrib_text
+end
+
 log 0, 'Writing processed file'
 # Unable to figure out API way to replace DOCTYPE
 data = xml.to_xml()