]> pere.pagekite.me Git - text-madewithcc.git/blobdiff - fixup-docbook.rb
Add code in fixup-docbook.rb to make CC logo images informalfigure.
[text-madewithcc.git] / fixup-docbook.rb
index 1fe55d0de9ee6c3b00353dc12c89729ae4d26d63..e26abe503279eedc9892cf02472f0766a0d3d8a5 100755 (executable)
@@ -80,6 +80,12 @@ xml.css('para').each do |para|
   end
 end
 
+log 0, 'change CC logo images to informalfigure'
+xml.css('figure mediaobject imageobject imagedata[width="40.0%"]').each do |id|
+  f = id.parent.parent.parent
+  f.name = 'informalfigure'
+end
+
 log 0, 'Writing processed file'
 # Unable to figure out API way to replace DOCTYPE
 data = xml.to_xml().gsub!(/DOCTYPE article/, 'DOCTYPE book')