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
//! Exporter for Org-Mode documents
//!
//! This crate exposes the [`Exporter`] trait, which each backend must implement.
//!
//! # Examples
//!
//! To convert an input string to HTML/Org, just invoke [`Exporter::export`]:
//!
//! ```rust
//! use org_rust_exporter as org_exporter;
//! use org_exporter::{Html, Org, Exporter};
//!
//! let html_str: String = Html::export("* Hello HTML!\n").unwrap();
//! let org_str: String = Org::export("* Hello Org!\n").unwrap();
//! ```
//!
//! You can also export into a buffer that implements [`fmt::Write`]:
//!
//! ```rust
//! use org_rust_exporter as org_exporter;
//! use org_exporter::{Html, Org, Exporter};
//!
//! let mut html_str = String::new();
//! let mut org_str = String::new();
//!
//! Html::export_buf("* Hello HTML!\n", &mut html_str);
//! Org::export_buf("* Hello Org!\n", &mut org_str);
//!
//! assert_eq!(html_str, r#"<h1 id="hello-html">Hello HTML!</h1>
//! "#);
//! assert_eq!(org_str, "* Hello Org!\n");
//! ```

mod html;
mod include;
mod org;
mod org_macros;
mod types;
mod utils;

pub use html::Html;
pub use org::Org;
pub use types::Exporter;