from md for formats
Convert markdown text into structured data.
Signature
> from md {flags}
Input/output types:
| input | output |
|---|---|
| string | table |
Examples
Parse markdown and return key node fields.
> '# Title' | from md | select type position attrs
╭───┬──────┬────────────────────────────┬───────────────╮
│ # │ type │ position │ attrs │
├───┼──────┼────────────────────────────┼───────────────┤
│ 0 │ h1 │ ╭───────┬────────────────╮ │ ╭───────┬───╮ │
│ │ │ │ │ ╭────────┬───╮ │ │ │ depth │ 1 │ │
│ │ │ │ start │ │ line │ 1 │ │ │ │ level │ 1 │ │
│ │ │ │ │ │ column │ 1 │ │ │ ╰───────┴───╯ │
│ │ │ │ │ ╰────────┴───╯ │ │ │
│ │ │ │ │ ╭────────┬───╮ │ │ │
│ │ │ │ end │ │ line │ 1 │ │ │ │
│ │ │ │ │ │ column │ 8 │ │ │ │
│ │ │ │ │ ╰────────┴───╯ │ │ │
│ │ │ ╰───────┴────────────────╯ │ │
╰───┴──────┴────────────────────────────┴───────────────╯Parse markdown frontmatter as a dedicated node.
> '---
title: Demo
---
# A' | from md | get 0.type
yaml