Crates.io | emacs-org-link-parser |
lib.rs | emacs-org-link-parser |
version | 0.1.0 |
source | src |
created_at | 2022-03-25 14:07:01.059364 |
updated_at | 2022-03-25 14:07:01.059364 |
description | Library for parsing Emacs Org-mode hyperlinks from a string |
homepage | |
repository | https://github.com/lily-mosquitoes/emacs-org-link-parser |
max_upload_size | |
id | 556242 |
size | 39,953 |
This is a Rust library to parse links, formatted as Emacs Org-mode hyperlinks, from a string.
use emacs_org_link_parser as org;
fn main() {
let line_to_parse = "*** [[#mycookbook][page 3]] dumplings, [[www.best-sauce.com][sauce here: number 4]] [[#pictures][how it looks]] [[forum.com]]";
let parsed: Vec<org::Link> = org::parse_line(line_to_parse);
println!("{:?}", parsed);
}
Expected output:
[Link { link: Some("#mycookbook"), description: Some("page 3") }, Link { link: Some("www.best-sauce.com"), description: Some("sauce here: number 4") }, Link { link: Some("#pictures"), description: Some("how it looks") }, Link { link: Some("forum.com"), description: None }]