MintlifyExampleExtractor

Extracts and formats code examples from XML documentation for Mintlify display.

Syntax

public class MintlifyExampleExtractor

Inheritance

Constructors

MintlifyExampleExtractor

public MintlifyExampleExtractor(MintlifyOptions options, MintlifyLinkResolver linkResolver)
Initializes a new instance of the MintlifyExampleExtractor class.

Parameters

Methods

ExtractMemberExamples

public string ExtractMemberExamples(XmlMember member)
Extracts examples from a member and formats them for Mintlify display.

Parameters

  • member XmlMember: The member to extract examples from.

Returns

string Formatted MDX content containing the examples.

ExtractTypeExamples

public string ExtractTypeExamples(XmlMember type, AssemblyXmlDocumentation xmlDocumentation)
Extracts examples from a type and formats them for Mintlify display.

Parameters

Returns

string Formatted MDX content containing the examples.

GenerateUsageExamples

public string GenerateUsageExamples(XmlMember type, AssemblyXmlDocumentation xmlDocumentation)
Extracts usage examples for common patterns and scenarios.

Parameters

Returns

string Generated usage examples in MDX format.

Remarks

This class processes XML documentation example elements and converts them into beautiful Mintlify code blocks with proper syntax highlighting and formatting. It supports multiple languages and can extract examples from various XML doc elements.