Skip to main content

markdown_syntax/
lib.rs

1#![doc = include_str!("../README.md")]
2#![no_std]
3#![deny(missing_docs)]
4
5extern crate alloc;
6
7mod compare;
8mod decode;
9mod entities;
10mod gemoji;
11mod memo;
12#[cfg(test)]
13mod test_support;
14mod unicode_punctuation;
15
16pub mod ast;
17pub mod diagnostic;
18#[cfg(feature = "html")]
19pub mod html;
20pub mod parse;
21pub mod serialize;
22pub mod span;
23pub mod validate;
24
25pub use ast::*;
26pub use diagnostic::{Diagnostic, DiagnosticCode, DiagnosticSeverity};
27#[cfg(feature = "html")]
28pub use html::{HtmlError, HtmlOptions, SafeRawHtmlForm, TasklistAttrOrder};
29pub use parse::{parse, ParseOutput};
30pub use serialize::{BulletMarker, LineEnding, OrderedDelimiter, SerializeError, SerializeOptions};
31pub use span::{LineIndex, LinePosition, Span};
32
33/// Not part of the public API: the tree comparison that round-trip checks use,
34/// exported so the crate's integration tests compare trees the same way.
35#[doc(hidden)]
36pub mod __private {
37    pub use crate::compare::normalized_blocks;
38}
39
40/// Common imports for working with `markdown-syntax`: `use
41/// markdown_syntax::prelude::*;` brings the AST, diagnostics, the parse
42/// entry point, and serialize/span types (plus the HTML renderer under the
43/// `html` feature) into scope.
44pub mod prelude {
45    pub use crate::ast::*;
46    pub use crate::diagnostic::{Diagnostic, DiagnosticCode, DiagnosticSeverity};
47    #[cfg(feature = "html")]
48    pub use crate::html::{HtmlError, HtmlOptions, SafeRawHtmlForm, TasklistAttrOrder};
49    pub use crate::parse::{parse, ParseOutput};
50    pub use crate::serialize::{
51        BulletMarker, LineEnding, OrderedDelimiter, SerializeError, SerializeOptions,
52    };
53    pub use crate::span::{LineIndex, LinePosition, Span};
54}