Skip to content
Discussion options

You must be logged in to vote

Alright I actually did get it to work, here's what I did:

// remark-obsidian-callouts.js
// Converts Obsidian-style callouts (e.g., > [!NOTE] Title) to directive format (e.g., :::note[Title])
// Supported types: note, info, todo, tip, important, warning, caution
// Follows unified/remark plugin pattern

import { visit } from 'unist-util-visit';

const SUPPORTED_TYPES = {
  note: 'note',
  info: 'info',
  todo: 'todo',
  tip: 'tip',
  important: 'important',
  warning: 'warning',
  caution: 'caution',
};

const OBSIDIAN_CALLOUT_REGEX = /^\[!(NOTE|INFO|TODO|TIP|IMPORTANT|WARNING|CAUTION)](\s+(.+))?/i;

export default function remarkObsidianCallouts() {
  return (tree) => {
    visit(tree, '…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@davidvkimball
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by davidvkimball
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants