]> pere.pagekite.me Git - text-madewithcc.git/blobdiff - fixup-docbook.rb
Add code to move user term info into <bookinfo><legalnotice>.
[text-madewithcc.git] / fixup-docbook.rb
index 8fc325b1a0022e83b3dc97146ad3fea3c9832ff8..1fe55d0de9ee6c3b00353dc12c89729ae4d26d63 100755 (executable)
@@ -66,6 +66,20 @@ if s
   end
 end
 
+log 0, 'remove title from dedication'
+xml.css('dedication title')[0].content = ""
+
+log 0, 'move legal notice to bookinfo'
+xml.css('book bookinfo')[0].first_element_child.before('<legalnotice>')
+ln = xml.css('book bookinfo legalnotice')[0]
+xml.css('para').each do |para|
+  if para.content =~ /This book is published under a/
+    log 0, 'found legal'
+    para.parent = ln
+    break
+  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')