Expand description
marco-core is a pure-Rust Markdown engine with editor intelligence.
Typical flow:
- Parse input text into an AST with
parse. - Render the AST to HTML with
render(). - Optionally run editor analysis via
MarkdownIntelligenceProvider.
§Example
let doc = marco_core::parse("# Hello")?;
let html = marco_core::render(&doc, &marco_core::RenderOptions::default())?;
assert!(html.contains("<h1"));
assert!(html.contains("Hello"));Re-exports§
pub use intelligence::MarkdownIntelligenceProvider;pub use parser::parse;pub use parser::parse_with_options;pub use parser::ParseOptions;pub use parser::Document;pub use parser::Node;pub use parser::NodeKind;pub use render::render;pub use render::RenderOptions;pub use logic::utf8::sanitize_input;pub use logic::utf8::sanitize_input_with_stats;pub use logic::utf8::InputSource;pub use logic::utf8::SanitizeStats;
Modules§
- grammar
- Low-level Markdown grammar components (block and inline parsers). Grammar definitions for Markdown syntax
- intelligence
- Editor intelligence APIs such as diagnostics, highlights, completions, and TOC. Smart Markdown editor intelligence (in-process engine).
- logic
- Utility logic such as UTF-8 sanitization and text helpers.
- parser
- AST definitions and parser entry points. Parser entry points and AST-facing parser modules.
- render
- HTML rendering and rendering options. HTML renderer entry points and render support modules.
Macros§
- safe_
debug - Macro for safe debug logging with automatic string truncation
Constants§
- VERSION
- The crate version from
Cargo.toml, exposed for downstream UIs and diagnostics.