Oak Notedown Parser
High-performance incremental Notedown parser for the oak ecosystem with flexible configuration, optimized for document processing and rendering.
🎯 Overview
Oak Notedown is a robust parser for Notedown, designed to handle complete Notedown syntax including modern features. Built on the solid foundation of oak-core, it provides both high-level convenience and detailed AST generation for document processing and rendering.
✨ Features
- Complete Notedown Syntax: Supports all Notedown features including modern specifications
- Full AST Generation: Generates comprehensive Abstract Syntax Trees
- Lexer Support: Built-in tokenization with proper span information
- Error Recovery: Graceful handling of syntax errors with detailed diagnostics
🚀 Quick Start
Basic example:
use ;
use ;
📋 Parsing Examples
Document Parsing
use ;
use ;
let language = default;
let lexer = new;
let source = new;
let result = lexer.tokenize;
println!;
Heading Parsing
use ;
use ;
let language = default;
let lexer = new;
let source = new;
let result = lexer.tokenize;
println!;
🔧 Advanced Features
Token-Level Parsing
use ;
use ;
let language = default;
let lexer = new;
let source = new;
let result = lexer.tokenize;
println!;
Error Handling
use ;
use ;
let language = default;
let lexer = new;
let source = new;
let result = lexer.tokenize;
if let Some = result.errors else
🏗️ AST Structure
The parser generates a comprehensive AST with the following main structures:
- Document: Root container for Notedown documents
- Heading: Heading elements with levels (1-6)
- Paragraph: Text paragraphs
- List: Ordered and unordered lists
- CodeBlock: Fenced code blocks
- Inline: Emphasis, strong, links, and inline code
📊 Performance
- Streaming: Parse large Notedown files without loading entirely into memory
- Incremental: Re-parse only changed sections
- Memory Efficient: Smart AST node allocation
- Fast Recovery: Quick error recovery for better IDE integration
🔗 Integration
Oak Notedown integrates seamlessly with:
- Static Site Generators: Convert Notedown to HTML for websites
- Documentation Tools: Process and render Notedown documentation
- Content Management: Handle user-generated Notedown content
- IDE Support: Language server protocol compatibility
- Blog Platforms: Parse and render blog posts in Notedown
📚 Examples
Check out the examples directory for comprehensive examples:
- Complete Notedown document parsing
- Heading and list analysis
- Code transformation
- Integration with development workflows
🤝 Contributing
Contributions are welcome!
Please feel free to submit pull requests at the project repository or open issues.