惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
腾讯CDC
aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
Engineering at Meta
Engineering at Meta
C
Check Point Blog
N
Netflix TechBlog - Medium
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
WordPress大学
WordPress大学
博客园 - 司徒正美

Stonecharioteer on Tech

I Traced My Traffic Through a Home Tailscale Exit Node What Was I Reading Last? In Three Not-So-Easy Pieces Dogfooding Is Hard Code blocks in your books, finally GoForGo v0.9.0 Merrilin - We built an app to read books I use a Macbook now Data Structures & Algorithms - Preparing for Interviews Using a local DNS namespace for local service discovery Direction KOllector - Publishing KOReader Highlights gbt: branches touched in the last 24 hours A Soiree into Symbols in Ruby Some Smalltalk about Ruby Loops Ruby Blocks Returning from Ruby Blocks, Procs and Lambdas My Linux Laptop Finally Works: How Claude Helped Me Fix Years of Annoyances TIL: Watchexec - Modern File Watching for Development Workflows A Less Busy Mind GoForGo - Learn Go through live examples Migrating My Old Blog to Hugo with Claude The Qtile Window Manager: A Python-Powered Tiling Experience Read the RFCs that Built the Internet Py-x-Protobuf - Or How I Learned to Stop Worrying and Love Protocol Buffers Python Reverse a List New Beginnings Leaving ChainSafe Systems Screen Lock for Cinnamon Desktop using Zenity and Terminal Commands Crews Not Teams A System for Getting Better at LeetCode
Code blocks in your books, finally
2026-03-16 · via Stonecharioteer on Tech

Why Does Code Look Horrible in Books?

I’ll say it. Code looks like shit in books. Publishers strip out all the color, they seldom add line numbers, they wrap code at weird spots, trim it even, and programming books look terrible.

I have always used PDF for tech books. It’s for a simple reason, really. Code blocks look ugly in EPUB.

Python tokenizer code listing in a PDF — monospace, no syntax highlighting

Not that they look great in PDF either. It depends on the publisher, and there are a lot of variations in how they choose to render code blocks, honestly. Most just choose to render them indentically. I never understood why though, at least in PDF, they should render with color. In EPUB, you know that there’s a lot of the styling that happens at the client-side.

Like an editor

I wanted my code blocks to look like the image above, like it would in an editor.

That’s an editor, right? Right?

No.

LLM book with Python code blocks rendered in Merrilin on phone

Merrilin, now with support for coding books

I can now proudly say that Merrilin.ai supports tech books across 67 themes. It renders code blocks beautifully, extracting them even out of PDFs and shows them in an editor-style dialog. Or, copy directly to your clipboard!

Inline Code Rendering in PDFs

Merrilin extracts code blocks from PDFs and renders them with full syntax highlighting. Tap any code block to open an editor-style dialog, or use the copy button to grab the code directly.

SQL code rendered inline showing Updates and Deletions sections

SQL transactions with inline code and Note admonition

Copy Code with One Tap

Open any code block in the editor dialog to see it with line numbers and full syntax highlighting. The Copy Code button lets you paste it straight into your editor.

Rust code in editor-style dialog with Copy Code button

But wait, in EPUBs, you don’t even need to open a dialog to see the code in color. Merrilin renders codeblocks directly in the EPUBs, supporting all known languages directly.

EPUB Code Blocks — No Dialog Needed

In EPUBs, code blocks are rendered directly in the reading view with full syntax highlighting. No need to open a separate dialog — just read the code in color as part of the text.

Python code blocks rendered inline with syntax highlighting

This works across themes, so if you’re reading books on software programming, Merrilin now lets you read them and see the code beautifully, like you would in an editor.

67 Themes, All with Code Support

Every theme in Merrilin supports syntax highlighting for code blocks. Whether you prefer a dark or light reading experience, your code will always be rendered beautifully.

SQL INSERT statements rendered with syntax highlighting in dark theme