Deployed 8677ee79 to dev with MkDocs 1.6.1 and mike 2.1.3

This commit is contained in:
github-actions 2025-06-01 17:21:57 +00:00
parent feee41d409
commit da8bde944c
10 changed files with 727 additions and 653 deletions

View file

@ -176,7 +176,7 @@
<a id=__codelineno-5-2 name=__codelineno-5-2 href=#__codelineno-5-2></a><span class=x> Click me!</span>
<a id=__codelineno-5-3 name=__codelineno-5-3 href=#__codelineno-5-3></a><span class=cp>{%</span> <span class=k>endbutton</span> <span class=cp>%}</span>
</code></pre></div> </li> </ul> </div> </div> <div class="doc doc-object doc-attribute"> <h2 id=django_components.app_settings.ComponentsSettings.template_cache_size class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">template_cache_size</span> <a href=#django_components.app_settings.ComponentsSettings.template_cache_size class=headerlink title="Permanent link">¤</a></h2> <div class="doc-signature highlight"><pre><span></span><code><a id=__codelineno-0-1 name=__codelineno-0-1 href=#__codelineno-0-1></a><span class=n>template_cache_size</span><span class=p>:</span> <span class=n><a class="autorefs autorefs-external" title=typing.Optional href=https://docs.python.org/3.12/library/typing.html#typing.Optional>Optional</a></span><span class=p>[</span><span class=n><a class="autorefs autorefs-external" href=https://docs.python.org/3.12/library/functions.html#int>int</a></span><span class=p>]</span> <span class=o>=</span> <span class=kc>None</span>
</code></pre></div> <div class="doc doc-contents first"> <p><a href=https://github.com/django-components/django-components/tree/master/src/django_components/app_settings.py#L623 target=_blank>See source code</a></p> <p>Configure the maximum amount of Django templates to be cached.</p> <p>Defaults to <code>128</code>.</p> <p>Each time a <a href=https://docs.djangoproject.com/en/5.2/ref/templates/api/#django.template.Template>Django template</a> is rendered, it is cached to a global in-memory cache (using Python's <a href=https://docs.python.org/3/library/functools.html#functools.lru_cache><code>lru_cache</code></a> decorator). This speeds up the next render of the component. As the same component is often used many times on the same page, these savings add up.</p> <p>By default the cache holds 128 component templates in memory, which should be enough for most sites. But if you have a lot of components, or if you are overriding <a href=../api#django_components.Component.get_template><code>Component.get_template()</code></a> to render many dynamic templates, you can increase this number.</p> <div class=highlight><pre><span></span><code><a id=__codelineno-0-1 name=__codelineno-0-1 href=#__codelineno-0-1></a><span class=n>COMPONENTS</span> <span class=o>=</span> <span class=n>ComponentsSettings</span><span class=p>(</span>
</code></pre></div> <div class="doc doc-contents first"> <p><a href=https://github.com/django-components/django-components/tree/master/src/django_components/app_settings.py#L624 target=_blank>See source code</a></p> <p>DEPRECATED. Template caching will be removed in v1.</p> <p>Configure the maximum amount of Django templates to be cached.</p> <p>Defaults to <code>128</code>.</p> <p>Each time a <a href=https://docs.djangoproject.com/en/5.2/ref/templates/api/#django.template.Template>Django template</a> is rendered, it is cached to a global in-memory cache (using Python's <a href=https://docs.python.org/3/library/functools.html#functools.lru_cache><code>lru_cache</code></a> decorator). This speeds up the next render of the component. As the same component is often used many times on the same page, these savings add up.</p> <p>By default the cache holds 128 component templates in memory, which should be enough for most sites. But if you have a lot of components, or if you are overriding <a href=../api#django_components.Component.get_template><code>Component.get_template()</code></a> to render many dynamic templates, you can increase this number.</p> <div class=highlight><pre><span></span><code><a id=__codelineno-0-1 name=__codelineno-0-1 href=#__codelineno-0-1></a><span class=n>COMPONENTS</span> <span class=o>=</span> <span class=n>ComponentsSettings</span><span class=p>(</span>
<a id=__codelineno-0-2 name=__codelineno-0-2 href=#__codelineno-0-2></a> <span class=n>template_cache_size</span><span class=o>=</span><span class=mi>256</span><span class=p>,</span>
<a id=__codelineno-0-3 name=__codelineno-0-3 href=#__codelineno-0-3></a><span class=p>)</span>
</code></pre></div> <p>To remove the cache limit altogether and cache everything, set <code>template_cache_size</code> to <code>None</code>.</p> <div class=highlight><pre><span></span><code><a id=__codelineno-1-1 name=__codelineno-1-1 href=#__codelineno-1-1></a><span class=n>COMPONENTS</span> <span class=o>=</span> <span class=n>ComponentsSettings</span><span class=p>(</span>