This repository has been archived by the owner on Jul 12, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
B. Estrade
committed
Mar 8, 2013
1 parent
281a3ba
commit 3f439d8
Showing
9 changed files
with
255 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,64 @@ | ||
=head1 NAME | ||
|
||
vee hooks | ||
I<vee-pre> | ||
|
||
B<There is currently no post-format hook enabled>. | ||
|
||
=head1 REQUIREMENTS | ||
|
||
A vee hook is an executable file that accepts STDIN, a single argument | ||
($FORMAT_FUNC), and must output to STDOUT. | ||
|
||
=head1 SYNOPSIS | ||
|
||
vee hooks | ||
The following is an example hook. | ||
|
||
#!/bin/sh | ||
|
||
=head1 DESCRIPTION | ||
# this filter is a null filter; meaning it spits out | ||
# exactly what was passed in | ||
|
||
C<veels> is a | ||
FORMAT_FUNC=$1 # the name of the format function used is passed in | ||
|
||
=head1 COMMANDS | ||
IFS="" # ensures that leading spaces are retained | ||
while read -r IN <&0 ; do # break after 1 sec of no stdin | ||
echo "${IN}" # echo's stdin back out so user can see | ||
done | ||
|
||
=over 4 | ||
It be be written in anything as long as it meets the aforementioned | ||
L<REQUIREMENTS>: | ||
|
||
=item -x | ||
#!/bin/env perl | ||
|
||
=back | ||
use strict; | ||
use warnings; | ||
|
||
=head1 FILES | ||
# toy filter that replaces AUBURN with an img tag | ||
|
||
none | ||
my $FORMAT_FUNC = $ARGV[0]; # name of format function is passed in | ||
|
||
while(<STDIN>) { | ||
chomp; | ||
if ($_ =~ s/AUBURN/<img src=http:\/\/www.emaspro.com\/Portals\/0\/images\/Logo\%20-\%20Auburn.jpg>/g ) { | ||
# argv[0] is the name of the formatting function | ||
if ($FORMAT_FUNC =~ m/groff/) { | ||
printf("'nf\n%s\n'fi\n",$_); | ||
} else { | ||
printf("%s\n",$_); | ||
} | ||
} else { | ||
printf("%s\n",$_); | ||
} | ||
} | ||
|
||
=head1 ENVIRONMENT | ||
|
||
=head1 DIAGNOSTICS | ||
Must accept a single argument, which is passed to it by I<vee>. And that is | ||
$FORMAT_FUNC. | ||
|
||
=head1 BUGS | ||
The default value of the pre-format hook is I<vee-pre>, but to change this one | ||
must define PREFORMAT_HOOK in I<.veerc>. | ||
|
||
=head1 AUTHOR | ||
|
||
B. Estrade L<estrabd@gmail.com> | ||
|
||
=head1 SEE ALSO | ||
|
||
I<veels>(1) | ||
I<veecat>(1) | ||
I<vee-rebuild>(1) | ||
I<veerc>(5) | ||
I<veeindex>(5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.