Function mdExtractStructuredContent

Extract structured content from markdown for analysis

Internal Use Only - Analyzes markdown AST to extract structured information like headings, links, images, code blocks, etc. Used by documentation generators and content management systems that need programmatic access to markdown structure.

// Analyze README structure for documentation tooling
const structure = extractStructuredContent(readmeContent);
console.log(`Found ${structure.headings.length} headings`);
console.log(`Found ${structure.links.length} links`);
  • Parameters

    • markdown: string

      Raw markdown text to analyze

    Returns {
        codeBlocks: {
            content: string;
            language: string;
            line: number;
        }[];
        headings: {
            id: string;
            level: number;
            line: number;
            title: string;
        }[];
        images: {
            alt: string;
            line: number;
            src: string;
        }[];
        lineCount: number;
        links: {
            line: number;
            text: string;
            type: string;
            url: string;
        }[];
        wordCount: number;
    }

    Structured content information

    • codeBlocks: {
          content: string;
          language: string;
          line: number;
      }[]
    • headings: {
          id: string;
          level: number;
          line: number;
          title: string;
      }[]
    • images: {
          alt: string;
          line: number;
          src: string;
      }[]
    • lineCount: number
    • links: {
          line: number;
          text: string;
          type: string;
          url: string;
      }[]
    • wordCount: number