-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
76 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
# 1. Welcome additions | ||
|
||
Anything that is part of the official HTML spec is likely welcome. | ||
|
||
Common patterns of web development, or ease-of-use features are welcome, so long as they are general and are likely to be useful to a broad group and not targetting any specific implimentation. | ||
|
||
## 1.1. Testing | ||
|
||
All PRs must have 100% test coverage of new code. | ||
|
||
New features should include example usage, including motivations. | ||
|
||
|
||
|
||
# 2. Not interested | ||
|
||
For exceptions to these, see #Community | ||
|
||
## 2.2. No 3rd party dependencies | ||
|
||
Do not add 3rd party dependencies. | ||
|
||
## 2.3. No 3rd party integrations | ||
|
||
I am not interested in maintaining integrations with a bunch of random JS/web frameworks/libraries. (i.e. HTMX, Flask, Unpoly, whatever) | ||
|
||
|
||
# 3. Community Packages | ||
|
||
If you wish to add a feature that would otherwise be disallowed by the above, you can make a community package. See `community/htmx.py` for a trivial example. | ||
|
||
Community packages must not be referenced from the main library, and must not do anything unless explicitly imported. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '2.9.1' | ||
__version__ = '3.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
from .. import tags | ||
|
||
class HtmxTag: | ||
@classmethod | ||
def clean_attribute(cls, attribute): | ||
attribute = super().clean_attribute(attribute) | ||
if attribute.startswith('hx_'): | ||
attribute = attribute.replace('_', '-') | ||
return attribute | ||
|
||
tags.html_tag.__bases__ = (HtmxTag,) + tags.html_tag.__bases__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
from dominate import tags | ||
import dominate.community.htmx | ||
|
||
def test_hx(): | ||
d = tags.div(hx_foo=1) | ||
assert d.render() == '<div hx-foo="1"></div>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from dominate import document | ||
from dominate.tags import * | ||
|
||
|
||
def test_doc(): | ||
d = document() | ||
assert d.render() == \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
def test_version(): | ||
import dominate | ||
version = '2.9.1' | ||
version = '3.0.0' | ||
assert dominate.version == version | ||
assert dominate.__version__ == version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,6 @@ | |
from dominate.tags import * | ||
from dominate.svg import * | ||
|
||
import pytest | ||
|
||
|
||
def base(): | ||
return svg( | ||
|