# Idiom for building complex web pages # Author: mario@ruggier.org A description of an idiom for building complex web pages, that contain behaviour-rich page components. Note that this is independent of the templating being used. # page_info ################################################################## Each page has an info object, either defined wherever the page is defined, or in some centralized place, as preferred. A copy of this object is passed along to the request (or hit in qp) and it can be therefore modified freely during page processing, before rendering. A basic idea here was to maximize sanity when developing complex html pages, as well as making those complex pages as simple as they can possibly be, for the browser to handle, and for debugging. If all css and js required by a page is built in this way, then *all* of it is rendered in the page's , that is therefore guaranteed to be all loaded by the time the page onload gets fired, thus shortcutting many potential annoyances. page_info = dict( ''' We may want to have different "visual" categories of pages ''' category = 'std', # 'home' | 'error' | 'data_listing' | ... ''' Some pages have a fixed title. This can be in and of itself a tiny template, for variable substitution at page-rendering time. ''' title = string, ''' css file names, each giving a element ''' css_files = [], ''' css code snippets, inlined in a single