reorg 0.1.0

Module to read org-mode files.
Documentation
  • Coverage
  • 46.67%
    7 out of 15 items documented1 out of 8 items with examples
  • Size
  • Source code size: 13.18 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.19 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 22s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • rodrigovalin/reorg
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • rodrigovalin

reorg

reorg is a convenient library to read org-mode files from Rust.

It has many limitations as of now, as it can only read very simple files. A file is a collection of Sections, each section contains a heading: a line with one or more '*' and a title. After the heading section a contents section is expected, which is a multi-line string.

Examples

let org_doc = String::from("* This is first item
with some content
and a second line
** And we have another title
also with some content");
let doc = reorg::Document::from(org_doc).unwrap();

assert_eq!(doc.sections.borrow()[0].heading.stars, 1);
assert_eq!(doc.sections.borrow()[0].heading.title, "This is first item");
assert_eq!(doc.sections.borrow()[0].children.borrow()[0].heading.stars, 2);
assert_eq!(doc.sections.borrow()[0].children.borrow()[0].heading.title, "And we have another title");

assert_eq!(doc.sections.borrow()[0].content, "with some content\nand a second line\n");
assert_eq!(doc.sections.borrow()[0].children.borrow()[0].content, "also with some content");