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
41
42
43
//! `markdown-composer` helps you to create Markdown documents using Rust code.
//!
//! The main API involves around using builders to create structured Markdown
//! elements that can be combined together into a Markdown document
//!
//! ```rust,norun
//! use markdown_composer::{Link, Markdown};
//!
//! let link = Link::builder()
//!     .text("Hello World")
//!     .url("https://hello.world")
//!     .build();
//!
//! let md = Markdown::new()
//!     .header1("First level header")
//!     .paragraph("Some standalone paragraph")
//!     .link(link)
//!     .paragraph("Some other paragraph");
//! let rendered = md.render();
//! ```

pub mod builders;
pub mod extensions;
pub mod traits;
pub mod transforms;
pub mod types;

pub use crate::{
    builders::{image::ImageBuilder, link::LinkBuilder, list::ListBuilder},
    traits::{AsFooter, MarkdownElement},
    transforms::{BlockQuote, Bold, CodeBlock, Inline, Italic},
    types::{
        header::{Header, HeaderLevel},
        image::Image,
        link::Link,
        list::{List, ListItem, ListItemMarker, ListType, NumberedListItemMarkerSeparator},
        markdown::Markdown,
        paragraph::Paragraph,
    },
};

#[cfg(feature = "extension-github")]
pub use crate::extensions::github::{CheckmarkItem, Strikethrough};