Elixir bindings for mq, a jq-like command-line tool for Markdown processing.
- Process markdown, MDX, HTML, and plain text
- Full mq query language support
- Multiple input and output format options
- Configurable rendering options
- Fast Rust-powered NIF implementation
Add mq to your list of dependencies in mix.exs:
def deps do
[
{:mq_elixir, "~> 0.1.0"}
]
end# Extract all H1 headings
{:ok, result} = Mq.run(".h1", "# Hello\n## World")
IO.inspect(result.values) # ["# Hello"]{:ok, result} = Mq.run(".h", "# H1\n## H2\n### H3")
# Access values
result.values # ["# H1", "## H2", "### H3"]
result.text # "# H1\n## H2\n### H3"
# Enumerate
Enum.each(result, fn heading -> IO.puts(heading) end)Full documentation is available on HexDocs.
For mq query language syntax, see the official mq documentation.
MIT License