Converts standard Markdown to Logseq format: hierarchical bullet list
compatible with Logseq [[page]] format.
cargo install --path .
# or, for local build without installing:
cargo build --release
# → binary in target/release/md2logseq# From a file
md2logseq notes.md
# From stdin
cat notes.md | md2logseq
# Redirect to a file
md2logseq notes.md > notes_logseq.md| Source Markdown | Generated Logseq |
|---|---|
# Title |
- # Title |
## Subtitle |
\t- ## Subtitle |
| Paragraph under h2 | \t\t- Paragraph |
--- / *** / <hr> |
(removed) |
| Blank line | (removed, resets list context) |
- item / * item / + item |
- item (at correct depth) |
1. item / 2. item |
- item + logseq.order-list-type:: number |
| Paragraph followed by list | List becomes child of paragraph |
Code block ``` … ``` |
Grouped into a single item with continuation |
| Table | Grouped into a single item with continuation |
Source list depth is translated to Logseq tab levels. Hierarchy is always coherent: you can only go down one level at a time (a larger indentation in source = +1 tab, never +2).
Input (notes.md) :
# A title
A paragraph
## A subtitle
A paragraph.
Another paragraph.
---
## Another subtitle
- An item
- A sub-item
# A title
A paragraph with a bullet list following.
- Hello world
- Sub-item
1. numbered item 1
2. numbered item 2...
- Another sub-itemOutput :
- # A title
- A paragraph
- ## A subtitle
- A paragraph.
- Another paragraph.
- ## Another subtitle
- An item
- A sub-item
- # A title
- A paragraph with a bullet list following.
- Hello world
- Sub-item
- numbered item 1
logseq.order-list-type:: number
- numbered item 2...
logseq.order-list-type:: number
- Another sub-item
cargo test