1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! # cmark-writer
//!
//! `cmark-writer` is a Rust library for writing CommonMark format.
//!
//! This library provides functionality to serialize in-memory data structures to CommonMark compliant text.
//!
//! ## Example
//!
//! ```rust
//! use cmark_writer::ast::{Node, BlockNode, InlineNode, ListItem};
//! use cmark_writer::writer::CommonMarkWriter;
//!
//! // Create a simple document
//! let document = BlockNode::Document(vec![
//! BlockNode::Heading {
//! level: 1,
//! content: vec![InlineNode::Text("Hello CommonMark".to_string())],
//! },
//! BlockNode::Paragraph(vec![
//! InlineNode::Text("This is a simple ".to_string()),
//! InlineNode::Strong(vec![InlineNode::Text("example".to_string())]),
//! InlineNode::Text(".".to_string()),
//! ]),
//! ]).into_node();
//!
//! // Write the document as CommonMark text
//! let mut writer = CommonMarkWriter::new();
//! writer.write(&document).expect("Failed to write document");
//! let markdown = writer.into_string();
//!
//! println!("{}", markdown);
//! ```
// Re-export main public API components so users can access them directly via `cmark_writer::Node`
pub use crate;
pub use crate;
// Export public modules to allow users to access more advanced functionality