Table of Contents
class TCCPage: The page object
interfaceTCCPage.__init__():
ConstructorTCCPage.__createHead():
Set up page headingTCCPage.__createBody():
Set up page bodyTCCPage.__topNav(): Set up top
nav barTCCPage.__topNavItem(): Add
one top navigational itemTCCPage.__titleBlock(): Set up
page title blockTCCPage.__botNav(): Set up
page-bottom navigational linksTCCPage.__botNavItem():
Generate page-bottom navigational linkTCCPage.__colophon(): Add
colophon sectionTCCPage.write(): Output the
finished pageclass NavLink: Describes
one navigational featureThe 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.
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.
This publication is available in
Web
form and also as a
PDF
document.
Please forward any comments to tcc-doc@nmt.edu.