Skip to content

Commit 1a9fb40

Browse files
committed
Deployed e7a522c with MkDocs version: 1.6.1
1 parent 09fc7ec commit 1a9fb40

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎images/multiple_table_file.jpg‎

-9.83 KB
Loading

‎multiple-outputs/index.html‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@
6767
</span><span id=__span-1-23><a id=__codelineno-1-23 name=__codelineno-1-23 href=#__codelineno-1-23></a>
6868
</span><span id=__span-1-24><a id=__codelineno-1-24 name=__codelineno-1-24 href=#__codelineno-1-24></a> <span class=k>return</span> <span class=p>(</span>
6969
</span><span id=__span-1-25><a id=__codelineno-1-25 name=__codelineno-1-25 href=#__codelineno-1-25></a> <span class=n>users</span><span class=p>,</span> <span class=c1># Table display</span>
70-
</span><span id=__span-1-26><a id=__codelineno-1-26 name=__codelineno-1-26 href=#__codelineno-1-26></a> <span class=s2>&quot;Download CSV below:&quot;</span><span class=p>,</span> <span class=c1># Text</span>
71-
</span><span id=__span-1-27><a id=__codelineno-1-27 name=__codelineno-1-27 href=#__codelineno-1-27></a> <span class=n>csv_file</span> <span class=c1># Download button</span>
72-
</span><span id=__span-1-28><a id=__codelineno-1-28 name=__codelineno-1-28 href=#__codelineno-1-28></a> <span class=p>)</span>
73-
</span><span id=__span-1-29><a id=__codelineno-1-29 name=__codelineno-1-29 href=#__codelineno-1-29></a>
74-
</span><span id=__span-1-30><a id=__codelineno-1-30 name=__codelineno-1-30 href=#__codelineno-1-30></a><span class=n>run</span><span class=p>(</span><span class=n>export_users_report</span><span class=p>)</span>
70+
</span><span id=__span-1-26><a id=__codelineno-1-26 name=__codelineno-1-26 href=#__codelineno-1-26></a> <span class=n>csv_file</span> <span class=c1># Download button</span>
71+
</span><span id=__span-1-27><a id=__codelineno-1-27 name=__codelineno-1-27 href=#__codelineno-1-27></a> <span class=p>)</span>
72+
</span><span id=__span-1-28><a id=__codelineno-1-28 name=__codelineno-1-28 href=#__codelineno-1-28></a>
73+
</span><span id=__span-1-29><a id=__codelineno-1-29 name=__codelineno-1-29 href=#__codelineno-1-29></a><span class=n>run</span><span class=p>(</span><span class=n>export_users_report</span><span class=p>)</span>
7574
</span></code></pre></div></p> <p>Perfect for reports where you want to view AND download data.</p> </div> <div> <p><img alt="Combined Types" src=../images/multiple_table_file.jpg></p> </div> </div> <h2 id=supported-output-types>Supported Output Types</h2> <p>You can combine any of these in a tuple or list:</p> <ul> <li><strong>Text</strong>: Plain strings are displayed as formatted text</li> <li><strong>PIL Images</strong>: Automatically rendered inline</li> <li><strong>Matplotlib Figures</strong>: Converted to images and displayed</li> <li><strong>Tables</strong>: <code>list[dict]</code> or <code>list[tuple]</code> rendered as HTML tables</li> <li><strong>File Downloads</strong>: Show download buttons with filenames</li> <li><strong>Multiple Files</strong>: Lists of <code>FileResponse</code> objects</li> </ul> <h2 id=how-it-works>How It Works</h2> <ul> <li>Return a <strong>tuple</strong> or <strong>list</strong> from your function</li> <li>Each item is processed according to its type</li> <li>All outputs are displayed sequentially in the UI</li> <li>Each output gets its own styled container</li> <li>Works with any combination of types</li> </ul> <h2 id=limitations>Limitations</h2> <ul> <li><strong>No nesting</strong>: Tuples/lists cannot contain other tuples/lists (except valid tables)</li> <li><strong>Valid</strong>: <code>return (table_data, file)</code> where <code>table_data</code> is <code>list[dict]</code></li> <li><strong>Invalid</strong>: <code>return (("text", img), file)</code> - nested tuples not allowed</li> <li><strong>Solution</strong>: Flatten to <code>return ("text", img, file)</code></li> </ul> <h2 id=key-points>Key Points</h2> <ul> <li><strong>Flexible</strong>: Mix text, images, plots, tables, and files freely</li> <li><strong>Simple syntax</strong>: Just return a tuple or list</li> <li><strong>Clean UI</strong>: Each output in its own styled box</li> <li><strong>No configuration</strong>: Works automatically with existing types</li> <li><strong>Tables included</strong>: <code>list[dict]</code> or <code>list[tuple]</code> are automatically detected</li> </ul> <h2 id=whats-next>What's Next?</h2> <p>You've completed all <strong>Output Types</strong>! Explore additional features.</p> <p><strong>Next category:</strong></p> <ul> <li><a href=../function-descriptions/ >Function Descriptions</a> - Display docstrings in the UI</li> <li><a href=../multiple/ >Multiple Functions</a> - Serve multiple functions at once</li> <li><a href=../dark-mode/ >Dark Mode</a> - Automatic theme switching</li> <li><a href=../server-configuration/ >Server Configuration</a> - Customize server settings</li> </ul> </article> </div> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </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 8z"/></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> Made with <a href=https://squidfunk.github.io/mkdocs-material/ target=_blank rel=noopener> Material for MkDocs </a> </div> <div class=md-social> <a href=https://github.com/offerrall/FuncToWeb target=_blank rel=noopener title=github.com class=md-social__link> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 512 512"><!-- Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M173.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M252.8 8C114.1 8 8 113.3 8 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C436.2 457.8 504 362.9 504 252 504 113.3 391.5 8 252.8 8M105.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg> </a> <a href=https://twitter.com/offerrall target=_blank rel=noopener title=twitter.com class=md-social__link> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 512 512"><!-- Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M459.4 151.7c.3 4.5.3 9.1.3 13.6 0 138.7-105.6 298.6-298.6 298.6-59.5 0-114.7-17.2-161.1-47.1 8.4 1 16.6 1.3 25.3 1.3 49.1 0 94.2-16.6 130.3-44.8-46.1-1-84.8-31.2-98.1-72.8 6.5 1 13 1.6 19.8 1.6 9.4 0 18.8-1.3 27.6-3.6-48.1-9.7-84.1-52-84.1-103v-1.3c14 7.8 30.2 12.7 47.4 13.3-28.3-18.8-46.8-51-46.8-87.4 0-19.5 5.2-37.4 14.3-53C87.4 130.8 165 172.4 252.1 176.9c-1.6-7.8-2.6-15.9-2.6-24C249.5 95.1 296.3 48 354.4 48c30.2 0 57.5 12.7 76.7 33.1 23.7-4.5 46.5-13.3 66.6-25.3-7.8 24.4-24.4 44.8-46.1 57.8 21.1-2.3 41.6-8.1 60.4-16.2-14.3 20.8-32.2 39.3-52.6 54.3"/></svg> </a> </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>{"annotate": null, "base": "..", "features": ["navigation.tabs", "navigation.sections", "navigation.indexes", "content.code.copy", "content.code.annotate", "toc.integrate", "navigation.tabs.sticky", "navigation.top", {"hide": ["toc.title"]}], "search": "../assets/javascripts/workers/search.7a47a382.min.js", "tags": null, "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": null}</script> <script src=../assets/javascripts/bundle.e71a0d61.min.js></script> </body> </html>

0 commit comments

Comments
 (0)