Class DefinitionTerm
source code
object --+
|
WikiElement --+
|
BlockElement --+
|
DefinitionTerm
Processes definition terms.
>>> term = DefinitionTerm('dt',';',[],stop_token=':')
>>> mo1,mo2 = term.regexp.finditer(";term1\n:def1\n;term2:def2\n")
>>> mo1.group(1), mo2.group(1)
('term1', 'term2')
>>> mo1.group(0), mo2.group(0)
(';term1\n', ';term2')
group(1) of the match object is the term line or up to the first ':'
|
|
__init__(self,
tag,
token,
child_tags,
stop_token)
Constructor for WikiElement objects. |
source code
|
|
|
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__,
__str__
|
|
|
|
|
|
_build(self,
mo,
element_store)
Returns a genshi Element that has self.tag as the
outermost tag. |
source code
|
|
|
|
_process(self,
mo,
text,
wiki_elements,
element_store)
Returns genshi Fragments (Elements and text) |
source code
|
|
|
|
append_newline = True
Determines if newlines are appended to Element(s) during processing.
|
|
Inherited from object:
__class__
|
__init__(self,
tag,
token,
child_tags,
stop_token)
(Constructor)
| source code
|
Constructor for WikiElement objects.
Subclasses may have other keyword arguments.
- Parameters:
tag - The xhtml tag associated with the element.
token - The character string (or strings) that identifies the element
in wiki markup.
child_tags - A list of wiki_elements that will be searched for in the body of the
element. The order of these elements matters, because if an element is
found before the element that encloses it, the enclosing element will
never be found. In cases where this imposes limits (e.g, strong and
em should be allowed to nest each other), place the conflicting
elements in a sublist. The parser will then find which comes first.
- Overrides:
object.__init__
- (inherited documentation)
|
|
The regular expression pattern that is compiled into self.regexp.
The regular expression must consume the entire wiki element,
including the tokens. For block elements, the newline on the last
line must be consumed also. group(1) should normally be the
entire string inside the tokens. If not, a custom _build
method will be needed.
- Overrides:
WikiElement.re_string
- (inherited documentation)
|