MCPcopy Index your code
hub / github.com/Kunde21/markdownfmt

github.com/Kunde21/markdownfmt @v3.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.1.0 ↗ · + Follow
88 symbols 325 edges 16 files 29 documented · 33% 3 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

markdownfmt

Build Status Go Reference

markdownfmt is a CLI that reformats Markdown files (like gofmt but for Markdown) and a library that you can use to generate well-formed Markdown files.

Features

Installation

CLI

go install github.com/Kunde21/markdownfmt/v3/cmd/markdownfmt@latest

Library

go get github.com/Kunde21/markdownfmt/v3@latest

Usage

usage: markdownfmt [flags] [path ...]
  -d    display diffs instead of rewriting files
  -gofmt
        reformat Go source inside fenced code blocks
  -l    list files whose formatting differs from markdownfmt's
  -list-indent-style value
        style for indenting items inside lists ("aligned" or "uniform")
  -soft-wraps
        wrap lines even on soft line breaks
  -u    write underline headings instead of hashes for levels 1 and 2
  -w    write result to (source) file instead of stdout

The markdownfmt CLI supports the following execution modes:

  • stdout: Write reformatted contents of provided files to stdout. This is the default.
  • write (-w): Reformat and rewrite Markdown files in-place.
  • list (-l): List files that would be modified, but don't change them.
  • diff (-d): Display a diff of modifications that would be made to files, but don't change them.

History

markdownfmt began as a fork of shurcooL/markdownfmt targeting Goldmark instead of Blackfriday. It has since diverged significantly.

Related projects

  • shurcooL/markdownfmt: The project that this forked from.
  • mdox: Builds upon markdownfmt. Adds support for link validation, command execution, and more.

Editor Plugins

Alternatives

  • mdfmt - Fork of markdownfmt that adds front matter support.
  • tidy-markdown - Project with similar goals, but written in JS and based on a slightly different styleguide.

License

MIT License

Extension points exported contracts — how you extend this code

Option (Interface)
Option customizes the behavior of the markdown renderer.
markdown/renderer.go

Core symbols most depended-on inside this repo

Write
called by 59
markdown/writer_indent.go
Run
called by 25
cmd/markdownfmt/main.go
String
called by 16
cmd/markdownfmt/main.go
Push
called by 7
markdown/indent.go
WithListIndentStyle
called by 6
markdown/renderer.go
Indent
called by 5
markdown/indent.go
Whitespace
called by 5
markdown/indent.go
Pop
called by 5
markdown/indent.go

Shape

Function 45
Method 31
Struct 8
TypeAlias 2
FuncType 1
Interface 1

Languages

Go100%

Modules by API surface

markdown/renderer.go26 symbols
cmd/markdownfmt/main.go14 symbols
markdownfmt_test.go9 symbols
markdown/writer_indent.go8 symbols
cmd/markdownfmt/main_test.go7 symbols
markdown/indent.go6 symbols
markdown/indent_test.go4 symbols
markdownfmt.go3 symbols
markdown/list_indent_test.go3 symbols
markdown/write_clean_fuzz_test.go2 symbols
markdown/em_strong_token_test.go2 symbols
markdown/renderer_test.go1 symbols

For agents

$ claude mcp add markdownfmt \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page