Thanks to visit codestin.com
Credit goes to lib.rs

#markdown-parser #cli-parser #markdown

bin+lib roff-cli

Skillful man page to JSON/Markdown converter - human readable, AI-friendly

1 unstable release

0.1.0 Feb 23, 2026

#2336 in Text processing

MIT license

39KB
1K SLoC

Codestin Search App Codestin Search App

man_parser

A Rust parser for roff (man page) files, supporting conversion to JSON and Markdown.

Features

  • tojson: Convert roff/man files to JSON
  • tomd: Convert roff/man files to Markdown
  • bench: Benchmark parser performance on manpath files

Installation

cargo install --path .

Usage

# Convert to JSON
roff tojson file.1

# Pretty-print JSON
roff tojson --pretty file.1

# Convert to Markdown
roff tomd file.1

# Read from stdin
roff tojson -- < file.1
roff tomd -- < file.1

# Benchmark
roff bench                # process first 10 files
roff bench --count 100    # process first 100 files
roff bench --all          # process all manpath files

Library Usage

use man_parser::{parse_roff, to_json, to_markdown};

let input = ".TH TEST 1\n.SH NAME\ntest \\- a test program";
let roff = parse_roff(input);

let json = to_json(&roff);
let md = to_markdown(&roff);

License

Apache-2.0

Dependencies

~265–740KB
~15K SLoC