<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Leonardo Salas</title>
    <description>The latest articles on DEV Community by Leonardo Salas (@leonardosalasd).</description>
    <link>https://dev.to/leonardosalasd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3870802%2Fc4940737-c509-4a8b-ae07-60efcaf64cc1.jpeg</url>
      <title>DEV Community: Leonardo Salas</title>
      <link>https://dev.to/leonardosalasd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/leonardosalasd"/>
    <language>en</language>
    <item>
      <title>I got tired of LaTeX, so I built a zero-config Python CLI to turn Markdown into premium PDFs</title>
      <dc:creator>Leonardo Salas</dc:creator>
      <pubDate>Fri, 10 Apr 2026 03:08:37 +0000</pubDate>
      <link>https://dev.to/leonardosalasd/i-got-tired-of-latex-so-i-built-a-zero-config-python-cli-to-turn-markdown-into-premium-pdfs-oob</link>
      <guid>https://dev.to/leonardosalasd/i-got-tired-of-latex-so-i-built-a-zero-config-python-cli-to-turn-markdown-into-premium-pdfs-oob</guid>
      <description>&lt;p&gt;Have you ever just wanted to turn your standard &lt;code&gt;README.md&lt;/code&gt; into a nice, academic-looking PDF without having to install a 2GB LaTeX environment or write a 500-line config file? Same here. &lt;/p&gt;

&lt;p&gt;I was tired of dealing with complex setups just to export some documentation, so I built a pure Python solution: &lt;strong&gt;&lt;code&gt;doc-engine-cli&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3x10t6eeqbt3e1i4v76.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3x10t6eeqbt3e1i4v76.gif" alt="doc-engine-cli demo" width="760" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works under the hood
&lt;/h2&gt;

&lt;p&gt;I used &lt;code&gt;mistune&lt;/code&gt; to parse the Markdown AST natively and safely in memory. Then, instead of hooking it up to a classic HTML-to-PDF engine (which usually misplaces margins and page breaks), I routed the parsed blocks directly into the lightning-fast &lt;strong&gt;Typst&lt;/strong&gt; compiler engine via its python bindings.&lt;/p&gt;

&lt;h3&gt;
  
  
  The result:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero friction:&lt;/strong&gt; It automatically detects your &lt;code&gt;README.md&lt;/code&gt; and even extracts your local &lt;code&gt;git config user.name&lt;/code&gt; for the cover page metadata.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Premium Typography:&lt;/strong&gt; I shipped it with default Inter (sans-serif) and Cascadia Code typography to make code blocks look beautiful.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smart elements:&lt;/strong&gt; Dynamic Table of Contents, syntax-highlighted code fences, and proper page breaks out of the box.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it out!
&lt;/h2&gt;

&lt;p&gt;You can install it instantly and securely via &lt;code&gt;pipx&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pipx &lt;span class="nb"&gt;install &lt;/span&gt;doc-engine-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And just run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;doc-engine build --open
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in any folder with a markdown file.&lt;/p&gt;

&lt;p&gt;If you don't even want Python installed, I've also containerized it on GHCR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run --rm -v ${PWD}:/workspace ghcr.io/leonardosalasd/doc-engine-cli:main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'd absolutely love to hear your feedback, bug reports, or feature requests.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🐙 GitHub: leonardosalasd/doc-engine-cli&lt;/li&gt;
&lt;li&gt;📦 PyPI: doc-engine-cli on PyPI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me know what you think of the Typst integration!&lt;/p&gt;

</description>
      <category>python</category>
      <category>opensource</category>
      <category>productivity</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
