Next / Previous / Contents / Shipman's homepage

21.6. Heading.__buildStatic(): Build a header's static-content

listext2
# - - -   H e a d i n g . _ _ b u i l d S t a t i c

    def __buildStatic(self, pages, flowName, *content):
        '''Build the static-content element for a running head.

          [ (pages is a page-sequence et.Element) and
            (flowName is the name of a simple-page-master) and
            (content is a sequence of items acceptable to E()) ->
              pages  +:=  a new static-content element for flowName
                  containing content ]
        '''

The child of a static-content element must be a block. Our block has the font defined in Section 8.19, “HEAD_FONT, a hairline border, and a bit of internal padding. The text-align-last='justify' attribute causes the content to be stretched to the width of the page, so the content must include at least one leader to soak up the extra space.

listext2
        #-- 1
        pages.append(
            E('static-content',
                h.dash(flowName=flowName),
                h.block(HEAD_FONT,
                    h.dash(borderStyle='solid',
                       borderWidth=HAIRLINE_WIDE,
                       padding='2pt', textAlignLast='justify'),
                    *content)))