karlicoss / orgparse

Python module for reading Emacs org-mode files
https://orgparse.readthedocs.org
BSD 2-Clause "Simplified" License
371 stars 43 forks source link

Extracting line numbers from org nodes? #63

Closed lenianiva closed 11 months ago

lenianiva commented 12 months ago

Is it possible to extract the line number from a node? I need this functionality because I want to signal to the user the document is invalid.

karlicoss commented 11 months ago

Yep, nodes have a .linenumber property, e.g. see usage example here https://github.com/karlicoss/promnesia/blob/78e7d73b40c88c4c0374cd9a495d2347017f4b55/src/promnesia/sources/org.py#L167