Skip to content

nathom/mdwrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdwrap

A small Rust program that wraps markdown files. Uses the comrak AST library so that rendering remains accurate.

Usage

Write wrapped input.md to output.md.

mdwrap -f input.md -o output.md

Write wrapped markdown from stdin to stdout

mdwrap

Use with (neo)vim

As a vim command

%!mdwrap

With formatter.nvim and lazy.nvim (plugin manager).

local function wrapper()
	return {
		exe = "mdwrap",
		args = { "-l", "70" }, -- or whatever line width you want
		stdin = true,
	}
end

return {
	"mhartington/formatter.nvim",
	config = function(plugin)
		local formatter_setup = {
			logging = false,
			filetype = {
				markdown = { wrapper },
			},
		}
		require("formatter").setup(formatter_setup)
	end,
	cmd = "FormatWrite",
 }

About

A markdown formatter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages