Done at 41ebaba <http://41ebaba5cc720beefa752649007a9c409c33a5b1>.

Added support for `@data extract-patterns`.

This setting should contain in body regex pattern definitions, one per 
line, which should capture prefered headline in group(1) from the first 
line of extracted text. For example:

line containing '\s*(?:def|class)\s+(\w+)' (without appostrophe), will 
match python definitions of functions/methods and classes.

User defined regex patterns are prepended to default list, so even if this 
setting is empty, Leo will extract definitions in: python, javascript, 
clojure, coffeescript.

Note: if you need groups in pattern, make them with (?: ....) syntax so 
that the headline is captured in group(1). In the example above first group 
that matches 'def' or 'class' keyword is surrounded with '(?:' and ')'  in 
order to skip this group from the output groups and let the second group to 
be captured at index 1. 'extract` command relies on this convention that 
headline should be captured in group at index 1. It is also possible to 
write several regex patterns and avoid all other groups except the one that 
captures headline. For example regex from above can be written in two lines 
like so:
\s*def\s+(\w+)
\s*class\s+(\w+)

Vitalije

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to