Markdown
Markdown 是一种轻量级标记语言,使用纯文本格式语法来创建结构化文档。它可以转换为 HTML,是 README 文件、文档、博客和笔记应用的标准。Markdown 以源代码形式的可读性为优先。
MIME 类型
text/markdown
类型
文本
压缩
无损
优点
- + Extremely simple syntax that anyone can learn in minutes
- + Version-control friendly — clean diffs in Git
- + Renders beautifully on GitHub, GitLab, and most platforms
- + Converts easily to HTML, PDF, DOCX, and other formats
缺点
- − Limited formatting — no native support for tables of contents or footnotes
- − Flavor fragmentation (CommonMark, GFM, MDX) creates inconsistencies
- − No built-in styling — appearance depends on the renderer
何时使用 .MD
将 Markdown 用于文档、README 文件、博客文章、笔记以及任何受益于版本控制和纯文本编辑的内容。
技术细节
Markdown 文件是纯文本,使用 # 表示标题、* 表示强调、[ ] 表示链接等符号。Markdown 处理器(如 marked、markdown-it)将语法解析为 AST 并渲染 HTML 输出。
历史
John Gruber 于 2004 年与 Aaron Swartz 共同创建了 Markdown,旨在开发一种以纯文本形式可读并可轻松转换为 HTML 的格式。CommonMark (2014) 和 GitHub Flavored Markdown 对语法进行了标准化。
从 .MD 转换
转换为 .MD
相关格式
相关术语
Learn More
JSON vs YAML vs TOML: Choosing a Configuration Format
Configuration files are the backbone of modern applications. JSON, YAML, and TOML each offer different trade-offs between readability, complexity, and …
Text Encoding Explained: UTF-8, ASCII, and Beyond
Text encoding determines how characters are stored as bytes. Understanding UTF-8, ASCII, and other encodings prevents garbled text, mojibake, and …
How to Format and Validate JSON Data
Malformed JSON causes silent failures in APIs and configuration files. Learn how to format, validate, and debug JSON documents to …
Regular Expressions: A Practical Guide for Text Processing
Regular expressions are powerful patterns for searching, matching, and transforming text. This guide covers the most useful regex patterns with …
Base64 Encoding: How It Works and When to Use It
Base64 converts binary data into ASCII text, making it safe for transmission through text-based systems. Learn when Base64 is the …
Markdown vs Rich Text vs Plain Text: When to Use Each
Choosing between Markdown, rich text, and plain text affects portability, readability, and editing workflow. This comparison helps you select the …