文档

MD Formatter

试用

Format and lint markdown files for consistency and readability. Use when Codex needs to normalize markdown documents, fix heading levels, standardize link fo...

它能做什么

Format and lint markdown files for consistency and readability. Use when Codex needs to normalize markdown documents, fix heading levels, standardize link formats, add missing alt text, or apply consistent formatting conventions across markdown files. Triggers include "format markdown", "clean up this md", "lint markdown", "normalize headings in this file".

技能文档

MD Formatter

Format and lint markdown files with consistent conventions.

Quick Start

Run the formatter script on a file:

python3 scripts/format_md.py 

The script performs:

  1. Heading normalization: Promote headings to start at #, ensure no level skips (e.g., ####), convert ===/--- underlined headings to # style.
  2. Link formatting: Convert `` to [url](https://url) when appropriate, standardize bare URLs.
  3. Trailing whitespace: Remove it.
  4. Bold/italic consistency: Prefer **bold** over __bold__, *italic* over _italic_.
  5. Empty lines: Ensure one blank line before and after headings and code blocks.

Workflow

1. Inspect the file

Read the markdown file to understand its current state.

2. Run the formatter script

Execute scripts/format_md.py with the target path. Check the diff output.

3. Verify formatting

Read the formatted file to confirm changes are correct and no content was accidentally altered.

4. Iterate if needed

For complex documents, manually review or adjust formatting the script doesn't cover.

References

See references/heading-syntax.md for markdown heading specification details.

相关技能

Check markdown files for common issues including heading structure, link validity, list formatting, trailing whitespace, and code block language tags. Use when reviewing documentation, README files, or any .md file for consistency and best practices.

让 Markdown 在 GitHub、MDX、Pandoc、文档站、Slack、Notion 等解析器中正确渲染,并定位修复具体损坏位置。

296 次安装7 星标

Markdown note formatting and cleanup utility. Use when cleaning up raw notes, standardizing markdown structure, fixing heading hierarchies, or converting messy pasted text into clean, well-structured markdown documents.

1 次安装

Generate and update table-of-contents (TOC) sections for Markdown files. Use when working with long Markdown documents, READMEs, or technical docs that need a navigable TOC, or when asked to add/update a table of contents in a .md file.

1 次安装

Generate a Table of Contents (TOC) from Markdown headings. Supports heading extraction, multiple output formats, and configurable level filtering.

作者 haidong14 次安装

Read an attached Markdown document, analyze and summarize it, then generate a minimalist image from the summary using the default image model. Ask the user for aspect ratio when needed, and support social-banner formats such as 5:2 and 5:4. Use when the user wants a document turned into a simple tutorial-style visual with handwritten whiteboard aesthetics.

2 次安装