From d7f74eb35a896a68c1b3c34054bfc232a693bbf9 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 26 Nov 2024 21:56:17 +0000 Subject: [PATCH] Deployed 5fc27a0 to dev with MkDocs 1.6.1 and mike 2.1.3 --- .../django_components/dependencies/index.html | 22 +++++----- dev/reference/django_components/index.html | 44 +++++++++---------- .../django_components/middleware/index.html | 22 +++++----- versions.json | 2 +- 4 files changed, 45 insertions(+), 45 deletions(-) diff --git a/dev/reference/django_components/dependencies/index.html b/dev/reference/django_components/dependencies/index.html index b80498df..9a32ca51 100644 --- a/dev/reference/django_components/dependencies/index.html +++ b/dev/reference/django_components/dependencies/index.html @@ -1,15 +1,15 @@ dependencies - Django-Components dependencies - Django-Components" > dependencies - Django-Components" >
Skip to content

dependencies ¤

All code related to management of component dependencies (JS and CSS scripts)

Modules:

  • types –

    Helper types for IDEs.

Classes:

Functions:

  • render_dependencies –

    Given a string that contains parts that were rendered by components,

ComponentDependencyMiddleware ¤

ComponentDependencyMiddleware(get_response: Callable[[HttpRequest], HttpResponse])
-

Middleware that inserts CSS/JS dependencies for all rendered components at points marked with template tags.

Source code in src/django_components/dependencies.py
def __init__(self, get_response: "Callable[[HttpRequest], HttpResponse]") -> None:
-    self.get_response = get_response
-
-    # NOTE: Required to work with async
-    if iscoroutinefunction(self.get_response):
-        markcoroutinefunction(self)
+

Middleware that inserts CSS/JS dependencies for all rendered components at points marked with template tags.

Source code in src/django_components/dependencies.py
def __init__(self, get_response: "Callable[[HttpRequest], HttpResponse]") -> None:
+    self.get_response = get_response
+
+    # NOTE: Required to work with async
+    if iscoroutinefunction(self.get_response):
+        markcoroutinefunction(self)
 

render_dependencies ¤

render_dependencies(content: TContent, type: RenderType = 'document') -> TContent
 

Given a string that contains parts that were rendered by components, this function inserts all used JS and CSS.

By default, the string is parsed as an HTML and: - CSS is inserted at the end of <head> (if present) - JS is inserted at the end of <body> (if present)

If you used {% component_js_dependencies %} or {% component_css_dependencies %}, then the JS and CSS will be inserted only at these locations.

Example:

def my_view(request):
     template = Template('''
diff --git a/dev/reference/django_components/index.html b/dev/reference/django_components/index.html
index 57f3b25d..c53f9671 100644
--- a/dev/reference/django_components/index.html
+++ b/dev/reference/django_components/index.html
@@ -5874,17 +5874,17 @@
     internal_key = _INJECT_CONTEXT_KEY_PREFIX + key
     context[internal_key] = payload
 

dependencies ¤

All code related to management of component dependencies (JS and CSS scripts)

Modules:

  • types –

    Helper types for IDEs.

Classes:

Functions:

  • render_dependencies –

    Given a string that contains parts that were rendered by components,

ComponentDependencyMiddleware ¤

ComponentDependencyMiddleware(get_response: Callable[[HttpRequest], HttpResponse])
-

Middleware that inserts CSS/JS dependencies for all rendered components at points marked with template tags.

Source code in src/django_components/dependencies.py
def __init__(self, get_response: "Callable[[HttpRequest], HttpResponse]") -> None:
-    self.get_response = get_response
-
-    # NOTE: Required to work with async
-    if iscoroutinefunction(self.get_response):
-        markcoroutinefunction(self)
+

Middleware that inserts CSS/JS dependencies for all rendered components at points marked with template tags.

Source code in src/django_components/dependencies.py
def __init__(self, get_response: "Callable[[HttpRequest], HttpResponse]") -> None:
+    self.get_response = get_response
+
+    # NOTE: Required to work with async
+    if iscoroutinefunction(self.get_response):
+        markcoroutinefunction(self)
 

render_dependencies ¤

render_dependencies(content: TContent, type: RenderType = 'document') -> TContent
 

Given a string that contains parts that were rendered by components, this function inserts all used JS and CSS.

By default, the string is parsed as an HTML and: - CSS is inserted at the end of <head> (if present) - JS is inserted at the end of <body> (if present)

If you used {% component_js_dependencies %} or {% component_css_dependencies %}, then the JS and CSS will be inserted only at these locations.

Example:

def my_view(request):
     template = Template('''
@@ -6409,17 +6409,17 @@
 

This will create a new component named new_component in the my_components directory. The JavaScript, CSS, and template files will be named my_script.js, my_style.css, and my_template.html, respectively.

Overwriting an Existing Component¤

If you want to overwrite an existing component, you can use the --force option:

python manage.py startcomponent my_component --force
 

This will overwrite the existing my_component if it exists.

Simulating Component Creation¤

If you want to simulate the creation of a component without actually creating any files, you can use the --dry-run option:

python manage.py startcomponent my_component --dry-run
 

This will simulate the creation of my_component without creating any files.

middleware ¤

Classes:

ComponentDependencyMiddleware ¤

ComponentDependencyMiddleware(get_response: Callable[[HttpRequest], HttpResponse])
-

Middleware that inserts CSS/JS dependencies for all rendered components at points marked with template tags.

Source code in src/django_components/dependencies.py
def __init__(self, get_response: "Callable[[HttpRequest], HttpResponse]") -> None:
-    self.get_response = get_response
-
-    # NOTE: Required to work with async
-    if iscoroutinefunction(self.get_response):
-        markcoroutinefunction(self)
+

Middleware that inserts CSS/JS dependencies for all rendered components at points marked with template tags.

Source code in src/django_components/dependencies.py
def __init__(self, get_response: "Callable[[HttpRequest], HttpResponse]") -> None:
+    self.get_response = get_response
+
+    # NOTE: Required to work with async
+    if iscoroutinefunction(self.get_response):
+        markcoroutinefunction(self)
 

node ¤

Classes:

  • BaseNode –

    Shared behavior for our subclasses of Django's Node

BaseNode ¤

BaseNode(
     nodelist: Optional[NodeList] = None,
     node_id: Optional[str] = None,
diff --git a/dev/reference/django_components/middleware/index.html b/dev/reference/django_components/middleware/index.html
index cec74449..90318df9 100644
--- a/dev/reference/django_components/middleware/index.html
+++ b/dev/reference/django_components/middleware/index.html
@@ -1,13 +1,13 @@
  middleware - Django-Components middleware - Django-Components" >  middleware - Django-Components" >       

middleware ¤

Classes:

ComponentDependencyMiddleware ¤

ComponentDependencyMiddleware(get_response: Callable[[HttpRequest], HttpResponse])
-

Middleware that inserts CSS/JS dependencies for all rendered components at points marked with template tags.

Source code in src/django_components/dependencies.py
def __init__(self, get_response: "Callable[[HttpRequest], HttpResponse]") -> None:
-    self.get_response = get_response
-
-    # NOTE: Required to work with async
-    if iscoroutinefunction(self.get_response):
-        markcoroutinefunction(self)
+

Middleware that inserts CSS/JS dependencies for all rendered components at points marked with template tags.

Source code in src/django_components/dependencies.py
def __init__(self, get_response: "Callable[[HttpRequest], HttpResponse]") -> None:
+    self.get_response = get_response
+
+    # NOTE: Required to work with async
+    if iscoroutinefunction(self.get_response):
+        markcoroutinefunction(self)
 
\ No newline at end of file diff --git a/versions.json b/versions.json index b5f67122..52651734 100644 --- a/versions.json +++ b/versions.json @@ -1,7 +1,7 @@ [ { "version": "dev", - "title": "dev (2a4b0f5)", + "title": "dev (5fc27a0)", "aliases": [] }, {