• Home
  • Raw
  • Download

Lines Matching +full:max +full:- +full:len

2 # -*- coding: utf-8; mode: python -*-
6 flat-table
9 Implementation of the ``flat-table`` reST-directive.
14 The ``flat-table`` (:py:class:`FlatTable`) is a double-stage list similar to
15 the ``list-table`` with some additional features:
17 * *column-span*: with the role ``cspan`` a cell can be extended through
20 * *row-span*: with the role ``rspan`` a cell can be extended through
24 right side of that table-row. With Option ``:fill-cells:`` this behavior
30 * header-rows: [int] count of header rows
31 * stub-columns: [int] count of stub columns
33 * fill-cells: instead of autospann missing cells, insert missing cells
60 app.add_directive("flat-table", FlatTable)
102 u"""FlatTable (``flat-table``) directive"""
107 , 'header-rows': directives.nonnegative_int
108 , 'stub-columns': directives.nonnegative_int
110 , 'fill-cells' : directives.flag }
128 # SDK.CONSOLE() # print --> tableNode.asdom().toprettyxml()
138 u"""Builds a table from a double-stage list"""
153 stub_columns = self.directive.options.get('stub-columns', 0)
154 header_rows = self.directive.options.get('header-rows', 0)
157 tgroup = nodes.tgroup(cols=len(colwidths))
164 # absence of rowspan (observed by the html builder, the docutils-xml
166 # no table directive (except *this* flat-table) which allows to
167 # define coexistent of rowspan and stubs (there was no use-case
168 # before flat-table). This should be reviewed (later).
171 stub_columns -= 1
173 stub_columns = self.directive.options.get('stub-columns', 0)
217 if len(node) != 1 or not isinstance(node[0], nodes.bullet_list):
237 * Autospan or fill (option ``fill-cells``) missing cells on the right
238 side of the table-row
242 while y < len(self.rows):
245 while x < len(self.rows[y]):
270 # re-calculate the max columns.
273 if self.max_cols < len(row):
274 self.max_cols = len(row)
279 if 'fill-cells' in self.directive.options:
283 x = self.max_cols - len(row)
285 if row[-1] is None:
286 row.append( ( x - 1, 0, []) )
288 cspan, rspan, content = row[-1]
289 row[-1] = (cspan + x, rspan, content)
305 if len (content) > 30:
310 retVal = retVal[:-2]
312 retVal = retVal[:-2]
338 'two-level bullet list expected, but row %s does not '
339 'contain a second-level bullet list.'
353 if not len(cellItem):