<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Documentation | Bas Nijholt</title><link>https://www.nijho.lt/tag/documentation/</link><atom:link href="https://www.nijho.lt/tag/documentation/index.xml" rel="self" type="application/rss+xml"/><description>Documentation</description><generator>Hugo</generator><language>en-us</language><copyright>© 2026</copyright><lastBuildDate>Sat, 04 Jan 2025 00:00:00 +0000</lastBuildDate><image><url>https://www.nijho.lt/media/icon_hu_408a8f6cef43e327.png</url><title>Documentation</title><link>https://www.nijho.lt/tag/documentation/</link></image><item><title>tuitorial: terminal-based interactive code tutorials 📚</title><link>https://www.nijho.lt/post/tuitorial/</link><pubDate>Sat, 04 Jan 2025 00:00:00 +0000</pubDate><guid isPermaLink="false">/post/tuitorial/</guid><description>&lt;p&gt;While trying to demonstrate my &lt;a href="https://github.com/pipefunc/pipefunc" target="_blank" rel="noopener"&gt;&lt;code&gt;pipefunc&lt;/code&gt; package&lt;/a&gt; (a tool for automating computational pipelines), I hit a common presentation problem: how do you effectively walk through code without endless repetition?&lt;/p&gt;&#10;&lt;p&gt;Traditional presentation tools like PowerPoint force you to copy-paste the same code snippets multiple times just to highlight different parts. Jupyter notebooks are great for self-paced learning but clunky for live presentations (too much text that the viewer will try to read). I needed something that would let me define code once and create multiple views highlighting different aspects.&lt;/p&gt;&#10;&lt;p&gt;So, during the holiday season, I did what any reasonable developer would do: procrastinated on my actual work and built a new tool instead!&lt;/p&gt;&#10;&lt;h2 id="what-is-tuitorial"&gt;What is tuitorial? &lt;a class="anchor" href="#what-is-tuitorial" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/basnijholt/tuitorial" target="_blank" rel="noopener"&gt;&lt;code&gt;tuitorial&lt;/code&gt;&lt;/a&gt; is a Python package that lets you create interactive, terminal-based code tutorials where you define the code ONCE, then create steps that highlight different parts based on rules (like regex patterns or line numbers). No more copy-paste presentations!&lt;/p&gt;&#10;&lt;h2 id="key-features"&gt;Key Features &lt;a class="anchor" href="#key-features" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Write code once&lt;/strong&gt;: Define your code once, then create multiple views highlighting different aspects&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Rich highlighting options&lt;/strong&gt;: From simple literal matches to complex regex patterns&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Interactive navigation&lt;/strong&gt;: Intuitive keyboard controls for stepping through tutorials&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Beautiful terminal UI&lt;/strong&gt;: Powered by Textual for a polished look&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Flexible configuration&lt;/strong&gt;: Choose between Python API or YAML format&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Development mode&lt;/strong&gt;: Live reloading for quick iterations&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="see-it-in-action"&gt;See It in Action &lt;a class="anchor" href="#see-it-in-action" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Here&amp;rsquo;s a demo of &lt;a href="https://github.com/basnijholt/tuitorial" target="_blank" rel="noopener"&gt;&lt;code&gt;tuitorial&lt;/code&gt;&lt;/a&gt; explaining &lt;a href="https://github.com/pipefunc/pipefunc" target="_blank" rel="noopener"&gt;&lt;code&gt;pipefunc&lt;/code&gt;&lt;/a&gt; - a package that lets you create computational pipelines with automatic parallelization, caching, and dependency management:&lt;/p&gt;&#10;&#10;&lt;script type="module" src="https://www.nijho.lt/js/reduced-motion.3dfea0061c17c60a9a200c61ef1e3b3e98d5bdc4eaa4e0a64b3ed2a4d13c72fd.js" integrity="sha256-Pf6gBhwXxgqaIAxh7x47PpjVvcTqpOCmSz7SpNE8cv0=" crossorigin="anonymous"&gt;&lt;/script&gt;&#10;&lt;video controls autoplay muted playsinline loop preload="metadata"&gt;&#10;&lt;source src="https://www.nijho.lt/post/tuitorial/tuitorial-0.4.0.mp4" type="video/mp4"&gt;&#10;&lt;/video&gt;&#10;&#10;&lt;h2 id="who-should-use-this"&gt;Who Should Use This? &lt;a class="anchor" href="#who-should-use-this" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;While &lt;a href="https://github.com/basnijholt/tuitorial" target="_blank" rel="noopener"&gt;&lt;code&gt;tuitorial&lt;/code&gt;&lt;/a&gt; isn&amp;rsquo;t for everyone, it&amp;rsquo;s perfect for:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Developers giving technical presentations&lt;/li&gt;&#10;&lt;li&gt;Teachers explaining code concepts&lt;/li&gt;&#10;&lt;li&gt;Teams creating interactive documentation&lt;/li&gt;&#10;&lt;li&gt;Anyone who loves terminal-based tools&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="getting-started"&gt;Getting Started &lt;a class="anchor" href="#getting-started" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;aside class="callout callout-note"&gt;&lt;svg class="ico" viewBox="0 0 256 256" aria-hidden="true"&gt;&lt;path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"/&gt;&lt;/svg&gt;&lt;div&gt;Have &lt;code&gt;uv&lt;/code&gt; installed? Run the following command to see a quick example:&#10;&lt;code&gt;uvx tuitorial https://raw.githubusercontent.com/basnijholt/tuitorial/refs/heads/main/examples/pipefunc.yaml&lt;/code&gt;&lt;/div&gt;&lt;/aside&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pip install tuitorial&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Check out the &lt;a href="https://github.com/basnijholt/tuitorial" target="_blank" rel="noopener"&gt;documentation&lt;/a&gt; for examples and detailed usage instructions.&lt;/p&gt;&#10;&lt;h2 id="final-thoughts"&gt;Final Thoughts &lt;a class="anchor" href="#final-thoughts" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Building &lt;a href="https://github.com/basnijholt/tuitorial" target="_blank" rel="noopener"&gt;&lt;code&gt;tuitorial&lt;/code&gt;&lt;/a&gt; was a lot of fun!&#10;While it may not replace PowerPoint for your next business presentation, it offers a unique approach to code demonstrations that I hope others will find useful.&lt;/p&gt;&#10;&lt;p&gt;Try it out and let me know what you think!&lt;/p&gt;&#10;</description></item><item><title>markdown-code-runner 📝</title><link>https://www.nijho.lt/post/advent-of-open-source/05-markdown-code-runner/</link><pubDate>Thu, 05 Dec 2024 00:00:00 +0000</pubDate><guid isPermaLink="false">/post/advent-of-open-source/05-markdown-code-runner/</guid><description>&lt;p&gt;(See my &lt;a href="../"&gt;intro post&lt;/a&gt;)&lt;/p&gt;&#10;&lt;p&gt;Documentation should be as close to the code as possible - that&amp;rsquo;s the principle of &amp;ldquo;information locality.&amp;rdquo; But how do you keep code examples and their outputs in sync? Enter markdown-code-runner, a tool that executes code blocks within Markdown files and updates their output in-place!&lt;/p&gt;&#10;&lt;h2 id="-origin-story"&gt;📖 Origin Story &lt;a class="anchor" href="#-origin-story" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;While maintaining various open source and work projects, I found myself constantly updating README or Wiki files with new command outputs, updated tables, and fresh examples. This manual process was error-prone and tedious. Instead of using external templating files or more advanced documentation generators like Sphinx and Quarto (which are often overkill for single-page projects), I wanted something simpler: code and its output living together in the same Markdown file, always in sync.&lt;/p&gt;&#10;&lt;h2 id="-technical-highlights"&gt;🔧 Technical Highlights &lt;a class="anchor" href="#-technical-highlights" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Executes code blocks (Python and Bash) within Markdown files&lt;/li&gt;&#10;&lt;li&gt;Updates outputs in-place while preserving the original file structure&lt;/li&gt;&#10;&lt;li&gt;Supports hidden code blocks for generating content without showing the code&lt;/li&gt;&#10;&lt;li&gt;Works with any language by using file code blocks and bash execution&lt;/li&gt;&#10;&lt;li&gt;Zero external dependencies&lt;/li&gt;&#10;&lt;li&gt;GitHub Actions integration for automatic README updates&lt;/li&gt;&#10;&lt;li&gt;Preserves Markdown spec compatibility by hiding code in HTML comments (&lt;code&gt;&amp;lt;!-- CODE HERE --&amp;gt;&lt;/code&gt;)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="-impact"&gt;📊 Impact &lt;a class="anchor" href="#-impact" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;97 GitHub stars&lt;/li&gt;&#10;&lt;li&gt;Used in many of my other projects for auto-generating:&#10;&lt;ul&gt;&#10;&lt;li&gt;Command-line help texts&lt;/li&gt;&#10;&lt;li&gt;API documentation&lt;/li&gt;&#10;&lt;li&gt;Example outputs&lt;/li&gt;&#10;&lt;li&gt;Data tables&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Helps maintain &amp;ldquo;information locality&amp;rdquo; - everything needed is in one file&lt;/li&gt;&#10;&lt;li&gt;Enables dynamic documentation that stays up-to-date automatically&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="-challenges-and-solutions"&gt;🎯 Challenges and Solutions &lt;a class="anchor" href="#-challenges-and-solutions" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Parsing Markdown without breaking its structure&lt;/li&gt;&#10;&lt;li&gt;Supporting multiple programming languages&lt;/li&gt;&#10;&lt;li&gt;Making it work seamlessly with GitHub Actions&lt;/li&gt;&#10;&lt;li&gt;Handling complex outputs (tables, images, etc.)&lt;/li&gt;&#10;&lt;li&gt;Maintaining backward compatibility with existing Markdown files&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="-lessons-learned"&gt;💡 Lessons Learned &lt;a class="anchor" href="#-lessons-learned" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Documentation is best when it&amp;rsquo;s close to what it documents&lt;/li&gt;&#10;&lt;li&gt;Automation should be invisible - the tool shouldn&amp;rsquo;t change how you write Markdown&lt;/li&gt;&#10;&lt;li&gt;Sometimes the simplest solution (using HTML comments) is the best&lt;/li&gt;&#10;&lt;li&gt;Good documentation tools should make maintaining docs easier, not harder&lt;/li&gt;&#10;&lt;li&gt;Auto-generated content should be clearly marked as such&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Want to keep your documentation always in sync? Check out &lt;a href="https://github.com/basnijholt/markdown-code-runner" target="_blank" rel="noopener"&gt;markdown-code-runner on GitHub&lt;/a&gt;!&lt;/p&gt;&#10;&lt;p&gt;#OpenSource #Python #Documentation #DevTools #Programming&lt;/p&gt;&#10;</description></item></channel></rss>