Skip to content

Commit eb42b7c

Browse files
committed
deploy: 3228f11
1 parent 240aac2 commit eb42b7c

63 files changed

Lines changed: 5263 additions & 120 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

404.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,8 @@
801801

802802

803803

804+
805+
804806

805807

806808

@@ -913,6 +915,34 @@
913915

914916

915917

918+
<li class="md-nav__item">
919+
<a href="/guides/desktop-preview/" class="md-nav__link">
920+
921+
922+
923+
<span class="md-ellipsis">
924+
925+
926+
Desktop Preview
927+
928+
929+
930+
</span>
931+
932+
933+
934+
</a>
935+
</li>
936+
937+
938+
939+
940+
941+
942+
943+
944+
945+
916946
<li class="md-nav__item">
917947
<a href="/guides/navigation/" class="md-nav__link">
918948

api/alerts/index.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,8 @@
827827

828828

829829

830+
831+
830832

831833

832834

@@ -939,6 +941,34 @@
939941

940942

941943

944+
<li class="md-nav__item">
945+
<a href="../../guides/desktop-preview/" class="md-nav__link">
946+
947+
948+
949+
<span class="md-ellipsis">
950+
951+
952+
Desktop Preview
953+
954+
955+
956+
</span>
957+
958+
959+
960+
</a>
961+
</li>
962+
963+
964+
965+
966+
967+
968+
969+
970+
971+
942972
<li class="md-nav__item">
943973
<a href="../../guides/navigation/" class="md-nav__link">
944974

api/animated/index.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,8 @@
827827

828828

829829

830+
831+
830832

831833

832834

@@ -939,6 +941,34 @@
939941

940942

941943

944+
<li class="md-nav__item">
945+
<a href="../../guides/desktop-preview/" class="md-nav__link">
946+
947+
948+
949+
<span class="md-ellipsis">
950+
951+
952+
Desktop Preview
953+
954+
955+
956+
</span>
957+
958+
959+
960+
</a>
961+
</li>
962+
963+
964+
965+
966+
967+
968+
969+
970+
971+
942972
<li class="md-nav__item">
943973
<a href="../../guides/navigation/" class="md-nav__link">
944974

api/cli/index.html

Lines changed: 132 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,8 @@
827827

828828

829829

830+
831+
830832

831833

832834

@@ -939,6 +941,34 @@
939941

940942

941943

944+
<li class="md-nav__item">
945+
<a href="../../guides/desktop-preview/" class="md-nav__link">
946+
947+
948+
949+
<span class="md-ellipsis">
950+
951+
952+
Desktop Preview
953+
954+
955+
956+
</span>
957+
958+
959+
960+
</a>
961+
</li>
962+
963+
964+
965+
966+
967+
968+
969+
970+
971+
942972
<li class="md-nav__item">
943973
<a href="../../guides/navigation/" class="md-nav__link">
944974

@@ -2273,6 +2303,17 @@
22732303
</span>
22742304
</a>
22752305

2306+
</li>
2307+
2308+
<li class="md-nav__item">
2309+
<a href="#pythonnative.cli.pn.preview_project" class="md-nav__link">
2310+
<span class="md-ellipsis">
2311+
2312+
<code class="doc-symbol doc-symbol-toc doc-symbol-function"></code>&nbsp;preview_project
2313+
2314+
</span>
2315+
</a>
2316+
22762317
</li>
22772318

22782319
<li class="md-nav__item">
@@ -2644,6 +2685,17 @@
26442685
</span>
26452686
</a>
26462687

2688+
</li>
2689+
2690+
<li class="md-nav__item">
2691+
<a href="#pythonnative.cli.pn.preview_project" class="md-nav__link">
2692+
<span class="md-ellipsis">
2693+
2694+
<code class="doc-symbol doc-symbol-toc doc-symbol-function"></code>&nbsp;preview_project
2695+
2696+
</span>
2697+
</a>
2698+
26472699
</li>
26482700

26492701
<li class="md-nav__item">
@@ -2720,6 +2772,10 @@ <h2 id="subcommands">Subcommands<a class="headerlink" href="#subcommands" title=
27202772
<ul>
27212773
<li><code>pn init [name]</code>: scaffold a new project (creates <code>app/</code>,
27222774
<code>pythonnative.json</code>, <code>requirements.txt</code>, <code>.gitignore</code>).</li>
2775+
<li><code>pn preview [component]</code>: render the app in a desktop (Tkinter) window
2776+
with Fast Refresh — the fastest way to iterate on UI. Flags:
2777+
<code>--width</code>, <code>--height</code>, <code>--title</code>, <code>--no-hot-reload</code>. See the
2778+
<a href="../../guides/desktop-preview/">Desktop preview guide</a>.</li>
27232779
<li><code>pn run android|ios</code>: build and run on a connected device or
27242780
simulator. Flags: <code>--prepare-only</code>, <code>--hot-reload</code>, <code>--no-logs</code>.</li>
27252781
<li><code>pn clean</code>: remove the local <code>build/</code> directory.</li>
@@ -2735,9 +2791,12 @@ <h2 id="subcommands">Subcommands<a class="headerlink" href="#subcommands" title=
27352791

27362792
<p><code>pn</code> CLI: scaffold, run, and clean PythonNative projects.</p>
27372793
<p>The console script <code>pn</code> (declared in <code>pyproject.toml</code> under
2738-
<code>[project.scripts]</code>) dispatches to one of three subcommands:</p>
2794+
<code>[project.scripts]</code>) dispatches to one of four subcommands:</p>
27392795
<ul>
27402796
<li><code>pn init [name]</code>: scaffold a new project in the current directory.</li>
2797+
<li><code>pn preview [component]</code>: render the app in a desktop (Tkinter)
2798+
window with instant Fast Refresh — the fast inner dev loop, no
2799+
device or simulator required.</li>
27412800
<li><code>pn run android|ios</code>: stage code into a native template, build it,
27422801
install it, and stream logs back to the terminal.</li>
27432802
<li><code>pn clean</code>: remove the local <code>build/</code> directory.</li>
@@ -2799,6 +2858,14 @@ <h2 id="subcommands">Subcommands<a class="headerlink" href="#subcommands" title=
27992858
</div>
28002859
</td>
28012860
</tr>
2861+
<tr class="doc-section-item">
2862+
<td><code><a class="autorefs autorefs-internal" title="&lt;code class=&quot;doc-symbol doc-symbol-heading doc-symbol-function&quot;&gt;&lt;/code&gt; &lt;span class=&quot;doc doc-object-name doc-function-name&quot;&gt;preview_project&lt;/span&gt; (&lt;code&gt;pythonnative.cli.pn.preview_project&lt;/code&gt;)" href="#pythonnative.cli.pn.preview_project">preview_project</a></code></td>
2863+
<td>
2864+
<div class="doc-md-description">
2865+
<p>Render the project in a desktop preview window (Tkinter).</p>
2866+
</div>
2867+
</td>
2868+
</tr>
28022869
<tr class="doc-section-item">
28032870
<td><code><a class="autorefs autorefs-internal" title="&lt;code class=&quot;doc-symbol doc-symbol-heading doc-symbol-function&quot;&gt;&lt;/code&gt; &lt;span class=&quot;doc doc-object-name doc-function-name&quot;&gt;clean_project&lt;/span&gt; (&lt;code&gt;pythonnative.cli.pn.clean_project&lt;/code&gt;)" href="#pythonnative.cli.pn.clean_project">clean_project</a></code></td>
28042871
<td>
@@ -3093,6 +3160,70 @@ <h2 id="pythonnative.cli.pn.run_project" class="doc doc-heading">
30933160
<div class="doc doc-object doc-function">
30943161

30953162

3163+
<h2 id="pythonnative.cli.pn.preview_project" class="doc doc-heading">
3164+
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">preview_project</span>
3165+
3166+
3167+
<a href="#pythonnative.cli.pn.preview_project" class="headerlink" title="Permanent link">&para;</a></h2>
3168+
<div class="language-python doc-signature highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">preview_project</span><span class="p">(</span><span class="n">args</span><span class="p">:</span> <span class="n"><a class="autorefs autorefs-external" title="&lt;code&gt;argparse.Namespace&lt;/code&gt;" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace">Namespace</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span>
3169+
</span></code></pre></div>
3170+
3171+
<div class="doc doc-contents ">
3172+
3173+
<p>Render the project in a desktop preview window (Tkinter).</p>
3174+
<p>Sets <code>PN_PLATFORM=desktop</code> (so PythonNative selects the Tkinter
3175+
backend) and hands off to <code>pythonnative.preview.run_preview</code>,
3176+
which opens a window, mounts the app, and Fast Refreshes on every
3177+
file save until the window is closed.</p>
3178+
3179+
3180+
<p><span class="doc-section-title">Parameters:</span></p>
3181+
<table>
3182+
<thead>
3183+
<tr>
3184+
<th>Name</th>
3185+
<th>Type</th>
3186+
<th>Description</th>
3187+
<th>Default</th>
3188+
</tr>
3189+
</thead>
3190+
<tbody>
3191+
<tr class="doc-section-item">
3192+
<td>
3193+
<code>args</code>
3194+
</td>
3195+
<td>
3196+
<code><a class="autorefs autorefs-external" title="&lt;code&gt;argparse.Namespace&lt;/code&gt;" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace">Namespace</a></code>
3197+
</td>
3198+
<td>
3199+
<div class="doc-md-description">
3200+
<p>Parsed argparse namespace. Recognized attributes:</p>
3201+
<ul>
3202+
<li><code>component</code> (<code>str</code>, optional): Module path like
3203+
<code>"app.main"</code> (its <code>App</code> is used) or a dotted
3204+
<code>module.Component</code> path. Defaults to the project's
3205+
configured <code>entryPoint</code>.</li>
3206+
<li><code>width</code> / <code>height</code> (<code>int</code>): Initial window size in points.</li>
3207+
<li><code>title</code> (<code>str</code>): Window title.</li>
3208+
<li><code>no_hot_reload</code> (<code>bool</code>): Disable file watching.</li>
3209+
</ul>
3210+
</div>
3211+
</td>
3212+
<td>
3213+
<em>required</em>
3214+
</td>
3215+
</tr>
3216+
</tbody>
3217+
</table>
3218+
3219+
3220+
</div>
3221+
3222+
</div>
3223+
3224+
<div class="doc doc-object doc-function">
3225+
3226+
30963227
<h2 id="pythonnative.cli.pn.clean_project" class="doc doc-heading">
30973228
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">clean_project</span>
30983229

api/component-properties/index.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,8 @@
827827

828828

829829

830+
831+
830832

831833

832834

@@ -939,6 +941,34 @@
939941

940942

941943

944+
<li class="md-nav__item">
945+
<a href="../../guides/desktop-preview/" class="md-nav__link">
946+
947+
948+
949+
<span class="md-ellipsis">
950+
951+
952+
Desktop Preview
953+
954+
955+
956+
</span>
957+
958+
959+
960+
</a>
961+
</li>
962+
963+
964+
965+
966+
967+
968+
969+
970+
971+
942972
<li class="md-nav__item">
943973
<a href="../../guides/navigation/" class="md-nav__link">
944974

0 commit comments

Comments
 (0)