-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Hello everyone. After leaving this crate for almost unmaintained for over three years, I finally had some time to pick up what we left off. :)
Three years has passed, and many new feature and awesome crates have been introduced in the Rust world. So I think it's time for us to rebuild orgize with these new features and crates in mind. So I'm thrilled to announce that i'll be publishing orgize v0.10 in the next couple of weeks.
This version is total rewrite of orgize. Some notable changes including:
Switching to rowan
In this version, we're replacing the underlying data structure from indextree
to rowan
, one of the core crates of rust-analyzer
.
To visualise that, input * Heading *bold*
will now becomes something like:
DOCUMENT@0..17
HEADLINE@0..17
HEADLINE_STARS@0..1 "*"
WHITESPACE@1..2 " "
HEADLINE_TITLE@2..16
TEXT@2..10 "Heading "
BOLD@10..16
STAR@10..11 "*"
TEXT@11..15 "bold"
STAR@15..16 "*"
NEW_LINE@16..17 "\n"
rowan
help us resolves some long exist problem like high memory usage and not able to get position of each parsed element.
Also thanks to the rich ecosystem of rowan
, we might have a lsp server for org mode in future, just like rust-analyzer
does for rust language.
Traversing org element tree
Another big change in this version is that org.iter()
is now superseded by org.traverse()
. When walking through org element tree, traversal is much more flexible than simple iteration. For example, you can now skip the whole subtree but continue on its sibling without breaking the entire traversing by calling traversal_context.skip()
.
Lossless parsing
Orgize is now a loessless parser. It means you can always get original input back from Org
struct:
let s = "* hello /world/!";
let org = Org::parse(s);
assert_eq!(s, org.to_org());
Try it out today
You can try out v0.10 by installing it from crates.io:
cargo add orgize@0.10.0-alpha.1
or using new demo website: https://poiscript.github.io/orgize
I hope you guys enjoy the new release, and feel free to send any feedback!
What's next
Before publishing v0.10, I want to fix other issues and merge pull requests as much as possible.
After that, I want to support parsing org entities and inlinetasks and try build a lsp server for org-mode using tower-lsp and orgize.