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

Table of Contents

1. Introduction
1.1. How to get this publication
2. Overview
3. The XHTML to be generated
4. Code prologue
5. Manifest constants
5.1. CSS_URL: Stylesheet location
5.2. TOP_NAV_SEP: Separator string for the top navigational bar
5.3. TCC_MAIN_URL: TCC mainpage URL
5.4. TCC_LOGO_URL: TCC logo URL
5.5. BOT_NAV_SEP: Separator for page-bottom links
6. class TCCPage: The page object interface
6.1. TCCPage.__init__(): Constructor
6.2. TCCPage.__createHead(): Set up page heading
6.3. TCCPage.__createBody(): Set up page body
6.4. TCCPage.__topNav(): Set up top nav bar
6.5. TCCPage.__topNavItem(): Add one top navigational item
6.6. TCCPage.__titleBlock(): Set up page title block
6.7. TCCPage.__botNav(): Set up page-bottom navigational links
6.8. TCCPage.__botNavItem(): Generate page-bottom navigational link
6.9. TCCPage.__colophon(): Add colophon section
6.10. TCCPage.write(): Output the finished page
7. class NavLink: Describes one navigational feature

1. Introduction

The PyStyler application is used to maintain the bulk of the pages in the Tech Computer Center page structure and the TCC Help System. This application is rather antiquated, the design substantially stable since 1996; see Building informational webs with PyStyler (PDF format) for user-level documentation.

One major limitation of this system is that it treats its web pages as static structure, to be maintained with an ordinary text editor.

A number of TCC scripts generate Web pages outside the PyStyler system. Some scripts generate one or more static pages; other scripts are CGI scripts that generate pages dynamically in response to user requests. Ideally, PyStyler should be rewritten so that its content template can be applied easily to dynamically generate pages as well as to static pages inside a PyStyler document tree. This is a fairly sizeable project, however.

Here, we describe a Python module named tccpage.py that is intended for use by Python scripts that generate web pages. Its purpose is to mimic the appearance of pages generated by PyStyler so that they blend visually with static pages.

Warning

Here's why this is a short-term solution. The PyStyler system uses a template file named Template to describe the overall layout of a TCC page. The templates used in the TCC web and TCC help web haven't changed much lately, so they're the basis of the style imitated by the tccpage.py module. But if in the future we want to modify these templates, we'll have to modify the logic in the tccpage.py module in parallel. The best long-term solution is to do a whole new version of PyStyler that has a single source for template information that can drive both static and dynamic page generation.

1.1. How to get this publication

This publication is available in Web form and also as a PDF document. Please forward any comments to tcc-doc@nmt.edu.