Skip to content

htmy.html

a = Tag('a', child_separator=None) module-attribute

<a> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a.

abbr = Tag('abbr', child_separator=None) module-attribute

<abbr> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr.

address = Tag('address') module-attribute

<address> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/address.

area = TagWithProps('area') module-attribute

<area> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/area.

article = Tag('article') module-attribute

<article> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article.

aside = Tag('aside') module-attribute

<aside> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/aside.

audio = Tag('audio') module-attribute

<audio> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio.

b = Tag('b', child_separator=None) module-attribute

<b> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b.

base = TagWithProps('base') module-attribute

<base> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base.

bdi = Tag('bdi', child_separator=None) module-attribute

<bdi> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi.

bdo = Tag('bdo', child_separator=None) module-attribute

<bdo> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdo.

blockquote = Tag('blockquote') module-attribute

<blockquote> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote.

body = Tag('body') module-attribute

<body> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body.

br = TagWithProps('br') module-attribute

<br> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br.

button = Tag('button') module-attribute

<button> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button.

canvas = Tag('canvas') module-attribute

<canvas> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas.

caption = Tag('caption') module-attribute

<caption> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption.

cite = Tag('cite', child_separator=None) module-attribute

<cite> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/cite.

code = Tag('code', child_separator=None) module-attribute

<code> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code.

col = TagWithProps('col') module-attribute

<col> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col.

colgroup = Tag('colgroup') module-attribute

<colgroup> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup.

data = Tag('data', child_separator=None) module-attribute

<data> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/data.

datalist = Tag('datalist') module-attribute

<datalist> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist.

dd = Tag('dd') module-attribute

<dd> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dd.

del_ = Tag('del', child_separator=None) module-attribute

<del> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/del.

details = Tag('details') module-attribute

<details> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details.

dfn = Tag('dfn', child_separator=None) module-attribute

<dfn> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dfn.

dialog = Tag('dialog') module-attribute

<dialog> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog.

div = Tag('div') module-attribute

<div> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div.

dl = Tag('dl') module-attribute

<dl> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl.

dt = Tag('dt', child_separator=None) module-attribute

<dt> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt.

em = Tag('em', child_separator=None) module-attribute

<em> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em.

embed = TagWithProps('embed') module-attribute

<embed> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/embed.

fieldset = Tag('fieldset') module-attribute

<fieldset> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset.

figcaption = Tag('figcaption') module-attribute

<figcaption> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption.

figure = Tag('figure') module-attribute

<figure> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure.

footer = Tag('footer') module-attribute

<footer> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer.

form = Tag('form') module-attribute

<form> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form.

h1 = Tag('h1', child_separator=None) module-attribute

<h1> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h1.

h2 = Tag('h2', child_separator=None) module-attribute

<h2> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h2.

h3 = Tag('h3', child_separator=None) module-attribute

<h3> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h3.

h4 = Tag('h4', child_separator=None) module-attribute

<h4> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h4.

h5 = Tag('h5', child_separator=None) module-attribute

<h5> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h5.

h6 = Tag('h6', child_separator=None) module-attribute

<h6> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h6.

head = Tag('head') module-attribute

<head> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head.

header = Tag('header') module-attribute

<header> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header.

hgroup = Tag('hgroup') module-attribute

<hgroup> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hgroup.

hr = TagWithProps('hr') module-attribute

<hr> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr.

html = Tag('html') module-attribute

<html> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html.

i = Tag('i', child_separator=None) module-attribute

<i> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i.

iframe = Tag('iframe') module-attribute

<iframe> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe.

img = TagWithProps('img') module-attribute

<img> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img.

input_ = TagWithProps('input') module-attribute

<input> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input.

ins = Tag('ins', child_separator=None) module-attribute

<ins> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ins.

kbd = Tag('kbd', child_separator=None) module-attribute

<kbd> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd.

label = Tag('label') module-attribute

<label> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label.

legend = Tag('legend') module-attribute

<legend> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/legend.

li = Tag('li', child_separator=None) module-attribute

<li> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li.

<link> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link.

main = Tag('main') module-attribute

<main> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main.

map = Tag('map') module-attribute

<map> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map.

mark = Tag('mark', child_separator=None) module-attribute

<mark> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark.

menu = Tag('menu') module-attribute

<menu> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menu.

meta = TagWithProps('meta') module-attribute

<meta> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta.

meter = Tag('meter') module-attribute

<meter> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meter.

nav = Tag('nav') module-attribute

<nav> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav.

noscript = Tag('noscript') module-attribute

<noscript> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript.

object = Tag('object') module-attribute

<object> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object.

ol = Tag('ol') module-attribute

<ol> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol.

optgroup = Tag('optgroup') module-attribute

<optgroup> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup.

option = Tag('option') module-attribute

<option> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option.

output = Tag('output') module-attribute

<output> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/output.

p = Tag('p', child_separator=None) module-attribute

<p> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p.

picture = Tag('picture') module-attribute

<picture> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture.

pre = Tag('pre', child_separator=None) module-attribute

<pre> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre.

progress = Tag('progress') module-attribute

<progress> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress.

q = Tag('q', child_separator=None) module-attribute

<q> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/q.

s = Tag('s', child_separator=None) module-attribute

<s> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s.

samp = Tag('samp', child_separator=None) module-attribute

<samp> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/samp.

script = Tag('script') module-attribute

<script> element.

The script tag should have only one child, the script content. If it's not empty, it should be a SafeStr for HTML and plain str for XHTML.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script.

search = Tag('search') module-attribute

<search> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/search.

section = Tag('section') module-attribute

<section> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/section.

select = Tag('select') module-attribute

<select> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select.

slot = Tag('slot') module-attribute

<slot> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot.

small = Tag('small', child_separator=None) module-attribute

<small> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/small.

source = TagWithProps('source') module-attribute

<source> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source.

span = Tag('span', child_separator=None) module-attribute

<span> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span.

strong = Tag('strong', child_separator=None) module-attribute

<strong> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong.

style = Tag('style') module-attribute

<style> element.

The style tag should have only one child, the style content. If it's not empty, it should be a SafeStr to avoid XML escaping.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style.

sub = Tag('sub', child_separator=None) module-attribute

<sub> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub.

summary = Tag('summary', child_separator=None) module-attribute

<summary> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary.

sup = Tag('sup', child_separator=None) module-attribute

<sup> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup.

svg = Tag('svg', child_separator=None) module-attribute

<svg> element.

See https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg.

table = Tag('table') module-attribute

<table> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table.

tbody = Tag('tbody') module-attribute

<tbody> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody.

td = Tag('td', child_separator=None) module-attribute

<td> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td.

template = Tag('template') module-attribute

<template> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template.

textarea = Tag('textarea') module-attribute

<textarea> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea.

tfoot = Tag('tfoot') module-attribute

<tfoot> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tfoot.

th = Tag('th', child_separator=None) module-attribute

<th> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th.

thead = Tag('thead') module-attribute

<thead> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/thead.

time = Tag('time', child_separator=None) module-attribute

<time> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time.

title = Tag('title', child_separator=None) module-attribute

<title> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title.

tr = Tag('tr') module-attribute

<tr> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr.

track = TagWithProps('track') module-attribute

<track> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track.

u = Tag('u', child_separator=None) module-attribute

<u> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/u.

ul = Tag('ul') module-attribute

<ul> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul.

var = Tag('var', child_separator=None) module-attribute

<var> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/var.

video = Tag('video') module-attribute

<video> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video.

wbr = TagWithProps('wbr') module-attribute

<wbr> element.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr.

DOCTYPE

Document type declaration.

Source code in htmy/html.py
class DOCTYPE:
    """Document type declaration."""

    html = SafeStr("<!DOCTYPE html>")
    """HTML document type."""

html = SafeStr('<!DOCTYPE html>') class-attribute instance-attribute

HTML document type.

link tag factories.

Source code in htmy/html.py
class Link:
    """`link` tag factories."""

    @staticmethod
    def css(href: str) -> ComponentType:
        return link(rel="stylesheet", type="text/css", href=href)

Meta

meta tag factories.

Source code in htmy/html.py
class Meta:
    """`meta` tag factories."""

    @staticmethod
    def author(content: str) -> ComponentType:
        return meta(name="author", content=content)

    @staticmethod
    def charset(charset: str = "utf-8") -> ComponentType:
        return meta(charset=charset)

    @staticmethod
    def description(content: str) -> ComponentType:
        return meta(name="description", content=content)

    @staticmethod
    def keywords(content: str) -> ComponentType:
        return meta(name="keywords", content=content)

    @staticmethod
    def viewport(content: str = "width=device-width, initial-scale=1.0") -> ComponentType:
        return meta(name="viewport", content=content)