Scripts: generate one blank line if sphinx table is empty
PATCH 1/1 Scripts: generate one blank line if sphinx table is empty
An empty table without at least a empty line is not valid on Sphinx, so a blank line must be added when generating a table like so.
Signed-off-by Lucas Dutra Nunes <[email protected]>
--- scripts/doc_utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
scripts/doc_utils.py +5 -4
@@ -21,9 +21,10 @@ def tabularize(lines, spacing=2): if lines: col_widths = map(lambda col: apply(max, map(len, col) + [0]), apply(zip, lines)) - return '\n'.join([format_header(lines[0], col_widths, spc), - format_body(lines[1:], col_widths, spc), - format_border(col_widths)]) + \ - '\n' + table_data = [format_header(lines[0], col_widths, spc), + format_body(lines[1:], col_widths, spc), + format_border(col_widths)] + table_data = filter(lambda x: len(x) > 0, table_data) + return '\n'.join(table_data) + '\n' else: return ""
Signature · 1 line
2.1.4
Quoted 4 lines · Lucas Dutra Nunes
An empty table without at least a empty line is not valid on Sphinx, so a blank line must be added when generating a table like so.
Signed-off-by Lucas Dutra Nunes <[email protected]>
Acked-by Otavio Salvador <[email protected]>
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750