From 61bdbd49fa2abd3b4e6024312d6863dd7881e4b6 Mon Sep 17 00:00:00 2001 From: Borgen Date: Wed, 17 Apr 2024 22:19:55 +0300 Subject: [PATCH] Rename hr->Hr add alias HorizontalRule, add changelog entry (#5) --- CHANGELOG.md | 5 +++++ hypermedia/__init__.py | 6 ++++-- hypermedia/basic.py | 8 ++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5131ee6..cdcd08b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,11 @@ * Using single quotes for attributes lets us support `hx-vals`, since it expects a doubled quoted json string. + +### Fix + +* Rename `hr`->`Hr`, add alias `HorizontalRule` and export both in `__init__.py` + ## Version 1.0.0 Hypermedia released Hypermedia is an opinionated way to work with HTML in python and FastAPI. Hypermedia is designed to work with htmx. diff --git a/hypermedia/__init__.py b/hypermedia/__init__.py index 7b3caf4..c1337cf 100644 --- a/hypermedia/__init__.py +++ b/hypermedia/__init__.py @@ -18,11 +18,12 @@ Header4, Header5, Header6, + HorizontalRule, + Hr, Html, P, Paragraph, Title, - hr, ) from hypermedia.formatting import ( Abbr, @@ -200,7 +201,8 @@ "Paragraph", "Br", "Break", - "hr", + "Hr", + "HorizontalRule", "Comment", # formatting "Abbr", diff --git a/hypermedia/basic.py b/hypermedia/basic.py index 826bfa4..b6660e8 100644 --- a/hypermedia/basic.py +++ b/hypermedia/basic.py @@ -114,15 +114,19 @@ class Br(VoidElement): class Break(Br): - """Alias for br tag..""" + """Alias for br tag.""" -class hr(VoidElement): +class Hr(VoidElement): """Defines a thematic change in the content.""" tag: str = "hr" +class HorizontalRule(Hr): + """Alias for hr tag.""" + + class Comment(BaseElement): """Defines a comment."""