late2htm 0.1.0

A Rust library for converting LaTeX-formatted text into HTML with minimal styling.
Documentation
use crate::ast::LatexNode;
use crate::htmlgen::generate_html;
use crate::parser::parse_latex;

pub mod parser;
pub mod ast;
pub mod htmlgen;

/// Converts a LaTeX string to HTML.
///
/// # Example
/// ```
/// use late2htm::convert_latex_to_html;
///
/// let html = convert_latex_to_html("\\textbf{Bold Text}");
/// println!("{}", html);
/// ```
pub fn convert_latex_to_html(input: &str) -> String {
    let ast = parse_latex(input);
    generate_html_from_vec(&ast)
}

/// Converts a list of parsed LaTeX nodes to HTML.
///
/// This is an internal helper used by `convert_latex_to_html`.
pub fn generate_html_from_vec(nodes: &Vec<LatexNode>) -> String {
    nodes.iter().map(generate_html).collect::<Vec<_>>().join("\n")
}