| Crates.io | oak-nix |
| lib.rs | oak-nix |
| version | 0.0.1 |
| created_at | 2025-10-22 04:32:49.001427+00 |
| updated_at | 2026-01-23 04:42:27.501776+00 |
| description | Nix package manager language parser with support for declarative package configuration and reproducible builds. |
| homepage | https://github.com/ygg-lang/oaks |
| repository | https://github.com/ygg-lang/oaks |
| max_upload_size | |
| id | 1894946 |
| size | 111,270 |
High-performance incremental Markdown parser for the oak ecosystem with flexible configuration, optimized for document processing and rendering.
Oak of markdown is a robust parser for Markdown, designed to handle complete Markdown 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.
Basic example:
use oak_markdown::MarkdownParser;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let parser = MarkdownParser::new();
let markdown_content = r#"
# Hello, Markdown!
This is a **paragraph** with *emphasis*.
## Features
- Lists
- Code blocks
- And more!
"#;
let document = parser.parse_document(markdown_content)?;
println!("Parsed Markdown document successfully.");
Ok(())
}
use oak_markdown::{MarkdownParser, ast::Document};
let parser = MarkdownParser::new();
let markdown_content = r#"
# My Document
This is a simple document.
"#;
let document = parser.parse_document(markdown_content)?;
println!("Document title: {}", document.title);
use oak_markdown::{MarkdownParser, ast::Heading};
let parser = MarkdownParser::new();
let markdown_content = r#"
## My Heading
Some content here.
"#;
let document = parser.parse_document(markdown_content)?;
for heading in &document.headings {
println!("Heading level {}: {}", heading.level, heading.text);
}
use oak_markdown::{MarkdownParser, lexer::Token};
let parser = MarkdownParser::new();
let tokens = parser.tokenize("# Heading\n\nParagraph text")?;
for token in tokens {
println!("{:?}", token.kind);
}
use oak_markdown::MarkdownParser;
let parser = MarkdownParser::new();
let invalid_markdown = r#"
# Heading
This is a paragraph
## Another heading
# Unclosed heading
"#;
match parser.parse_document(invalid_markdown) {
Ok(document) => println!("Parsed Markdown document successfully."),
Err(e) => {
println!("Parse error at line {} column {}: {}",
e.line(), e.column(), e.message());
if let Some(context) = e.context() {
println!("Error context: {}", context);
}
}
}
The parser generates a comprehensive AST with the following main structures:
Oak of markdown integrates seamlessly with:
Check out the examples directory for comprehensive examples:
Contributions are welcome!
Please feel free to submit pull requests at the project repository or open issues.