Next / Previous / Contents / TCC Help System / NM Tech homepage

21. addSubpageLink(): Link from the index page to one subpage

homelist2
# - - -   a d d S u b p a g e L i n k

def addSubpageLink(dirPath, node, letter):
    '''Build a link from the index page to the subpage for (letter).

      [ (dirPath is a path relative to TCC_URL) and
        (node is a div et.Element) and
        (letter is a single unicode character) ->
          node  +:=  a link to the subpage for letter ]
    '''

The URL of the subpage is determined by Section 22, “letterInfo(): Information about a subpage”.

homelist2
    #-- 1 --
    # [ subURL  :=  URL for letter ]
    subURL, subPath, subTitle = letterInfo(dirPath, letter)

    #-- 2 --
    # [ node  :=  node with a new link to (subURL) using (letter)
    #             as the link text ]
    node.append ( E.a ( letter, href=subURL ) )