Skip to content

Add integration with dj-angles for custom HTML-like tags #15

@joshuadavidthomas

Description

@joshuadavidthomas

Okay, I've decided to go ahead with what I talked about downthread and abandon the idea of doing the custom HTML elements in this library in favor of leveraging dj-angles.

  • Add a angles extra to the package, for installing dj-angles alongside the library

  • Add some common tag prefixes, either to the library in the form of string literal constants or in the docs.

    Given dj-angles flexibility around how the tags are defined, we could even accomplish my original goal of copying Flux's syntax of <bird:button> (presumably, pending actual testing)

  • Update docs to point to dj-angles

  • Update roadmap to reflect this change

Previously:

I really like the approach of django-cotton and dj-angles, where they take what looks like a custom HTML element and do some compilation in a template loader and swap the custom elements out for plain ole django templatetags.

I also prefer Flux's approach of namespacing the element with the library name and a colon, as opposed to the approach taken by the other two libraries where it looks like it could be a custom Web Component:

<!-- dj-angles -->
<dj-block 'content'>
</dj-block 'content'>

<!-- django-cotton -->
<c-button>
    Button
</c-product>

<!-- flux -->
<flux:button>
	Button
</flux:button>

This could just be a personal preference thing, but the first two throw me off and make me think they are custom Web Components, where the bottom I know can't be because of the colon.

In the end, it should be no harder to parse and compile with the colon vs with the dash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions