Next / Previous / Contents / Shipman's homepage

14. simpleMaster: Generate a simple-page-master

See Section 4.8, “simpleMaster(): The simple-page-master, and also Section 4.21, “dash(): Attribute set builder”, the function that builds an attribute dictionary.

fohelpers.py
# - - -   s i m p l e M a s t e r

def simpleMaster(masterName, pageDim, *contents, **attrs):
    '''Return a new simple-page-master tree.

      [ (masterName is a valid XML name) and 
        (pageDim is a PageDim instance) and
        (contents is a sequence of values acceptable to E()) and
        (attrs is a dictionary of attribute names and values) ->
          return a new simple-page-master et.Element
          with that master-name, page size from pageDim.pageBox,
          page margins from pageDim.pageMargins, contents (contents),
          and attributes (attrs) ]
    '''
    #-- 1 --
    return E("simple-page-master",
             dash(masterName=masterName,
             pageWidth=pageDim.pageBox.wide,
             pageHeight=pageDim.pageBox.high),
             pageDim.pageMargins.dict(),             
             attrs, *contents)