Story Details

  • Show HN: Jq-Like Tool for Markdown

    Posted: 2025-02-23 20:05:49

    mdq is a command-line tool, inspired by jq, that allows users to process and manipulate Markdown files using CSS-like selectors. It can extract specific elements from Markdown, such as headings, paragraphs, or code blocks, and output them in various formats, including Markdown, HTML, and text. This facilitates tasks like extracting specific sections of a document, reformatting content, and generating summaries, offering a powerful way to automate Markdown workflows.

    Summary of Comments ( 10 )
    https://news.ycombinator.com/item?id=43152704

    Hacker News users generally praised mdq for its potential usefulness, comparing it favorably to jq for JSON. Several commenters expressed interest in using it for tasks like extracting links or reformatting Markdown files. Some suggested improvements, such as adding support for YAML frontmatter and improving error handling. Others highlighted the complexities of parsing Markdown reliably due to its flexible nature and the potential challenges of handling variations and edge cases. One user pointed out the limitations of existing markdown parsers and the difficulties in accurately representing markdown as a data structure, while another cautioned against over-engineering the tool for simple tasks that could be accomplished with grep, sed, or awk.