<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pygments - 标签 | 飞污熊小站</title><link>https://xiongneng.me/tags/pygments/</link><description>飞污熊小站</description><generator>Hugo 0.166.0 &amp; FixIt v0.4.6-20260512073637-464c4659</generator><language>zh-CN</language><managingEditor>yidao620@163.com (XiongNeng)</managingEditor><webMaster>yidao620@163.com (XiongNeng)</webMaster><copyright>XiongNeng</copyright><lastBuildDate>Sat, 26 Sep 2026 03:04:43 +0000</lastBuildDate><atom:link href="https://xiongneng.me/tags/pygments/index.xml" rel="self" type="application/rss+xml"/><item><title>使用Django6.1开发博客（4） - Markdown与代码高亮</title><link>https://xiongneng.me/posts/python/simpleblog/django61-blog-04-markdown-code/</link><pubDate>Fri, 25 Sep 2026 21:00:00 +0800</pubDate><author>yidao620@163.com (XiongNeng)</author><guid>https://xiongneng.me/posts/python/simpleblog/django61-blog-04-markdown-code/</guid><category domain="https://xiongneng.me/categories/python/">Python</category><description>&lt;p&gt;上一篇文章的详情页能打开，但正文只是几行普通段落。技术博客离不开 fenced code、表格和标题层级，纯文本很快就会不够用。我接着把 Markdown 渲染接进详情页，并让代码块得到 Pygments 高亮。&lt;/p&gt;&#10;&lt;p&gt;&lt;img loading="lazy" src='https://static.xiongneng.me/markdown-component-pipeline-20260926000000.png' alt="https://static.xiongneng.me/markdown-component-pipeline-20260926000000.png"&gt;&lt;/p&gt;&#10;&lt;p&gt;整条链路很短。作者在后台保存 Markdown，数据库只保存原始文本；详情页请求到达时，模板过滤器把它渲染成 HTML；CodeHilite 给代码块加上类名；页面加载预生成的 Pygments CSS，浏览器完成着色。&lt;/p&gt;</description></item></channel></rss>