Skip to main content

Crate marco_core

Crate marco_core 

Source
Expand description

marco-core is a pure-Rust Markdown engine with editor intelligence.

Typical flow:

  1. Parse input text into an AST with parse.
  2. Render the AST to HTML with render().
  3. 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.