def METHOD_NAME(slideshow, zone, page_num):
    # if table of contents is not empty, add it
    if slideshow.contents:
        toc = html.SELECT(name="toc")
        toc.bind('change', lambda ev: METHOD_NAME(slideshow, zone,
            int(ev.target.options[ev.target.selectedIndex].value)))
        for content in slideshow.contents:
            toc <= html.OPTION(content[0], value=content[1],
                selected=page_num>=content[1])
    zone.clear()
    body = html.DIV()
    body.html = markdown.mark(slideshow.pages[page_num])[0]
    if slideshow.contents:
        body = html.DIV(toc+body)
    footer = html.DIV(Id="footer")
    if slideshow.title:
        footer <= html.DIV(slideshow.title,style=dict(display='inline'))
    if slideshow.show_page_num:
        footer <= html.SPAN(' (%s/%s)' %(page_num+1, len(slideshow.pages)),
            style=dict(display='inline'))
    timeline = html.DIV(Id='timeline')
    tl_pos = html.DIV(Id='tl_pos')
    timeline <= tl_pos
    timeline.bind('click', lambda ev:move_to(ev, slideshow, zone))
    tl_pos.bind('click', click_on_tl_pos)
    zone <= body+footer+timeline
    tw = window.getComputedStyle(timeline).width
    tw = round(float(tw[:-2]))
    tl_pos.style.left = '%spx' %(tw * page_num / len(slideshow.pages))
    for elt in zone.get(selector='.python'):
        src = elt.text.strip()
        width = max(len(line) for line in src.split('\n'))
        # replace element content by highlighted code
        elt.html = highlight.highlight(src).html
        elt.style.width = '%sem' %int(0.7*width)