extras Package

extras Package

This package contains objects used by Nodes, but are not nodes themselves. This includes the parameters of Templates or the attributes of HTML tags.

attribute Module

class mwparserfromhell.nodes.extras.attribute.Attribute(name, value=None, quoted=True)[source]

Bases: mwparserfromhell.string_mixin.StringMixIn

Represents an attribute of an HTML tag.

This is used by Tag objects. For example, the tag <ref name="foo"> contains an Attribute whose name is "name" and whose value is "foo".

name[source]

The name of the attribute as a Wikicode object.

quoted[source]

Whether the attribute’s value is quoted with double quotes.

value[source]

The value of the attribute as a Wikicode object.

parameter Module

class mwparserfromhell.nodes.extras.parameter.Parameter(name, value, showkey=True)[source]

Bases: mwparserfromhell.string_mixin.StringMixIn

Represents a paramater of a template.

For example, the template {{foo|bar|spam=eggs}} contains two Parameters: one whose name is "1", value is "bar", and showkey is False, and one whose name is "spam", value is "eggs", and showkey is True.

name[source]

The name of the parameter as a Wikicode object.

showkey[source]

Whether to show the parameter’s key (i.e., its “name”).

value[source]

The value of the parameter as a Wikicode object.

Table Of Contents

Previous topic

nodes Package

Next topic

parser Package

This Page