Skip to content

seed#5

Open
maooc wants to merge 1 commit intomainfrom
feature/seed-enhanced-directives
Open

seed#5
maooc wants to merge 1 commit intomainfrom
feature/seed-enhanced-directives

Conversation

@maooc
Copy link
Copy Markdown
Owner

@maooc maooc commented Mar 13, 2026

This PR adds enhanced directive support to Mistune:

  1. New enhanced directive module:

    • enhanced.py: Enhanced directive parser for block-level containers
    • TabsDirective: Support for ::: tabs syntax
    • TipDirective: Support for ::: tip syntax
    • EnhancedParser: Flexible parser with options support
  2. Core enhancements:

    • BlockParser: Added lifecycle hooks for directive parsing
    • BlockState: Added container_type tracking in child_state
  3. Renderer enhancements:

    • HTMLRenderer: Added renderers for tabs and tip containers
    • Added data-tab-name and data-container-type attributes
  4. CLI enhancements:

    • Added support for enhanced directive flags
  5. API changes:

    • Added enable_enhanced_directives parameter to create_markdown()

All features are opt-in to maintain backward compatibility.

This PR adds enhanced directive support to Mistune:

1. New enhanced directive module:
   - enhanced.py: Enhanced directive parser for block-level containers
   - TabsDirective: Support for ::: tabs syntax
   - TipDirective: Support for ::: tip syntax
   - EnhancedParser: Flexible parser with options support

2. Core enhancements:
   - BlockParser: Added lifecycle hooks for directive parsing
   - BlockState: Added container_type tracking in child_state

3. Renderer enhancements:
   - HTMLRenderer: Added renderers for tabs and tip containers
   - Added data-tab-name and data-container-type attributes

4. CLI enhancements:
   - Added support for enhanced directive flags

5. API changes:
   - Added enable_enhanced_directives parameter to create_markdown()

All features are opt-in to maintain backward compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants