Next / Previous / Contents / Shipman's homepage

12. buildSimpleMaster(): Build one simple-page-master

listext2
# - - -   b u i l d S i m p l e M a s t e r

def buildSimpleMaster(pageDims, bodyName, beforeName, afterName):
    '''Build one simple-page-master.

      [ (pageDims is an h.PageDims) and
        (bodyName, beforeName, and afterName are the names for
        the body, before, and after regions respectively) ->
          return a new simple-page-master et.Element using Args()
          and the page dimensions in pageDims ]
    '''

We add column-count and column-gap attributes to implement multi-column output (if selected). We also define before the before (header) region and the after (footer) region, although typically one of them will have a zero extent and the other will have extent HEADING_EXTENT.

listext2
    #-- 1
    return h.simpleMaster(bodyName, pageDims,
        h.regionBody(pageDims,
            h.dash(columnCount=str(Args().nCols),
                   columnGap=str(COL_GAP))),
        h.regionBefore(pageDims, beforeName),
        h.regionAfter(pageDims, afterName))