mirror of
https://github.com/django-components/django-components.git
synced 2025-08-08 16:27:59 +00:00
chore: init docs
This commit is contained in:
parent
899b9a2738
commit
163b0941c2
49 changed files with 1447 additions and 9 deletions
|
@ -1,4 +1,6 @@
|
|||
# flake8: noqa F401
|
||||
"""Main package for Django Components."""
|
||||
|
||||
import django
|
||||
|
||||
# Public API
|
||||
|
|
|
@ -195,10 +195,10 @@ def fill(parser: Parser, token: Token) -> FillNode:
|
|||
def component(parser: Parser, token: Token, tag_name: str) -> ComponentNode:
|
||||
"""
|
||||
To give the component access to the template context:
|
||||
{% component "name" positional_arg keyword_arg=value ... %}
|
||||
```#!htmldjango {% component "name" positional_arg keyword_arg=value ... %}```
|
||||
|
||||
To render the component in an isolated context:
|
||||
{% component "name" positional_arg keyword_arg=value ... only %}
|
||||
```#!htmldjango {% component "name" positional_arg keyword_arg=value ... only %}```
|
||||
|
||||
Positional and keyword arguments can be literals or template variables.
|
||||
The component name must be a single- or double-quotes string and must
|
||||
|
@ -306,7 +306,7 @@ def html_attrs(parser: Parser, token: Token) -> HtmlAttrsNode:
|
|||
will result in `class="my-class extra-class".
|
||||
|
||||
Example:
|
||||
```django
|
||||
```htmldjango
|
||||
{% html_attrs attrs defaults:class="default-class" class="extra-class" data-id="123" %}
|
||||
```
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue