export function getHeadings(content) {
    const headingRegex = /^(#{1,6})\s+(.+)$/gm;
    const headings = [];
    let match;

    while ((match = headingRegex.exec(content)) !== null) {
        const depth = match[1].length;
        const text = match[2];
        const slug = text.toLowerCase().replace(/[^\w]+/g, '-');
        headings.push({ depth, text, slug });
    }

    return headings;
}