#org-mode #exporter #document #export #convert #html #back-end

org-rust-exporter

exporter for org mode documents parsed with org-rust-parser

3 releases

0.1.2 Apr 11, 2024
0.1.1 Jul 11, 2023
0.1.0 Jul 11, 2023

#1054 in Algorithms

Download history 27/week @ 2024-02-15 28/week @ 2024-02-22 19/week @ 2024-02-29 3/week @ 2024-03-07 2/week @ 2024-03-14 26/week @ 2024-03-28 20/week @ 2024-04-04 144/week @ 2024-04-11

190 downloads per month
Used in org-rust

MIT license

355KB
11K SLoC

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:

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:

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");

Dependencies

~4–5.5MB
~104K SLoC