Table of Contents

Module: templates ./src/peak/web/templates.py

XML/XHTML Templates for peak.web, similar to Twisted's Woven

TODO

  • Address traversal nesting for referenced data

  • Dynamic attributes, independent of element?

  • Phase out old PWT syntax

  • implement sub-template support (convert doc->DOMlet in another doc)

  • add hooks for DOMlets to validate the list of supplied parameters

  • list DOMlet needs iteration variables, maybe paging

  • need translation DOMlets, among lots of other kinds of DOMlets

  • support DTD fragments, and the rest of the XML standard

Imported modules   
from __future__ import generators
from environ import traverseItem, traverseDefault
from errors import NotFound
from interfaces import *
from peak.api import *
from peak.util import SOX, imports
from places import Decorator
from publish import TraversalPath
from xml.sax.saxutils import quoteattr, escape
Functions   
URLTag
finishElement
infiniter
negotiateDefine
negotiateDomlet
negotiatorFactory
nodeIs
setupDocument
setupElement
startElement
withParam
  URLTag 
URLTag (
        parentComponent,
        componentName=None,
        domletProperty=None,
        **kw,
        )

Create a URLText or URLAttribute DOMlet based on parameters

  finishElement 
finishElement ( parser,  data )

  infiniter 
infiniter ( sequence )

  negotiateDefine 
negotiateDefine (
        parser,
        data,
        name,
        value,
        )

  negotiateDomlet 
negotiateDomlet (
        parser,
        data,
        name,
        value,
        )

  negotiatorFactory 
negotiatorFactory ( domletFactory )

  nodeIs 
nodeIs (
        mode,
        parser,
        data,
        name,
        value,
        )

  setupDocument 
setupDocument ( parser,  data )

  setupElement 
setupElement ( parser,  data )

  startElement 
startElement ( parser,  data )

  withParam 
withParam (
        parser,
        data,
        name,
        value,
        )

Classes   

ContentReplacer

Abstract base for elements that replace their contents

DOMletMethod

Bind an IDOMletRenderable to a specific context

DOMletState

Execution state for a DOMlet

DOMletVars

Element

Expects

Render child elements with target data, or skip element altogether

List

Literal

Simple static text node

Parameters

params' object for templates

Replace

ReplaceXML

TaglessElement

Element w/out tags

TaglessList

TaglessText

Text w/out open/close tag

TaglessURLText

TaglessXML

XML w/out open/close tag

TemplateDocument

Document-level template element

Text

Replace element contents w/data (XML-quoted)

URLAttribute

Put the URL in an attribute

URLText

Write absolute URL as body text

Unless

Skip child elements if target data is available

Uses

Render child elements with target data, or skip element altogether

XML

Replace element contents w/data (XML structure)


Table of Contents

This document was automatically generated on Mon Sep 16 01:11:12 2019 by HappyDoc version 2.1