Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filtering by tag and property values? #33

Open
titaniumbones opened this issue Oct 21, 2021 · 1 comment
Open

filtering by tag and property values? #33

titaniumbones opened this issue Oct 21, 2021 · 1 comment

Comments

@titaniumbones
Copy link

I wonder if you could provide some examples of filtering an org node tree, maybe analogously to the way org agenda or org-sparse-tree allow filtering? I am trying to convert a library to use org-ml, and I'd like to be able to parse a buffer, then filter for the headlines I need & use some properties from those headlines for an HTTP request. Does org-ml have dedicated functions for the parsing, or will I need to just become a better programmer and write my own? Thanks!

@ndwarshuis
Copy link
Owner

ndwarshuis commented Oct 23, 2021

examples of filtering an org node tree, maybe analogously to the way org agenda or org-sparse-tree allow filtering?

I've been planning to add a "cookbook" but have been busy lately. The idea is pretty much what you seem to be describing, which is how to represent 'common' org operations in org-ml beyond what is in the reference API.

For now, the easiest way to achieve the filtering you would want is org-ml-match (and friends). If you have specific examples of what you want to achieve, I can give a few code snippets. The match functions are insanely flexible and powerful but the API is quite intimidating I'll admit.

Does org-ml have dedicated functions for the parsing

org-ml has lots of parse functions. If you are just after headlines, see org-ml-parse-headlines. Since this function will present a flat list of headlines, it might be easier to filter depending on what you want to do vs the org-ml-match function I suggested above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants