Name

SPVM::Eg - HTML

Description

The Eg class in SPVM has methods to manipulate HTML.

Usage

use Eg;

# <div>foo</div>
{
  my $div = Eg->div(
    [Eg->div, Eg->text("foo")],
    {class => "foo bar", id => "foo", style => "color:red"}
  );
}

# <ul><li>1</li><li>2</li><li>3</li></ul>
{
  my $ul = Eg->ul(
    [
      Eg->li([Eg->text("1")]),
      Eg->li([Eg->text("2")]),
      Eg->li([Eg->text("3")]),
    ],
    {class => "foo bar", id => "foo", style => "color:red"}
  );
}

# <table><tr><td>1-1</td><td>1-2</td></tr><tr><td>2-1</td><td>2-2</td></tr></table>
{
  my $table = Eg->table(
    [
      Eg->tr([
        Eg->td([Eg->text("1-1")]), Eg->td([Eg->text("1-2")])
      ]),
      Eg->tr([
        Eg->td([Eg->text("2-1")]), Eg->td([Eg->text("2-2")])
      ]),
    ],
    {class => "foo bar", id => "foo", style => "color:red"}
  );
}

Class Methods

tag

static method tag : Eg::Node ($tag_name : string, $nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a tag given the name $tag_name, the child nodes $nodes and the attributes $attributes, and returns it.

a

static method a : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new a tag given the child nodes $nodes and the attributes $attributes, and returns it.

abbr

static method abbr : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new abbr tag given the child nodes $nodes and the attributes $attributes, and returns it.

address

static method address : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new address tag given the child nodes $nodes and the attributes $attributes, and returns it.

area

static method area : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new area tag given the child nodes $nodes and the attributes $attributes, and returns it.

article

static method article : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new article tag given the child nodes $nodes and the attributes $attributes, and returns it.

aside

static method aside : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new aside tag given the child nodes $nodes and the attributes $attributes, and returns it.

audio

static method audio : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new audio tag given the child nodes $nodes and the attributes $attributes, and returns it.

b

static method : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new b tag given the child nodes $nodes and the attributes $attributes, and returns it.

base

static method base : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new base tag given the child nodes $nodes and the attributes $attributes, and returns it.

bdi

static method bdi : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new bdi tag given the child nodes $nodes and the attributes $attributes, and returns it.

bdo

static method bdo : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new bdo tag given the child nodes $nodes and the attributes $attributes, and returns it.

blockquote

static method blockquote : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new blockquote tag given the child nodes $nodes and the attributes $attributes, and returns it.

body

static method body : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new body tag given the child nodes $nodes and the attributes $attributes, and returns it.

br

static method br : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new br tag given the child nodes $nodes and the attributes $attributes, and returns it.

button

static method button : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new tag given the child nodes $nodes and the attributes $attributes, and returns it.

canvas

static method canvas : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new canvas tag given the child nodes $nodes and the attributes $attributes, and returns it.

caption

static method caption : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new caption tag given the child nodes $nodes and the attributes $attributes, and returns it.

cite

static method cite : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new cite tag given the child nodes $nodes and the attributes $attributes, and returns it.

code

static method code : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new code tag given the child nodes $nodes and the attributes $attributes, and returns it.

col

static method col : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new col tag given the child nodes $nodes and the attributes $attributes, and returns it.

colgroup

static method colgroup : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new colgroup tag given the child nodes $nodes and the attributes $attributes, and returns it.

command

static method command : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new command tag given the child nodes $nodes and the attributes $attributes, and returns it.

datalist

static method datalist : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new datalist tag given the child nodes $nodes and the attributes $attributes, and returns it.

dd

static method dd : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new dd tag given the child nodes $nodes and the attributes $attributes, and returns it.

del

static method del : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new del tag given the child nodes $nodes and the attributes $attributes, and returns it.

details

static method details : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new details tag given the child nodes $nodes and the attributes $attributes, and returns it.

dfn

static method dfn : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new dfn tag given the child nodes $nodes and the attributes $attributes, and returns it.

dialog

static method dialog : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new dialog tag given the child nodes $nodes and the attributes $attributes, and returns it.

dir

static method dir : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new dir tag given the child nodes $nodes and the attributes $attributes, and returns it.

div

static method div : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new div tag given the child nodes $nodes and the attributes $attributes, and returns it.

dl

static method dl : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new dl tag given the child nodes $nodes and the attributes $attributes, and returns it.

dt

static method dt : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new dt tag given the child nodes $nodes and the attributes $attributes, and returns it.

em

static method em : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new em tag given the child nodes $nodes and the attributes $attributes, and returns it.

embed

static method embed : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new embed tag given the child nodes $nodes and the attributes $attributes, and returns it.

fieldset

static method fieldset : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new fieldset tag given the child nodes $nodes and the attributes $attributes, and returns it.

figcaption

static method figcaption : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new figcaption tag given the child nodes $nodes and the attributes $attributes, and returns it.

figure

static method figure : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new figure tag given the child nodes $nodes and the attributes $attributes, and returns it.

font

static method font : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new font tag given the child nodes $nodes and the attributes $attributes, and returns it.

static method footer : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new footer tag given the child nodes $nodes and the attributes $attributes, and returns it.

form

static method form : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new form tag given the child nodes $nodes and the attributes $attributes, and returns it.

frame

static method frame : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new frame tag given the child nodes $nodes and the attributes $attributes, and returns it.

frameset

static method frameset : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new frameset tag given the child nodes $nodes and the attributes $attributes, and returns it.

h1

static method h1 : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new h1 tag given the child nodes $nodes and the attributes $attributes, and returns it.

h2

static method h2 : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new h2 tag given the child nodes $nodes and the attributes $attributes, and returns it.

h3

static method h3 : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new h3 tag given the child nodes $nodes and the attributes $attributes, and returns it.

h4

static method h4 : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new h4 tag given the child nodes $nodes and the attributes $attributes, and returns it.

h5

static method h5 : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new h5 tag given the child nodes $nodes and the attributes $attributes, and returns it.

h6

static method h6 : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new h6 tag given the child nodes $nodes and the attributes $attributes, and returns it.

static method head : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new head tag given the child nodes $nodes and the attributes $attributes, and returns it.

static method header : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new header tag given the child nodes $nodes and the attributes $attributes, and returns it.

hgroup

static method hgroup : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new hgroup tag given the child nodes $nodes and the attributes $attributes, and returns it.

hr

static method hr : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new hr tag given the child nodes $nodes and the attributes $attributes, and returns it.

static method html : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new tag given the child nodes $nodes and the attributes $attributes, and returns it.

i

static method i : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new i tag given the child nodes $nodes and the attributes $attributes, and returns it.

iframe

static method iframe : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new iframe tag given the child nodes $nodes and the attributes $attributes, and returns it.

img

static method img : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new img tag given the child nodes $nodes and the attributes $attributes, and returns it.

input

static method input : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new input tag given the child nodes $nodes and the attributes $attributes, and returns it.

ins

static method ins : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new ins tag given the child nodes $nodes and the attributes $attributes, and returns it.

kbd

static method kbd : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new kbd tag given the child nodes $nodes and the attributes $attributes, and returns it.

label

static method label : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new label tag given the child nodes $nodes and the attributes $attributes, and returns it.

legend

static method legend : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new legend tag given the child nodes $nodes and the attributes $attributes, and returns it.

li

static method li : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new li tag given the child nodes $nodes and the attributes $attributes, and returns it.

static method link : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new link tag given the child nodes $nodes and the attributes $attributes, and returns it.

listing

static method listing : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new listing tag given the child nodes $nodes and the attributes $attributes, and returns it.

main

static method main : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new main tag given the child nodes $nodes and the attributes $attributes, and returns it.

static method map : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new tag given the child nodes $nodes and the attributes $attributes, and returns it.

mark

static method mark : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new mark tag given the child nodes $nodes and the attributes $attributes, and returns it.

static method menu : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new menu tag given the child nodes $nodes and the attributes $attributes, and returns it.

meta

static method meta : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new meta tag given the child nodes $nodes and the attributes $attributes, and returns it.

meter

static method meter : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new meter tag given the child nodes $nodes and the attributes $attributes, and returns it.

static method nav : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new nav tag given the child nodes $nodes and the attributes $attributes, and returns it.

noscript

static method noscript : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new noscript tag given the child nodes $nodes and the attributes $attributes, and returns it.

object

static method object : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new object tag given the child nodes $nodes and the attributes $attributes, and returns it.

ol

static method ol : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new ol tag given the child nodes $nodes and the attributes $attributes, and returns it.

optgroup

static method optgroup : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new optgroup tag given the child nodes $nodes and the attributes $attributes, and returns it.

option

static method option : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new option tag given the child nodes $nodes and the attributes $attributes, and returns it.

output

static method output : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new output tag given the child nodes $nodes and the attributes $attributes, and returns it.

p

static method p : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new p tag given the child nodes $nodes and the attributes $attributes, and returns it.

param

static method param : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new param tag given the child nodes $nodes and the attributes $attributes, and returns it.

pre

static method pre : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new pre tag given the child nodes $nodes and the attributes $attributes, and returns it.

progress

static method progress : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new progress tag given the child nodes $nodes and the attributes $attributes, and returns it.

q

static method q : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new q tag given the child nodes $nodes and the attributes $attributes, and returns it.

ruby

static method ruby : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new ruby tag given the child nodes $nodes and the attributes $attributes, and returns it.

rp

static method rp : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new rp tag given the child nodes $nodes and the attributes $attributes, and returns it.

rt

static method rt : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new rt tag given the child nodes $nodes and the attributes $attributes, and returns it.

s

static method s : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new s tag given the child nodes $nodes and the attributes $attributes, and returns it.

samp

static method samp : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new samp tag given the child nodes $nodes and the attributes $attributes, and returns it.

script

static method script : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new script tag given the child nodes $nodes and the attributes $attributes, and returns it.

static method section : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new tag given the child nodes $nodes and the attributes $attributes, and returns it.

select

static method select : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new select tag given the child nodes $nodes and the attributes $attributes, and returns it.

small

static method small : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new small tag given the child nodes $nodes and the attributes $attributes, and returns it.

source

static method source : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new source tag given the child nodes $nodes and the attributes $attributes, and returns it.

span

static method span : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new span tag given the child nodes $nodes and the attributes $attributes, and returns it.

strong

static method strong : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new strong tag given the child nodes $nodes and the attributes $attributes, and returns it.

style

static method style : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new style tag given the child nodes $nodes and the attributes $attributes, and returns it.

sub

static method sub : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new sub tag given the child nodes $nodes and the attributes $attributes, and returns it.

summary

static method summary : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new summary tag given the child nodes $nodes and the attributes $attributes, and returns it.

sup

static method sup : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new sup tag given the child nodes $nodes and the attributes $attributes, and returns it.

table

static method table : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new table tag given the child nodes $nodes and the attributes $attributes, and returns it.

tbody

static method tbody : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new tbody tag given the child nodes $nodes and the attributes $attributes, and returns it.

td

static method td : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new td tag given the child nodes $nodes and the attributes $attributes, and returns it.

textarea

static method textarea : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new textarea tag given the child nodes $nodes and the attributes $attributes, and returns it.

tfoot

static method tfoot : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new tfoot tag given the child nodes $nodes and the attributes $attributes, and returns it.

th

static method th : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new th tag given the child nodes $nodes and the attributes $attributes, and returns it.

thead

static method thead : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new thead tag given the child nodes $nodes and the attributes $attributes, and returns it.

time

static method time : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new time tag given the child nodes $nodes and the attributes $attributes, and returns it.

title

static method title : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new title tag given the child nodes $nodes and the attributes $attributes, and returns it.

tr

static method tr : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new tr tag given the child nodes $nodes and the attributes $attributes, and returns it.

tt

static method tt : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new tt tag given the child nodes $nodes and the attributes $attributes, and returns it.

u

static method u : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new u tag given the child nodes $nodes and the attributes $attributes, and returns it.

ul

static method ul : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new ul tag given the child nodes $nodes and the attributes $attributes, and returns it.

var

static method var : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new var tag given the child nodes $nodes and the attributes $attributes, and returns it.

video

static method video : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new video tag given the child nodes $nodes and the attributes $attributes, and returns it.

wbr

static method wbr : Eg::Node ($nodes : Eg::Node[] = undef, $attributes : object[] = undef);

Creates a new wbrt tag given the child nodes $nodes and the attributes $attributes, and returns it.

text

static method text : Eg::Node ($text : string);

Creates a new text node and returns it.

Repository

SPVM::Eg - Github

Author

Yuki Kimoto kimoto.yuki@gmail.com

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License