From 785b1d0892ac042cadda3959f8783cd48b0334a6 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sun, 30 Nov 2014 22:16:34 +0100 Subject: [PATCH] [docmaker] Allow empty lines in `' blocks. Before this patch, the suggested order of entries stopped at the first empty line. Obviously, nobody noticed that this problem caused a much reduced set of links in the `Synopsis' sections; in particular, the `' blocks contain a lot of entries that wouldn't be listed otherwise... * src/tools/docmaker/content.py (DocBlock::get_markup_words_all): New function to iterate over all items. (DocSection::process): Use it. --- ChangeLog | 16 ++++++++++++++++ src/tools/docmaker/content.py | 11 ++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a0d3299af..083c131b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2014-11-29 Werner Lemberg + + [docmaker] Allow empty lines in `' blocks. + + Before this patch, the suggested order of entries stopped at the + first empty line. + + Obviously, nobody noticed that this problem caused a much reduced + set of links in the `Synopsis' sections; in particular, the + `' blocks contain a lot of entries that wouldn't be listed + otherwise... + + * src/tools/docmaker/content.py (DocBlock::get_markup_words_all): + New function to iterate over all items. + (DocSection::process): Use it. + 2014-11-29 Werner Lemberg * src/tools/docmaker/sources.py (column) [Format 2]: Fix regexp. diff --git a/src/tools/docmaker/content.py b/src/tools/docmaker/content.py index 28fc85d4a..ed3516c78 100644 --- a/src/tools/docmaker/content.py +++ b/src/tools/docmaker/content.py @@ -369,7 +369,7 @@ class DocSection: self.title = title self.abstract = block.get_markup_words( "abstract" ) self.description = block.get_markup_items( "description" ) - self.order = block.get_markup_words( "order" ) + self.order = block.get_markup_words_all( "order" ) return def reorder( self ): @@ -607,6 +607,15 @@ class DocBlock: except: return [] + def get_markup_words_all( self, tag_name ): + try: + m = self.get_markup( tag_name ) + return [word + for items in m.fields[0].items + for word in items.words] + except: + return [] + def get_markup_text( self, tag_name ): result = self.get_markup_words( tag_name ) return string.join( result )