Skip to content

Instantly share code, notes, and snippets.

@scottfwalter
scottfwalter / markdown_cover_extractor.js
Created June 29, 2025 15:40
Create cover coverFilename property based on first image in document
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
/**
* Extracts the first image reference in ![[filename]] format from markdown content
* @param {string} content - The markdown content
* @returns {string|null} - The extracted filename or null if not found
*/