-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployed 5891b41 to develop with MkDocs 1.6.1 and mike 2.1.3
- Loading branch information
github-actions
committed
Nov 25, 2024
1 parent
01ee044
commit 05af1ed
Showing
7 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -306,7 +306,7 @@ | |
|
||
<span class=k>def</span> <span class=nf>hello_world</span><span class=p>(</span><span class=n>request</span><span class=p>):</span> | ||
<span class=k>return</span> <span class=n>HttpResponse</span><span class=p>(</span><span class=s2>"Hello World!"</span><span class=p>)</span> | ||
</code></pre></div></td></tr></table></div> </div> </div> </div> <details class=example> <summary>See Interface</summary> <p><font size=4><strong>Parameters</strong></font></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> <th>Default</th> </tr> </thead> <tbody> <tr> <td><code class=highlight><span class=n>view</span></code></td> <td><code class=highlight><span class=n>Callable</span> <span class=o>|</span> <span class=n>View</span> <span class=o>|</span> <span class=nb>str</span></code></td> <td>The view to convert, or the view's dotted path as a string.</td> <td>N/A</td> </tr> <tr> <td><code class=highlight><span class=n>transforms</span></code></td> <td><code class=highlight><span class=n>Sequence</span><span class=p>[</span><span class=n>Callable</span><span class=p>[[</span><span class=n>VdomDict</span><span class=p>],</span> <span class=n>Any</span><span class=p>]]</span></code></td> <td>A list of functions that transforms the newly generated VDOM. The functions will be called on each VDOM node.</td> <td><code class=highlight><span class=nb>tuple</span></code></td> </tr> <tr> <td><code class=highlight><span class=n>strict_parsing</span></code></td> <td><code class=highlight><span class=nb>bool</span></code></td> <td>If <code class=highlight><span class=kc>True</span></code>, an exception will be generated if the HTML does not perfectly adhere to HTML5.</td> <td><code class=highlight><span class=kc>True</span></code></td> </tr> </tbody> </table> <p><font size=4><strong>Returns</strong></font></p> <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code class=highlight><span class=n>constructor</span></code></td> <td>A function that takes <code class=highlight><span class=n>request</span><span class=p>,</span> <span class=o>*</span><span class=n>args</span><span class=p>,</span> <span class=n>key</span><span class=p>,</span> <span class=o>**</span><span class=n>kwargs</span></code> and returns a ReactPy component. Note that <code class=highlight><span class=o>*</span><span class=n>args</span></code> and <code class=highlight><span class=o>**</span><span class=n>kwargs</span></code> are directly provided to your view.</td> </tr> </tbody> </table> </details> <details class=info> <summary>Existing limitations</summary> <p>There are currently several limitations of using <code class=highlight><span class=n>view_to_component</span></code> that may be resolved in a future version.</p> <ul> <li>Requires manual intervention to change HTTP methods to anything other than <code>GET</code>.</li> <li>ReactPy events cannot conveniently be attached to converted view HTML.</li> <li>Has no option to automatically intercept local anchor link (such as <code class=highlight><span class=p><</span><span class=nt>a</span> <span class=na>href</span><span class=o>=</span><span class=s>'example/'</span><span class=p>></</span><span class=nt>a</span><span class=p>></span></code>) click events.</li> </ul> </details> <details class=question> <summary>How do I use this for Class Based Views?</summary> <p>Class Based Views are accepted by <code class=highlight><span class=n>view_to_component</span></code> as an argument.</p> <p>Calling <code class=highlight><span class=n>as_view</span><span class=p>()</span></code> is optional, but recommended.</p> <div class="tabbed-set tabbed-alternate" data-tabs=10:2><input checked=checked id=__tabbed_10_1 name=__tabbed_10 type=radio><input id=__tabbed_10_2 name=__tabbed_10 type=radio><div class=tabbed-labels><label for=__tabbed_10_1>components.py</label><label for=__tabbed_10_2>views.py</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><table class=highlighttable><tr><td class=linenos><div class=linenodiv><pre><span></span><span class=normal> 1</span> | ||
</code></pre></div></td></tr></table></div> </div> </div> </div> <details class=example> <summary>See Interface</summary> <p><font size=4><strong>Parameters</strong></font></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> <th>Default</th> </tr> </thead> <tbody> <tr> <td><code class=highlight><span class=n>view</span></code></td> <td><code class=highlight><span class=n>Callable</span> <span class=o>|</span> <span class=n>View</span> <span class=o>|</span> <span class=nb>str</span></code></td> <td>The view to convert, or the view's dotted path as a string.</td> <td>N/A</td> </tr> <tr> <td><code class=highlight><span class=n>transforms</span></code></td> <td><code class=highlight><span class=n>Sequence</span><span class=p>[</span><span class=n>Callable</span><span class=p>[[</span><span class=n>VdomDict</span><span class=p>],</span> <span class=n>Any</span><span class=p>]]</span></code></td> <td>A list of functions that transforms the newly generated VDOM. The functions will be called on each VDOM node.</td> <td><code class=highlight><span class=nb>tuple</span></code></td> </tr> <tr> <td><code class=highlight><span class=n>strict_parsing</span></code></td> <td><code class=highlight><span class=nb>bool</span></code></td> <td>If <code class=highlight><span class=kc>True</span></code>, an exception will be generated if the HTML does not perfectly adhere to HTML5.</td> <td><code class=highlight><span class=kc>True</span></code></td> </tr> </tbody> </table> <p><font size=4><strong>Returns</strong></font></p> <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code class=highlight><span class=n>constructor</span></code></td> <td>A function that takes <code class=highlight><span class=n>request</span><span class=p>,</span> <span class=o>*</span><span class=n>args</span><span class=p>,</span> <span class=n>key</span><span class=p>,</span> <span class=o>**</span><span class=n>kwargs</span></code> and returns a ReactPy component. Note that <code class=highlight><span class=o>*</span><span class=n>args</span></code> and <code class=highlight><span class=o>**</span><span class=n>kwargs</span></code> are directly provided to your view.</td> </tr> </tbody> </table> </details> <details class=info> <summary>Existing limitations</summary> <p>There are currently several limitations of using <code class=highlight><span class=n>view_to_component</span></code> that may be resolved in a future version.</p> <ul> <li>Requires manual intervention to change HTTP methods to anything other than <code>GET</code>.</li> <li>ReactPy events cannot conveniently be attached to converted view HTML.</li> <li>Has no option to automatically intercept click events from hyperlinks (such as <code class=highlight><span class=p><</span><span class=nt>a</span> <span class=na>href</span><span class=o>=</span><span class=s>'example/'</span><span class=p>></</span><span class=nt>a</span><span class=p>></span></code>).</li> </ul> </details> <details class=question> <summary>How do I use this for Class Based Views?</summary> <p>Class Based Views are accepted by <code class=highlight><span class=n>view_to_component</span></code> as an argument.</p> <p>Calling <code class=highlight><span class=n>as_view</span><span class=p>()</span></code> is optional, but recommended.</p> <div class="tabbed-set tabbed-alternate" data-tabs=10:2><input checked=checked id=__tabbed_10_1 name=__tabbed_10 type=radio><input id=__tabbed_10_2 name=__tabbed_10 type=radio><div class=tabbed-labels><label for=__tabbed_10_1>components.py</label><label for=__tabbed_10_2>views.py</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><table class=highlighttable><tr><td class=linenos><div class=linenodiv><pre><span></span><span class=normal> 1</span> | ||
<span class=normal> 2</span> | ||
<span class=normal> 3</span> | ||
<span class=normal> 4</span> | ||
|
@@ -847,4 +847,4 @@ | |
<span class=n>html</span><span class=o>.</span><span class=n>script</span><span class=p>({</span><span class=s2>"src"</span><span class=p>:</span> <span class=s2>"https://example.com/external-scripts.js"</span><span class=p>}),</span> | ||
<span class=n>html</span><span class=o>.</span><span class=n>button</span><span class=p>(</span><span class=s2>"My Button!"</span><span class=p>),</span> | ||
<span class=p>)</span> | ||
</code></pre></div></td></tr></table></div> </details> <details class=question> <summary>Why not load my JS in <code class=highlight><span class=p><</span><span class=nt>head</span><span class=p>></span></code>?</summary> <p>Traditionally, JavaScript is loaded in your <code class=highlight><span class=p><</span><span class=nt>head</span><span class=p>></span></code> using Django's <code class=highlight><span class=cp>{%</span> <span class=k>static</span> <span class=cp>%}</span></code> template tag.</p> <p>However, to help improve webpage load times you can use this <code class=highlight><span class=n>django_js</span></code> component to defer loading your JavaScript until it is needed.</p> </details> <hr> <div class=md-source-file> <small> Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">October 22, 2024</span> </small> </div> <div class=md-source-date> <small> Authors: <span class="git-page-authors git-authors"><a href=mailto:[email protected]>Mark Bakhit</a></span> </small> </div> </article> </div> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12Z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> © <div id=year></div> <script>document.getElementById("year").innerHTML = new Date().getFullYear();</script> Reactive Python and affiliates. <div class=legal-footer-right>This project has no affiliation to ReactJS or Meta Platforms, Inc.</div> </div> </div> </div> </div> </footer> </div> <div class=md-dialog data-md-component=dialog> <div class="md-dialog__inner md-typeset"></div> </div> <script id=__config type=application/json>{"base": "../..", "features": ["navigation.instant", "navigation.tabs", "navigation.tabs.sticky", "navigation.top", "content.code.copy", "search.highlight"], "search": "../../assets/javascripts/workers/search.a264c092.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"provider": "mike"}}</script> <script src=../../assets/javascripts/bundle.4e0fa4ba.min.js></script> <script src=../../assets/js/main.js></script> </body> </html> | ||
</code></pre></div></td></tr></table></div> </details> <details class=question> <summary>Why not load my JS in <code class=highlight><span class=p><</span><span class=nt>head</span><span class=p>></span></code>?</summary> <p>Traditionally, JavaScript is loaded in your <code class=highlight><span class=p><</span><span class=nt>head</span><span class=p>></span></code> using Django's <code class=highlight><span class=cp>{%</span> <span class=k>static</span> <span class=cp>%}</span></code> template tag.</p> <p>However, to help improve webpage load times you can use this <code class=highlight><span class=n>django_js</span></code> component to defer loading your JavaScript until it is needed.</p> </details> <hr> <div class=md-source-file> <small> Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">November 25, 2024</span> </small> </div> <div class=md-source-date> <small> Authors: <span class="git-page-authors git-authors"><a href=mailto:[email protected]>Mark Bakhit</a></span> </small> </div> </article> </div> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12Z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> © <div id=year></div> <script>document.getElementById("year").innerHTML = new Date().getFullYear();</script> Reactive Python and affiliates. <div class=legal-footer-right>This project has no affiliation to ReactJS or Meta Platforms, Inc.</div> </div> </div> </div> </div> </footer> </div> <div class=md-dialog data-md-component=dialog> <div class="md-dialog__inner md-typeset"></div> </div> <script id=__config type=application/json>{"base": "../..", "features": ["navigation.instant", "navigation.tabs", "navigation.tabs.sticky", "navigation.top", "content.code.copy", "search.highlight"], "search": "../../assets/javascripts/workers/search.a264c092.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"provider": "mike"}}</script> <script src=../../assets/javascripts/bundle.4e0fa4ba.min.js></script> <script src=../../assets/js/main.js></script> </body> </html> |
Oops, something went wrong.