mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-16 20:20:57 +01:00
get rid of lisp interpreter, -R and -F are enough, fixes #30
This commit is contained in:
61
tablizer.pod
61
tablizer.pod
@@ -39,7 +39,6 @@ tablizer - Manipulate tabular output of other programs
|
||||
Other Flags:
|
||||
--completion <shell> Generate the autocompletion script for <shell>
|
||||
-f, --config <file> Configuration file (default: ~/.config/tablizer/config)
|
||||
-l, --load-path <path> Load path for lisp plugins (expects *.zy files)
|
||||
-d, --debug Enable debugging
|
||||
-h, --help help for tablizer
|
||||
-m, --man Display manual page
|
||||
@@ -384,67 +383,7 @@ the C<-L> parameter).
|
||||
Colorization can be turned off completely either by setting the
|
||||
parameter C<-N> or the environment variable B<NO_COLOR> to a true value.
|
||||
|
||||
=head1 LISP PLUGINS [experimental]
|
||||
|
||||
Tablizer supports plugins written in zygomys lisp. You can supply a
|
||||
directory to the C<-l> parameter containing B<*.zy> files or a single
|
||||
.zy file containing lisp code.
|
||||
|
||||
You can put as much code as you want into the file, but you need to
|
||||
add one lips function to a hook at the end.
|
||||
|
||||
The following hooks are available:
|
||||
|
||||
=over
|
||||
|
||||
=item B<filter>
|
||||
|
||||
The filter hook works one a whole line of the input. Your hook
|
||||
function is expected to return true or false. If you return true, the
|
||||
line will be included in the output, otherwise not.
|
||||
|
||||
Multiple filter hook functions are supported.
|
||||
|
||||
Example:
|
||||
|
||||
/*
|
||||
Simple filter hook function. Splits the argument by whitespace,
|
||||
fetches the 2nd element, converts it to an int and returns true
|
||||
if it s larger than 5, false otherwise.
|
||||
*/
|
||||
(defn uselarge [line]
|
||||
(cond (> (atoi (second (resplit line ` +`))) 5) true false))
|
||||
|
||||
/* Register the filter hook */
|
||||
(addhook %filter %uselarge)
|
||||
|
||||
=item B<process>
|
||||
|
||||
The process hook function gets a table containing the parsed input
|
||||
data (see C<lib/common.go:type Tabdata struct>. It is expected to
|
||||
return a pair containing a bool to denote if the table has been
|
||||
modified, and the [modified] table. The resulting table may have less
|
||||
rows than the original and cells may have changed content but the
|
||||
number of columns must persist.
|
||||
|
||||
=item B<transpose>
|
||||
|
||||
not yet implemented.
|
||||
|
||||
=item B<append>
|
||||
|
||||
not yet implemented.
|
||||
|
||||
=back
|
||||
|
||||
Beside the existing language features, the following additional lisp
|
||||
functions are provided by tablizer:
|
||||
|
||||
(resplit [string, regex]) => list
|
||||
(atoi [string]) => int
|
||||
(matchre [string, regex]) => bool
|
||||
|
||||
The standard language is described here: L<https://github.com/glycerine/zygomys/wiki/Language>.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user