mirror of
https://github.com/django-components/django-components.git
synced 2025-08-15 19:50:13 +00:00
Deployed f908197
to dev with MkDocs 1.6.1 and mike 2.1.3
This commit is contained in:
parent
077ce32fe0
commit
15512f9355
68 changed files with 546 additions and 392 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
dev/assets/images/social/concepts/advanced/template_tags.png
Normal file
BIN
dev/assets/images/social/concepts/advanced/template_tags.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 43 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
91
dev/concepts/advanced/template_tags/index.html
Normal file
91
dev/concepts/advanced/template_tags/index.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
dev/objects.inv
BIN
dev/objects.inv
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -49,8 +49,8 @@ from django.urls import URLPattern, URLResolver
|
|||
|
||||
from django_components import ComponentVars, TagFormatterABC
|
||||
from django_components.component import Component
|
||||
from django_components.node import BaseNode
|
||||
from django_components.util.misc import get_import_path
|
||||
from django_components.util.template_tag import TagSpec
|
||||
|
||||
# NOTE: This file is an entrypoint for the `gen-files` plugin in `mkdocs.yml`.
|
||||
# However, `gen-files` plugin runs this file as a script, NOT as a module.
|
||||
|
@ -504,17 +504,18 @@ def gen_reference_templatetags():
|
|||
f"Import as\n```django\n{{% load {mod_name} %}}\n```\n\n"
|
||||
)
|
||||
|
||||
for name, obj in inspect.getmembers(tags_module):
|
||||
for _, obj in inspect.getmembers(tags_module):
|
||||
if not _is_template_tag(obj):
|
||||
continue
|
||||
|
||||
tag_spec: TagSpec = obj._tag_spec
|
||||
tag_signature = _format_tag_signature(tag_spec)
|
||||
obj_lineno = inspect.findsource(obj)[1]
|
||||
node_cls: BaseNode = obj
|
||||
name = node_cls.tag
|
||||
tag_signature = _format_tag_signature(node_cls)
|
||||
obj_lineno = inspect.findsource(node_cls)[1]
|
||||
source_code_link = _format_source_code_html(module_rel_path, obj_lineno)
|
||||
|
||||
# Use the tag's function's docstring
|
||||
docstring = dedent(obj.__doc__ or "").strip()
|
||||
docstring = dedent(node_cls.__doc__ or "").strip()
|
||||
|
||||
# Rebuild (almost) the same documentation than as if we used
|
||||
# mkdocstrings' `::: path.to.module` syntax.
|
||||
|
@ -585,29 +586,29 @@ def _list_urls(urlpatterns: Sequence[Union[URLPattern, URLResolver]], prefix="")
|
|||
return urls
|
||||
|
||||
|
||||
def _format_tag_signature(tag_spec: TagSpec) -> str:
|
||||
def _format_tag_signature(node_cls: BaseNode) -> str:
|
||||
"""
|
||||
Given the TagSpec instance, format the tag's function signature like:
|
||||
Given the Node class, format the tag's function signature like:
|
||||
```django
|
||||
{% component [arg, ...] **kwargs [only] %}
|
||||
{% component arg1: int, arg2: str, *args, **kwargs: Any [only] %}
|
||||
{% endcomponent %}
|
||||
```
|
||||
"""
|
||||
# The signature returns a string like:
|
||||
# `(arg: Any, **kwargs: Any) -> None`
|
||||
params_str = str(tag_spec.signature)
|
||||
params_str = str(node_cls._signature)
|
||||
# Remove the return type annotation, the `-> None` part
|
||||
params_str = params_str.rsplit("->", 1)[0]
|
||||
# Remove brackets around the params, to end up only with `arg: Any, **kwargs: Any`
|
||||
params_str = params_str.strip()[1:-1]
|
||||
|
||||
if tag_spec.flags:
|
||||
params_str += " " + " ".join([f"[{name}]" for name in tag_spec.flags])
|
||||
if node_cls.allowed_flags:
|
||||
params_str += " " + " ".join([f"[{name}]" for name in node_cls.allowed_flags])
|
||||
|
||||
# Create the function signature
|
||||
full_tag = "{% " + tag_spec.tag + " " + params_str + " %}"
|
||||
if tag_spec.end_tag:
|
||||
full_tag += f"\n{{% {tag_spec.end_tag} %}}"
|
||||
full_tag = "{% " + node_cls.tag + " " + params_str + " %}"
|
||||
if node_cls.end_tag:
|
||||
full_tag += f"\n{{% {node_cls.end_tag} %}}"
|
||||
|
||||
return full_tag
|
||||
|
||||
|
@ -722,7 +723,7 @@ def _is_tag_formatter_instance(obj: Any) -> bool:
|
|||
|
||||
|
||||
def _is_template_tag(obj: Any) -> bool:
|
||||
return callable(obj) and hasattr(obj, "_tag_spec")
|
||||
return inspect.isclass(obj) and issubclass(obj, BaseNode)
|
||||
|
||||
|
||||
def gen_reference():
|
||||
|
|
File diff suppressed because one or more lines are too long
110
dev/sitemap.xml
110
dev/sitemap.xml
|
@ -2,214 +2,218 @@
|
|||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/SUMMARY/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/migrating_from_safer_staticfiles/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/release_notes/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/advanced/authoring_component_libraries/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/advanced/component_registry/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/advanced/hooks/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/advanced/html_tragments/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/advanced/provide_inject/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/advanced/rendering_js_css/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/advanced/tag_formatter/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/advanced/template_tags/</loc>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/advanced/typing_and_validation/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/access_component_input/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/autodiscovery/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/component_context_scope/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/components_as_views/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/components_in_python/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/defining_js_css_html_files/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/html_attributes/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/single_file_components/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/slots/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/subclassing_components/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/template_tag_syntax/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/getting_started/adding_js_and_css/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/getting_started/adding_slots/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/getting_started/components_in_templates/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/getting_started/parametrising_components/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/getting_started/your_first_component/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/guides/devguides/dependency_mgmt/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/guides/devguides/slot_rendering/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/guides/devguides/slots_and_blocks/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/guides/setup/dev_server_setup/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/guides/setup/logging_and_debugging/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/guides/setup/syntax_highlight/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/overview/code_of_conduct/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/overview/community/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/overview/compatibility/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/overview/contributing/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/overview/development/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/overview/installation/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/overview/license/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/overview/security_notes/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/overview/welcome/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/reference/api/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/reference/commands/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/reference/components/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/reference/exceptions/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/reference/middlewares/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/reference/settings/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/reference/tag_formatters/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/reference/template_tags/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/reference/template_vars/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://emilstenstrom.github.io/django-components/latest/reference/urls/</loc>
|
||||
<lastmod>2025-01-15</lastmod>
|
||||
<lastmod>2025-01-20</lastmod>
|
||||
</url>
|
||||
</urlset>
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
[
|
||||
{
|
||||
"version": "dev",
|
||||
"title": "dev (7ed4fd8)",
|
||||
"title": "dev (f908197)",
|
||||
"aliases": []
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue