6.1 albatross.template -- Base classes for implementing tags
Description: albatross.template -- Base classes for implementing tags
Keywords: albatross

# 6.1 `albatross.template` -- Base classes for implementing tags

The module contains the following classes which are intended to be used in implementing custom tags.

class `Tag`( | ctx, filename, line_num, attribs)

  This is the base class upon which all tags are implemented. You are unlikely to ever subclass this directly. The `EmptyTag` and `EnclosingTag` classes inherit from this class.

class `EmptyTag`( | ctx, filename, line_num, attribs)

  Use this class as a subclass for all tags which do not require a closing tag and therefore do not enclose content. Examples of standard HTML tags which do not enclose content are `<BR>` and `<HR>`.

class `EnclosingTag`( | ctx, filename, line_num, attribs)

  Use this class as a subclass for all tags which enclose content. Examples of standard HTML tags which enclose content are `<BODY>` and `<TABLE>`.

class `Text`( | text)

  A simple wrapper around the string passed in the text constructor argument which passes that string to the `to_html()` method when the object is converted to HTML.

class `Content`( | )

  A simple wrapper around a list which calls the `to_html()` method of all list elements when the object is converted to HTML.

Subsections

- 6.1.1 Tag Objects
- 6.1.2 EmptyTag Objects
- 6.1.3 EnclosingTag Objects
- 6.1.4 Text Objects
- 6.1.5 Content Objects