]> pere.pagekite.me Git - text-madewithcc.git/commitdiff
Add disabled code in fixup-docbook.rb to use chapterinfo/author.
authorPetter Reinholdtsen <pere@hungry.com>
Sun, 4 Mar 2018 07:09:41 +0000 (08:09 +0100)
committerPetter Reinholdtsen <pere@hungry.com>
Sun, 4 Mar 2018 18:12:12 +0000 (18:12 +0000)
fixup-docbook.rb

index 0ef6cf5e19e60bc3052e243e9e4ec13454eb81f2..2b51da18926ed84f8486ac7d5be30de6733864bc 100755 (executable)
@@ -154,6 +154,25 @@ xml.css('figure').each do |fig|
   seq = seq + 1
 end
 
   seq = seq + 1
 end
 
+# Disabled as dblatex do not understand chapter/chapterinfo/author,
+# see <URL: https://bugs.debian.org/891183 >.
+if false
+log 0, 'migrate chapter author into <chapterinfo> where relevant'
+xml.css('chapter para').each do |para|
+  if para.content =~ /^\s*((Paul|Sarah Hinchliff) (Stacey|Pearson))\s*$/
+    log 1, 'migrated %s %s' % [$2, $3]
+    para.parent.css('title')[0].before(<<'XML' % [$2, $3])
+      <chapterinfo>
+       <author>
+         <firstname>%s</firstname><surname>%s</surname>
+       </author>
+      </chapterinfo>
+XML
+    para.remove
+  end
+end
+end
+
 log 0, 'Writing processed file'
 # Unable to figure out API way to replace DOCTYPE
 data = xml.to_xml().gsub!(/DOCTYPE article/, 'DOCTYPE book')
 log 0, 'Writing processed file'
 # Unable to figure out API way to replace DOCTYPE
 data = xml.to_xml().gsub!(/DOCTYPE article/, 'DOCTYPE book')