Crate arinamcnulty_markdown_parser

Crate arinamcnulty_markdown_parser 

Source
Expand description

§Markdown Parser Library

This library provides comprehensive Markdown parsing capabilities with HTML conversion. It uses Pest grammar for efficient parsing and supports various Markdown elements.

§Features

  • Full Markdown syntax support (headings, paragraphs, links, images, formatting)
  • Robust error handling with custom error types
  • HTML output generation with proper escaping
  • Command-line interface integration

§Example

use arinamcnulty_markdown_parser::{parse_markdown, str_to_html};

let markdown = "# Hello World\n\nThis is **bold** text.";
let html = str_to_html(markdown).unwrap();
println!("{}", html.join("\n"));

Structs§

MarkdownParser

Enums§

MarkdownError
Custom error type for markdown parsing operations. Provides detailed error information for different failure scenarios.
Rule

Functions§

convert_file_to_html
Convert markdown file to HTML file. Reads markdown from input path and writes HTML to output path.
parse_markdown
Main parsing function that processes markdown input. Returns parsed syntax tree or error if parsing fails.
print_html_to_console
Print HTML conversion result to console. Useful for command-line usage.
str_to_html
Convert markdown string to vector of HTML strings. Each element represents one HTML line/tag.