docbook: adding asciidoc support - subtitle
authorFredrik Unger <fredrik.unger@openchip.com>
Mon, 2 Mar 2026 10:53:49 +0000 (11:53 +0100)
committerFredrik Unger <fredrik.unger@openchip.com>
Mon, 2 Mar 2026 10:53:49 +0000 (11:53 +0100)
it is not possible to easilly express titelabbrev in asciidoc
adding subtitle if titleabbrev is not availible

treecutter/docbook.py

index 1a65873f4a5080732704e7ea3828298ee1dcec33..912d0e2c7b6ac38fe114bd0c061d2a8aac1ef4ec 100644 (file)
@@ -27,7 +27,11 @@ class Docbook():
             t = t[0].text
         ta = self._doc.xpath(u'/db:article/db:info/db:titleabbrev',namespaces=const.XPATH)
         if ta:
-           ta = unicode(ta[0].text)
+           ta = ta[0].text
+        else:
+           ta = self._doc.xpath(u'/db:article/db:info/db:subtitle',namespaces=const.XPATH)
+           if ta:
+              ta = ta[0].text
         return (t, ta)
 
     def status(self):