]> pere.pagekite.me Git - text-madewithcc.git/blobdiff - fixup-docbook.rb
Translated using Weblate (Norwegian Bokmål)
[text-madewithcc.git] / fixup-docbook.rb
index 05f5a53214e0b0bd7515ec6c0b23287ba7191f17..0d3b5ccba597519c1f2305ba1386527f38ecc32a 100755 (executable)
@@ -66,6 +66,24 @@ if s
   end
 end
 
   end
 end
 
+
+log 0, 'remove empty notes/web links sections'
+[
+  'Notes',
+  'Web links',
+  'Web link',
+].each do |title|
+  xml.xpath("//title[text()='%s']" % title).each do |node|
+    p = node.parent
+    node.remove
+    if p.content =~ /^\s*$/
+      p.remove
+    else
+      raise RuntimeError, 'Non-empty «%s» found' % title
+    end
+  end
+end
+
 log 0, 'remove title from dedication'
 xml.css('dedication title')[0].content = ""
 
 log 0, 'remove title from dedication'
 xml.css('dedication title')[0].content = ""
 
@@ -120,6 +138,9 @@ Kickstarter.com platform.</para>
 
 XML
 
 
 XML
 
+log 0, 'remove title from colophon'
+xml.css('colophon title')[0].content = ""
+
 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
 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