For an overview of the structure of the index table, see Section 4.1, “XHTML for the index page”.
# - - - i n d e x T a b l e def indexTable ( parent, yearCollection ): '''Build the table of yearly rows and monthly link cells. [ (parent is an et.Element) and (yearCollection is a YearCollection instance) -> parent +:= the index table made from yearCollection ] '''
table element, and everything in it down
to but not including the
tbody element, are
built by Section 17, “
indexTableFrame(): Set up the table
#-- 1 -- # [ parent +:= a new table element containing column # definitions, column headings, and an empty tbody # element # tbody := that tbody element ] tbody = indexTableFrame ( parent )
All that remains is to fill in the rows of the table, one
per year. The method described in Section 21.4, “
Generate years in reverse chronological order” generates the years
in reverse chronological order as a sequence of
YearRow instances; each one results in one row of
the table. See Section 18, “
buildRow(): Build one row of the index
#-- 2 - # [ tbody +:= table rows made from the YearRow instances # in YearCollection, in reverse chronological order ] for yearRow in yearCollection.genYearsRev(): #-- 2 body -- # [ yearRow is a YearRow instance -> # tbody +:= a tr element made from yearRow ] buildRow ( tbody, yearRow )