<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/plugins-case-study-mdbook-preprocessors-qk5ppofwb" -->

---
title: Plugins case study: mdBook preprocessors | daily.dev
description: mdBook&#x27;s preprocessor plugin mechanism is examined as a case study in plugin infrastructure design. Preprocessors are arbitrary programs registered in...
canonical: https://daily.dev/posts/plugins-case-study-mdbook-preprocessors-qk5ppofwb
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Plugins case study: mdBook preprocessors | daily.dev
og:description: mdBook&#x27;s preprocessor plugin mechanism is examined as a case study in plugin infrastructure design. Preprocessors are arbitrary programs registered in...
og:url: https://daily.dev/posts/plugins-case-study-mdbook-preprocessors-qk5ppofwb
og:image: https://api.daily.dev/og/posts/qK5ppofwb.png
og:image:alt: Plugins case study: mdBook preprocessors
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Plugins case study: mdBook preprocessors

**[Planet Python](https://daily.dev/sources/planetpython)** · 4 min read · 0 upvotes · 0 comments

## Summary

mdBook's preprocessor plugin mechanism is examined as a case study in plugin infrastructure design. Preprocessors are arbitrary programs registered in book.toml that receive the entire book as JSON via stdin, modify it, and return the result via stdout — making them language-agnostic. The post walks through discovery (explicit config), registration (two-phase invocation), hooks (coarse-grained whole-book JSON), and API exposure (Rust-only via the Preprocessor trait). Sample implementations in both Python and Rust are provided, along with a brief look at mdBook's renderer/backend plugin mechanism.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://eli.thegreenplace.net/2025/plugins-case-study-mdbook-preprocessors>

## Similar posts on daily.dev

- [Plugins case study: mdBook preprocessors](https://daily.dev/posts/plugins-case-study-mdbook-preprocessors-d1rmt4oui) · Eli Bendersky · 0 upvotes · 0 comments
- [Plugins case study: Pluggy](https://daily.dev/posts/plugins-case-study-pluggy-1wqotugye) · Eli Bendersky · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#rust](https://daily.dev/tags/rust)

[View this post on daily.dev](https://daily.dev/posts/plugins-case-study-mdbook-preprocessors-qk5ppofwb)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Plugins case study: mdBook preprocessors","url":"https://daily.dev/posts/plugins-case-study-mdbook-preprocessors-qk5ppofwb","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/plugins-case-study-mdbook-preprocessors-qk5ppofwb"},"datePublished":"2026-06-07T01:46:39.668Z","dateModified":"2026-06-07T01:47:01.906Z","description":"mdBook's preprocessor plugin mechanism is examined as a case study in plugin infrastructure design. Preprocessors are arbitrary programs registered in...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/52db1ae87ad6af123d1c0a79f0eab17f?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/52db1ae87ad6af123d1c0a79f0eab17f?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Planet Python","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Planet Python","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/eac3cc584cb043b5a242d13752bd3d0c","url":"https://daily.dev/sources/planetpython"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/plugins-case-study-mdbook-preprocessors-qk5ppofwb","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,rust","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Planet Python","item":"https://daily.dev/sources/planetpython"},{"@type":"ListItem","position":3,"name":"Plugins case study: mdBook preprocessors"}]}
```

