Skip to content

Commit fa1af0b

Browse files
committed
docs
1 parent b9e417b commit fa1af0b

8 files changed

Lines changed: 37 additions & 12 deletions

File tree

_modules/edifice/run_subprocess_with_callback.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,9 @@ <h1>Source code for edifice.run_subprocess_with_callback</h1><div class="highlig
406406

407407
<span class="c1"># Edifice run_subprocess_with_callback 2025 by James D. Brock</span>
408408
<span class="c1">#</span>
409-
<span class="c1"># This run_subprocess_with_callback module file depends only on the Python</span>
410-
<span class="c1"># standard library so it can copied and pasted into any project without</span>
411-
<span class="c1"># modification.</span>
409+
<span class="c1"># This run_subprocess_with_callback module depends only on the</span>
410+
<span class="c1"># Python standard library so this module file can be copied and pasted into</span>
411+
<span class="c1"># another project without depending on the Edifice package.</span>
412412

413413

414414
<span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">annotations</span>
@@ -695,6 +695,12 @@ <h1>Source code for edifice.run_subprocess_with_callback</h1><div class="highlig
695695
<span class="sd"> `before the __main__ imports &lt;https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html#when-to-call-multiprocessing-freeze-support&gt;`_</span>
696696
<span class="sd"> so that the spawn Process starts up faster.</span>
697697

698+
<span class="sd"> Independence</span>
699+
<span class="sd"> ^^^^^^^^^^^^</span>
700+
701+
<span class="sd"> This :func:`run_subprocess_with_callback` module depends only on the</span>
702+
<span class="sd"> Python standard library so this module file can be copied and pasted into</span>
703+
<span class="sd"> another project without depending on the Edifice package.</span>
698704
<span class="sd"> &quot;&quot;&quot;</span>
699705

700706

_sources/edifice.rst.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,16 @@ which has child Elements representing different parts of your application.
193193
Dynamic Rendering
194194
^^^^^^^^^^^^^^^^^
195195

196-
For dynamism, use conditions and loops in your :func:`@component <component>`
197-
render function.
198-
The conditions and loops can depend on **props** or **state**. For example,
196+
For dynamism, use Python control flow
197+
statements :code:`if` :code:`for` :code:`match` in
198+
your :func:`@component <component>` render function.
199+
The control flow statements can depend on **props** or **state**. For example,
199200
this :func:`@component <component>` will render input fields only while
200201
the **props** indicate that they are wanted.
201202

203+
- When the :code:`want_username` **prop** becomes :code:`True` then the entire username subtree will be added.
204+
- When the :code:`want_username` **prop** becomes :code:`False` then the entire username subtree will be removed.
205+
202206
.. code-block:: python
203207
204208
@component

_sources/index.rst.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ Edifice programs are written in Python.
153153

154154
Because Edifice programs are only Python, binding to the
155155
UI is much more straightforward.
156-
Edifice makes it easy to dynamically create, mutate, shuffle, and destroy sections of the UI.
156+
Edifice makes it easy to dynamically create, mutate, shuffle, and destroy
157+
sections of the UI with Python control flow statements
158+
:code:`if` :code:`for` :code:`match`.
157159
Qt Quick assumes a much more static interface.
158160

159161
Qt Quick is like DOM + HTML + JavaScript, whereas Edifice is like React.

edifice.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,16 @@ <h2>Declaring Element Trees<a class="headerlink" href="#declaring-element-trees"
554554
which has child Elements representing different parts of your application.</p>
555555
<section id="dynamic-rendering">
556556
<h3>Dynamic Rendering<a class="headerlink" href="#dynamic-rendering" title="Link to this heading">#</a></h3>
557-
<p>For dynamism, use conditions and loops in your <a class="reference internal" href="stubs/edifice.component.html#edifice.component" title="edifice.component"><code class="xref py py-func docutils literal notranslate"><span class="pre">&#64;component</span></code></a>
558-
render function.
559-
The conditions and loops can depend on <strong>props</strong> or <strong>state</strong>. For example,
557+
<p>For dynamism, use Python control flow
558+
statements <code class="code docutils literal notranslate"><span class="pre">if</span></code> <code class="code docutils literal notranslate"><span class="pre">for</span></code> <code class="code docutils literal notranslate"><span class="pre">match</span></code> in
559+
your <a class="reference internal" href="stubs/edifice.component.html#edifice.component" title="edifice.component"><code class="xref py py-func docutils literal notranslate"><span class="pre">&#64;component</span></code></a> render function.
560+
The control flow statements can depend on <strong>props</strong> or <strong>state</strong>. For example,
560561
this <a class="reference internal" href="stubs/edifice.component.html#edifice.component" title="edifice.component"><code class="xref py py-func docutils literal notranslate"><span class="pre">&#64;component</span></code></a> will render input fields only while
561562
the <strong>props</strong> indicate that they are wanted.</p>
563+
<ul class="simple">
564+
<li><p>When the <code class="code docutils literal notranslate"><span class="pre">want_username</span></code> <strong>prop</strong> becomes <code class="code docutils literal notranslate"><span class="pre">True</span></code> then the entire username subtree will be added.</p></li>
565+
<li><p>When the <code class="code docutils literal notranslate"><span class="pre">want_username</span></code> <strong>prop</strong> becomes <code class="code docutils literal notranslate"><span class="pre">False</span></code> then the entire username subtree will be removed.</p></li>
566+
</ul>
562567
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nd">@component</span>
563568
<span class="k">def</span> <span class="nf">MyApp</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">want_username</span><span class="p">:</span><span class="nb">bool</span><span class="p">,</span> <span class="n">want_email</span><span class="p">:</span><span class="nb">bool</span><span class="p">):</span>
564569
<span class="k">with</span> <span class="n">Window</span><span class="p">():</span>

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,9 @@ <h3>Edifice vs. Qt Quick<a class="headerlink" href="#edifice-vs-qt-quick" title=
507507
<p>Edifice programs are written in Python.</p>
508508
<p>Because Edifice programs are only Python, binding to the
509509
UI is much more straightforward.
510-
Edifice makes it easy to dynamically create, mutate, shuffle, and destroy sections of the UI.
510+
Edifice makes it easy to dynamically create, mutate, shuffle, and destroy
511+
sections of the UI with Python control flow statements
512+
<code class="code docutils literal notranslate"><span class="pre">if</span></code> <code class="code docutils literal notranslate"><span class="pre">for</span></code> <code class="code docutils literal notranslate"><span class="pre">match</span></code>.
511513
Qt Quick assumes a much more static interface.</p>
512514
<p>Qt Quick is like DOM + HTML + JavaScript, whereas Edifice is like React.
513515
QML and HTML are both declarative UI languages but

objects.inv

14 Bytes
Binary file not shown.

run_subprocess_with_callback.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,12 @@ <h2>PyInstaller<a class="headerlink" href="#pyinstaller" title="Link to this hea
591591
<a class="reference external" href="https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html#when-to-call-multiprocessing-freeze-support">before the __main__ imports</a>
592592
so that the spawn Process starts up faster.</p>
593593
</section>
594+
<section id="independence">
595+
<h2>Independence<a class="headerlink" href="#independence" title="Link to this heading">#</a></h2>
596+
<p>This <a class="reference internal" href="#edifice.run_subprocess_with_callback" title="edifice.run_subprocess_with_callback"><code class="xref py py-func docutils literal notranslate"><span class="pre">run_subprocess_with_callback()</span></code></a> module depends only on the
597+
Python standard library so this module file can be copied and pasted into
598+
another project without depending on the Edifice package.</p>
599+
</section>
594600
</dd></dl>
595601

596602
</section>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)