<?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: ...</title>
    <description>The latest articles on DEV Community by ... (@terminalkitten).</description>
    <link>https://dev.to/terminalkitten</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F304816%2Fc86b2148-2371-4e92-94d7-b99ccc5eaf2c.jpeg</url>
      <title>DEV Community: ...</title>
      <link>https://dev.to/terminalkitten</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/terminalkitten"/>
    <language>en</language>
    <item>
      <title>dokk: a tiny docs generator I built for my own Python libraries</title>
      <dc:creator>...</dc:creator>
      <pubDate>Mon, 19 Oct 2026 20:30:26 +0000</pubDate>
      <link>https://dev.to/terminalkitten/dokk-a-tiny-docs-generator-in-python-522g</link>
      <guid>https://dev.to/terminalkitten/dokk-a-tiny-docs-generator-in-python-522g</guid>
      <description>&lt;p&gt;I maintain a handful of small Python libraries. None of them is big, but every one of them needs documentation: how to install it, a quick start, a few guides, the options. And every time, setting up the docs took longer than it should.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I built it
&lt;/h2&gt;

&lt;p&gt;The tools I tried are good, but none of them fit a small library:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sphinx&lt;/strong&gt; is powerful and made for large projects. For a library with ten pages, I spent more time on &lt;code&gt;conf.py&lt;/code&gt;, extensions and reStructuredText than on the docs themselves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MkDocs&lt;/strong&gt; comes closest, and most projects use it with Material for MkDocs. It is a great, complete theme, but this one is personal: the Material look never did it for me. I wanted something quieter and cleaner.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docusaurus, Starlight and VitePress&lt;/strong&gt; produce beautiful sites, but they bring a JavaScript toolchain into a Python project, just for the docs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I wanted was simple: &lt;code&gt;pip install&lt;/code&gt; one thing, write Markdown in a &lt;code&gt;docs/&lt;/code&gt; folder, push, and get a site that looks good and has search and dark mode, without assembling anything. I also wanted a tool small enough that I could read all of it.&lt;/p&gt;

&lt;p&gt;That became &lt;a href="https://terminalkitten.github.io/dokk/" rel="noopener noreferrer"&gt;dokk&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It is about 2,000 lines of Python code. You give it a folder of Markdown and it writes plain HTML: a sidebar from your folders, search, dark mode, code highlighting and a set of components, all at build time. There are no plugins to choose and nothing to configure before the first page works.&lt;/p&gt;

&lt;p&gt;It is deliberately not everything. dokk does not generate API docs from docstrings, and there is no plugin system. If you need those, Sphinx and MkDocs are still the right tools. If you want good-looking docs for a small project in ten minutes, read on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tutorial: docs for a small library
&lt;/h2&gt;

&lt;p&gt;We will add docs to a small, made-up library called &lt;strong&gt;slugkit&lt;/strong&gt;, which turns text into URL slugs. Use your own project instead: the steps are the same.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Install dokk
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s2"&gt;"dokk[serve,search]"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;serve&lt;/code&gt; adds the dev server with live reload, &lt;code&gt;search&lt;/code&gt; adds full-text search (&lt;a href="https://pagefind.app" rel="noopener noreferrer"&gt;Pagefind&lt;/a&gt;). Both are optional; plain &lt;code&gt;pip install dokk&lt;/code&gt; builds sites without them.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Create the site
&lt;/h3&gt;

&lt;p&gt;In the root of your repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokk init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates four things:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dokk.toml                      title and settings
docs/index.md                  the home page
.gitignore                     .dokk/ added (the build output)
.github/workflows/docs.yml     publishes the site to GitHub Pages
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;init&lt;/code&gt; never overwrites your files; an existing &lt;code&gt;.gitignore&lt;/code&gt; only gets the &lt;code&gt;.dokk/&lt;/code&gt; line added.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Start writing
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokk serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;a href="http://127.0.0.1:8002/" rel="noopener noreferrer"&gt;http://127.0.0.1:8002/&lt;/a&gt; and edit &lt;code&gt;docs/index.md&lt;/code&gt;. The page reloads every time you save.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Add pages and folders
&lt;/h3&gt;

&lt;p&gt;Every &lt;code&gt;.md&lt;/code&gt; file is a page, and every folder becomes a group in the sidebar. For slugkit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docs/
  index.md
  getting-started/
    index.md
  guides/
    unicode.md
  reference/
    api.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A page's title comes from its first &lt;code&gt;# Heading&lt;/code&gt;, or from front matter, where you can also set its place in the sidebar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Getting&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;started"&lt;/span&gt;
&lt;span class="na"&gt;sidebar&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;order&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Links between pages are plain relative Markdown links, such as &lt;code&gt;[the guides](../guides/unicode.md)&lt;/code&gt;. dokk turns them into the right URLs, and tells you when one is broken.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Use components
&lt;/h3&gt;

&lt;p&gt;Components are short Markdown blocks, so your docs stay readable on GitHub and in any editor. The getting-started page of slugkit uses three of them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;::install[slugkit]

:::steps
&lt;span class="p"&gt;1.&lt;/span&gt; Install slugkit.
&lt;span class="p"&gt;2.&lt;/span&gt; Import it: &lt;span class="sb"&gt;`from slugkit import slugify`&lt;/span&gt;.
&lt;span class="p"&gt;3.&lt;/span&gt; Call &lt;span class="sb"&gt;`slugify("Hello World")`&lt;/span&gt;.
:::

:::tip
Next, read the &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;guides&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;../guides/unicode.md&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;.
:::
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;::install&lt;/code&gt; shows the pip, uv and poetry commands as tabs, and remembers which one the reader picked across the whole site. There are also tabs, cards, callouts, file trees, badges, images, and components for AI projects such as model cards, chats and tool schemas. The &lt;a href="https://terminalkitten.github.io/dokk/guides/components/" rel="noopener noreferrer"&gt;components guide&lt;/a&gt; shows them all.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Check before you publish
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokk check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This builds the site and reports broken links, missing anchors and pages without a title, each with the file it is in. It is also the first step of the GitHub workflow, so a broken link never reaches your live docs.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Configure the site
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;dokk.toml&lt;/code&gt; needs only a title. A few more lines make it yours:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="py"&gt;title&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"slugkit"&lt;/span&gt;
&lt;span class="py"&gt;site_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://you.github.io/slugkit/"&lt;/span&gt;

&lt;span class="nn"&gt;[theme]&lt;/span&gt;
&lt;span class="py"&gt;color&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"blue"&lt;/span&gt;

&lt;span class="nn"&gt;[links]&lt;/span&gt;
&lt;span class="py"&gt;github&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://github.com/you/slugkit"&lt;/span&gt;
&lt;span class="py"&gt;edit_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://github.com/you/slugkit/edit/main/docs/{path}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;site_url&lt;/code&gt; gives you a sitemap and correct links on GitHub Pages. &lt;code&gt;color&lt;/code&gt; picks one of the shadcn/ui accent colors; try them all on the &lt;a href="https://terminalkitten.github.io/dokk/guides/themes/showcase/" rel="noopener noreferrer"&gt;theme showcase&lt;/a&gt;. The links add a GitHub icon in the header and an "Edit this page" link under every page.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Publish
&lt;/h3&gt;

&lt;p&gt;Push to GitHub, then go to &lt;strong&gt;Settings → Pages&lt;/strong&gt; and set &lt;strong&gt;Source&lt;/strong&gt; to &lt;strong&gt;GitHub Actions&lt;/strong&gt;. The workflow from &lt;code&gt;dokk init&lt;/code&gt; builds the site on every push to &lt;code&gt;main&lt;/code&gt; and publishes it. That's it: your docs are live.&lt;/p&gt;

&lt;h3&gt;
  
  
  Optional: keep your Markdown tidy
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;dokk format&lt;/code&gt; formats every page, so lists, tables and spacing look the same everywhere. It knows dokk's Markdown, so your components, front matter and tables stay intact:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s2"&gt;"dokk[format]"&lt;/span&gt;
dokk format
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;dokk format --check&lt;/code&gt; changes nothing and fails when a page is not formatted, which makes it a good fit for CI or a pre-commit hook. Under the hood it is &lt;a href="https://github.com/hukkin/mdformat" rel="noopener noreferrer"&gt;mdformat&lt;/a&gt; with &lt;a href="https://pypi.org/project/mdformat-directives/" rel="noopener noreferrer"&gt;mdformat-directives&lt;/a&gt;, a plugin I wrote alongside dokk.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you get
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A sidebar from your folders, or arranged by hand in &lt;code&gt;dokk.toml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Search, dark mode and code highlighting, with no JavaScript framework.&lt;/li&gt;
&lt;li&gt;Plain HTML with every asset bundled: no CDN, no tracking. It works on any static host.&lt;/li&gt;
&lt;li&gt;A Markdown copy of every page and an optional &lt;code&gt;llms.txt&lt;/code&gt;, so AI tools can read your docs too.&lt;/li&gt;
&lt;li&gt;Fast builds: a thousand pages in about a second and a half.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://terminalkitten.github.io/dokk/" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt;, built with dokk itself&lt;/li&gt;
&lt;li&gt;&lt;a href="https://terminalkitten.github.io/dokk/getting-started/" rel="noopener noreferrer"&gt;Quick start&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://terminalkitten.github.io/dokk/guides/components/" rel="noopener noreferrer"&gt;Components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://terminalkitten.github.io/dokk/examples/" rel="noopener noreferrer"&gt;Example pages&lt;/a&gt;: a CLI tool, a library reference, a changelog, an FAQ and AI projects&lt;/li&gt;
&lt;li&gt;&lt;a href="https://terminalkitten.github.io/dokk/guides/themes/showcase/" rel="noopener noreferrer"&gt;Theme showcase&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/terminalkitten/dokk" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; and &lt;a href="https://pypi.org/project/dokk/" rel="noopener noreferrer"&gt;PyPI&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://basecoatui.com" rel="noopener noreferrer"&gt;Basecoat&lt;/a&gt;, the components and styles behind dokk's look&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pagefind.app" rel="noopener noreferrer"&gt;Pagefind&lt;/a&gt;, the static search engine dokk uses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;dokk is young, so I would love to hear how it works for your project. Open an issue on GitHub with what you miss or what got in your way, or send a pull request.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>documentation</category>
      <category>python</category>
    </item>
  </channel>
</rss>
