Markdown to JSON

by meghan-lendhe
5
4
3
2
1
Score: 35/100

Description

This plugin has not been manually reviewed by Obsidian staff. Copy a Markdown note as structured JSON blocks to the clipboard.

Reviews

No reviews yet.

Stats

stars
downloads
0
forks
1
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

Github

Markdown to JSON (Obsidian Plugin)

Copy a note written in Obsidian (Markdown) into structured JSON blocks, optimized to be pasted into the companion Figma plugin that generates separate text layers for fast case study page layout.


What it does

  • Adds a command in Obsidian’s Command Palette to export the current note as JSON.
  • Converts Markdown into ordered blocks:
    • Headings (#######) → h1h6
    • Body → each non-empty line becomes its own block
    • Bullets (-, *, +) → each bullet becomes its own block

Companion plugin (Figma)

This exporter is intended to be used with:


Output format

The plugin copies JSON like:

[
  { "type": "h1", "level": 1, "text": "Title", "id": "h1-0" },
  { "type": "h2", "level": 2, "text": "Overview", "id": "h2-1" },
  { "type": "body", "text": "Problem: ...", "id": "body-2" },
  { "type": "body", "text": "Time: 14 weeks", "id": "body-3" },
  { "type": "list", "text": "A bullet item", "id": "list-4" }
]

Block fields

  • type (required): h1h6 | body | list
  • level (optional): 1–6 (for headings)
  • text (required): string content for that line/item
  • id (required): identifier generated during export (useful for ordering and potential “update” flows later)

How to use

  1. Open your case study note in Obsidian.
  2. Press Ctrl + P to open Command Palette.
  3. Run: Copy Markdown as JSON blocks
  4. Open Figma → run the JSON to Text plugin.
  5. Paste JSON into the plugin UI and click Import.

Installation (manual)

  1. Build the plugin (see Development).
  2. Copy the built files into your vault:

<YourVault>/.obsidian/plugins/md-to-json/

Files needed:

  • manifest.json
  • main.js

This matches the common layout used by the Obsidian sample plugin template.

  1. In Obsidian: Settings → Community plugins → enable Markdown to JSON.

If .obsidian/plugins doesn’t exist yet, create it.


Development

This project was bootstrapped from the Obsidian sample plugin template (TypeScript → compiled main.js).

Prerequisites

  • Node.js + npm
  • Obsidian desktop app

Install

npm install

Dev build (watch)

npm run dev

Production build

npm run build

After rebuilding, reload the plugin in Obsidian (toggle it off/on) to pick up changes.


Parsing rules (current)

  • Headings: #{1,6} Heading → a heading block (h1h6)
  • Body: each non-empty line that isn’t a heading or list item → body
  • Lists: - item / * item / + itemlist
  • Empty lines are ignored

Known limitations

  • Markdown styling isn’t preserved (bold/italic/links are exported as plain text).
  • Tables, callouts, embeds, and images aren’t converted.
  • IDs are generated during export; editing the note can change ordering/IDs.