MDX compiler that transforms MDX documents into JavaScript
Overall
score
97%
Build a tool that analyzes MDX source files and reports detailed position information for elements discovered during compilation. The tool should track line, column, and offset information for specific node types as they are transformed through the compilation pipeline.
@generates
The tool should:
Output format should be an array of objects with this structure:
{
type: string, // e.g., "heading", "jsx"
content: string, // text or tag name
position: {
start: { line: number, column: number, offset: number },
end: { line: number, column: number, offset: number }
}
}/**
* Analyzes MDX source and extracts position information for elements.
*
* @param {string} mdxSource - The MDX source code to analyze
* @param {object} options - Configuration options
* @param {string[]} options.nodeTypes - Array of node types to extract (e.g., ['heading', 'mdxJsxFlowElement'])
* @returns {Promise<Array>} Array of objects containing type, content, and position information
*/
export async function analyzePositions(mdxSource, options);Provides MDX compilation and AST processing capabilities
Install with Tessl CLI
npx tessl i tessl/npm-mdx-js--mdxevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10