org-ml
org-ml copied to clipboard
filtering by tag and property values?
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!
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.