docs: move extension command- and url-related API to own API pages (#1093)

* docs: move extension command- and url-related API to own API pages

* refactor: fix linters
This commit is contained in:
Juro Oravec 2025-04-06 14:12:15 +02:00 committed by GitHub
parent 0ed46e4d30
commit 3555411f1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 312 additions and 97 deletions

View file

@ -4,7 +4,9 @@ nav:
- Commands: commands.md
- Components: components.md
- Exceptions: exceptions.md
- Extension commands: extension_commands.md
- Extension hooks: extension_hooks.md
- Extension URLs: extension_urls.md
- Middlewares: middlewares.md
- Settings: settings.md
- Signals: signals.md

View file

@ -7,38 +7,14 @@
options:
show_if_no_docstring: true
::: django_components.CommandArg
options:
show_if_no_docstring: true
::: django_components.CommandArgGroup
options:
show_if_no_docstring: true
::: django_components.CommandHandler
options:
show_if_no_docstring: true
::: django_components.CommandLiteralAction
options:
show_if_no_docstring: true
::: django_components.CommandParserInput
options:
show_if_no_docstring: true
::: django_components.CommandSubcommand
options:
show_if_no_docstring: true
::: django_components.Component
options:
show_if_no_docstring: true
::: django_components.ComponentCommand
options:
show_if_no_docstring: true
::: django_components.ComponentExtension
options:
show_if_no_docstring: true
@ -87,38 +63,6 @@
options:
show_if_no_docstring: true
::: django_components.OnComponentClassCreatedContext
options:
show_if_no_docstring: true
::: django_components.OnComponentClassDeletedContext
options:
show_if_no_docstring: true
::: django_components.OnComponentDataContext
options:
show_if_no_docstring: true
::: django_components.OnComponentInputContext
options:
show_if_no_docstring: true
::: django_components.OnComponentRegisteredContext
options:
show_if_no_docstring: true
::: django_components.OnComponentUnregisteredContext
options:
show_if_no_docstring: true
::: django_components.OnRegistryCreatedContext
options:
show_if_no_docstring: true
::: django_components.OnRegistryDeletedContext
options:
show_if_no_docstring: true
::: django_components.RegistrySettings
options:
show_if_no_docstring: true
@ -151,14 +95,6 @@
options:
show_if_no_docstring: true
::: django_components.URLRoute
options:
show_if_no_docstring: true
::: django_components.URLRouteHandler
options:
show_if_no_docstring: true
::: django_components.all_components
options:
show_if_no_docstring: true

View file

@ -54,7 +54,8 @@ python manage.py components ext run <extension> <command>
## `components create`
```txt
usage: python manage.py components create [-h] [--path PATH] [--js JS] [--css CSS] [--template TEMPLATE] [--force] [--verbose] [--dry-run] name
usage: python manage.py components create [-h] [--path PATH] [--js JS] [--css CSS] [--template TEMPLATE] [--force] [--verbose] [--dry-run]
name
```
@ -461,8 +462,8 @@ ProjectDashboardAction project.components.dashboard_action.ProjectDashboardAc
## `upgradecomponent`
```txt
usage: upgradecomponent [-h] [--path PATH] [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color] [--force-color]
[--skip-checks]
usage: upgradecomponent [-h] [--path PATH] [--version] [-v {0,1,2,3}] [--settings SETTINGS]
[--pythonpath PYTHONPATH] [--traceback] [--no-color] [--force-color] [--skip-checks]
```
@ -506,8 +507,9 @@ Deprecated. Use `components upgrade` instead.
## `startcomponent`
```txt
usage: startcomponent [-h] [--path PATH] [--js JS] [--css CSS] [--template TEMPLATE] [--force] [--verbose] [--dry-run] [--version] [-v {0,1,2,3}]
[--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color] [--force-color] [--skip-checks]
usage: startcomponent [-h] [--path PATH] [--js JS] [--css CSS] [--template TEMPLATE] [--force] [--verbose]
[--dry-run] [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH]
[--traceback] [--no-color] [--force-color] [--skip-checks]
name
```

View file

@ -0,0 +1,39 @@
<!-- Autogenerated by reference.py -->
# Extension commands
Overview of all classes, functions, and other objects related to defining extension commands.
Read more on [Extensions](../../concepts/advanced/extensions).
::: django_components.CommandArg
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.CommandArgGroup
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.CommandHandler
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.CommandParserInput
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.CommandSubcommand
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.ComponentCommand
options:
heading_level: 3
show_if_no_docstring: true

View file

@ -1,14 +1,17 @@
<!-- Autogenerated by reference.py -->
# Extension Hooks
# Extension hooks
Overview of all the extension hooks available in Django Components.
Read more on [Extensions](../../concepts/advanced/extensions).
## Hooks
::: django_components.extension.ComponentExtension.on_component_class_created
options:
heading_level: 3
show_root_heading: true
show_signature: true
separate_signature: true
@ -25,6 +28,7 @@ name | type | description
::: django_components.extension.ComponentExtension.on_component_class_deleted
options:
heading_level: 3
show_root_heading: true
show_signature: true
separate_signature: true
@ -41,6 +45,7 @@ name | type | description
::: django_components.extension.ComponentExtension.on_component_data
options:
heading_level: 3
show_root_heading: true
show_signature: true
separate_signature: true
@ -62,6 +67,7 @@ name | type | description
::: django_components.extension.ComponentExtension.on_component_input
options:
heading_level: 3
show_root_heading: true
show_signature: true
separate_signature: true
@ -84,6 +90,7 @@ name | type | description
::: django_components.extension.ComponentExtension.on_component_registered
options:
heading_level: 3
show_root_heading: true
show_signature: true
separate_signature: true
@ -102,6 +109,7 @@ name | type | description
::: django_components.extension.ComponentExtension.on_component_unregistered
options:
heading_level: 3
show_root_heading: true
show_signature: true
separate_signature: true
@ -120,6 +128,7 @@ name | type | description
::: django_components.extension.ComponentExtension.on_registry_created
options:
heading_level: 3
show_root_heading: true
show_signature: true
separate_signature: true
@ -136,6 +145,7 @@ name | type | description
::: django_components.extension.ComponentExtension.on_registry_deleted
options:
heading_level: 3
show_root_heading: true
show_signature: true
separate_signature: true
@ -150,3 +160,45 @@ name | type | description
--|--|--
`registry` | [`ComponentRegistry`](../api#django_components.ComponentRegistry) | The to-be-deleted ComponentRegistry instance
## Objects
::: django_components.extension.OnComponentClassCreatedContext
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.extension.OnComponentClassDeletedContext
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.extension.OnComponentDataContext
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.extension.OnComponentInputContext
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.extension.OnComponentRegisteredContext
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.extension.OnComponentUnregisteredContext
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.extension.OnRegistryCreatedContext
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.extension.OnRegistryDeletedContext
options:
heading_level: 3
show_if_no_docstring: true

View file

@ -0,0 +1,19 @@
<!-- Autogenerated by reference.py -->
# Extension URLs
Overview of all classes, functions, and other objects related to defining extension URLs.
Read more on [Extensions](../../concepts/advanced/extensions).
::: django_components.URLRoute
options:
heading_level: 3
show_if_no_docstring: true
::: django_components.URLRouteHandler
options:
heading_level: 3
show_if_no_docstring: true

View file

@ -20,7 +20,7 @@ Import as
<a href="https://github.com/django-components/django-components/tree/master/src/django_components/templatetags/component_tags.py#L1053" target="_blank">See source code</a>
<a href="https://github.com/django-components/django-components/tree/master/src/django_components/templatetags/component_tags.py#L1037" target="_blank">See source code</a>
@ -43,7 +43,7 @@ If you insert this tag multiple times, ALL CSS links will be duplicately inserte
<a href="https://github.com/django-components/django-components/tree/master/src/django_components/templatetags/component_tags.py#L1075" target="_blank">See source code</a>
<a href="https://github.com/django-components/django-components/tree/master/src/django_components/templatetags/component_tags.py#L1059" target="_blank">See source code</a>
@ -67,7 +67,7 @@ If you insert this tag multiple times, ALL JS scripts will be duplicately insert
<a href="https://github.com/django-components/django-components/tree/master/src/django_components/templatetags/component_tags.py#L1494" target="_blank">See source code</a>
<a href="https://github.com/django-components/django-components/tree/master/src/django_components/templatetags/component_tags.py#L1564" target="_blank">See source code</a>