diff --git a/newlib/doc/chapter-texi2docbook.py b/newlib/doc/chapter-texi2docbook.py index 834a14e7c..70ab3c04f 100755 --- a/newlib/doc/chapter-texi2docbook.py +++ b/newlib/doc/chapter-texi2docbook.py @@ -14,6 +14,7 @@ import re def main(): first_node = True + prev_sect = False print ('') print ('') @@ -27,18 +28,27 @@ def main(): if l.startswith("@node"): l = l.replace("@node", "", 1) l = l.strip() - l = l.lower() if first_node: - print ('' % l.replace(' ', '_')) + print ('' % l.lower().replace(' ', '_')) first_node = False + else: + if prev_sect: + print ('') + print ('
' % l) + prev_sect = True elif l.startswith("@chapter "): l = l.replace("@chapter ", "", 1) print ('%s' % l) + elif l.startswith("@section "): + l = l.replace("@section ", "", 1) + print ('%s' % l) elif l.startswith("@include "): l = l.replace("@include ", "", 1) l = l.replace(".def", ".xml", 1) print ('' % l.strip()) + if prev_sect: + print ('
') print ('
') if __name__ == "__main__" :