Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Renamed filters to hooks since people seem to know what these are mor…
Browse files Browse the repository at this point in the history
…e so than filters.

Even though a hook really is a filter.

Brett
  • Loading branch information
B. Estrade committed Jun 13, 2012
1 parent 9329733 commit 3242c88
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
18 changes: 9 additions & 9 deletions bin/vee
Expand Up @@ -23,7 +23,7 @@ HEADERTXT= # text or `cat some.header.txt`
FOOTERTXT="Powered by <a href=\"http://www.0x743.com/vee\">vee</a><br/>Copyright &copy; 2006-${YEAR}"
TOP_TPL=./vee-top.tpl
BOT_TPL=./vee-bottom.tpl
PREFORMAT_FILTER=./vee-filter # the filter is assumed to be executable, else it is ignored
PREFORMAT_HOOK=./my-pre-hook.sh # the hook is assumed to be executable, else it is ignored
USE_EDITOR=1
LISTENSTDIN=0
SORT_NEWEST="sort -t. -nr" # sorts all new to old
Expand Down Expand Up @@ -60,7 +60,7 @@ CUSTOM_SETUP=default_setup
# added code to remove extraneous lines from groff
# made sort options customizable
# made publish date format customizable
# initial implementation of pre format filter
# initial implementation of pre format hook
# externalized the use of custom formats
# added ability to edit and reformat any post

Expand Down Expand Up @@ -162,7 +162,7 @@ CUSTOM_SETUP=default_setup
echo " -t 'title' specify title at commandline and avoid annoying default prompt"
echo " -T file define top template; default is ./vee-top.tpl "
echo " -v version and exit "
echo " -x filter defines filter if not using default "./vee-pre"; filter "
echo " -x hook defines hook if not using default "./vee-pre"; hook "
echo " must be executable, i.e., chmod 755 vee-pre "
echo " "
echo "Examples: "
Expand Down Expand Up @@ -274,19 +274,19 @@ CUSTOM_SETUP=default_setup
}

#
# all filters must accepted STDIN and output via STDOUT
# all hooks must accepted STDIN and output via STDOUT
# default arguments include:
#
preformat()
{ if [ -x "${PREFORMAT_FILTER}" ]; then
cat "${DRAFT}" | "${PREFORMAT_FILTER}" "${FORMAT_FUNC}" > "${DRAFT}.tmp"
{ if [ -x "${PREFORMAT_HOOK}" ]; then
cat "${DRAFT}" | "${PREFORMAT_HOOK}" "${FORMAT_FUNC}" > "${DRAFT}.tmp"
mv -f "${DRAFT}.tmp" "${DRAFT}"
fi
}

# postformat()
#{ if [ -x "${POSTFORMAT_FILTER}" ]; then
# cat "${FINAL}" | "${POSTFORMAT_FILTER}" > "${FINAL}.tmp"
#{ if [ -x "${POSTFORMAT_HOOK}" ]; then
# cat "${FINAL}" | "${POSTFORMAT_HOOK}" > "${FINAL}.tmp"
# mv -f "${FINAL}.tmp" "${FINAL}"
# fi
#}
Expand Down Expand Up @@ -490,7 +490,7 @@ while getopts 'f:m:t:T:c:d:i:IbB:hRr:lL:novx:X:Pps:' option; do
h) usage
die_cleanly
;;
x) PREFORMAT_FILTER="${OPTARG}"
x) PREFORMAT_HOOK="${OPTARG}"
;;
?) #usage | less
die_cleanly
Expand Down
3 changes: 1 addition & 2 deletions sample-config/dot.veerc
Expand Up @@ -3,7 +3,6 @@
INDEX=index.html
FOOTERTXT="hijacked by .veerc"

#PREFORMAT_FILTER=./vee-filter.pl
#EDITOR=vi
#MARGIN=64
#FORMAT=html
Expand All @@ -18,7 +17,7 @@ FOOTERTXT="hijacked by .veerc"
#HEADERTXT= # text or `cat some.header.txt`
#TOP_TPL=./vee-top.tpl
#BOT_TPL=./vee-bottom.tpl
#PREFORMAT_FILTER=./vee-filter # the filter is assumed to be executable, else it is ignored
#PREFORMAT_HOOK=./my-pre-hook.sh # the filter is assumed to be executable, else it is ignored
#PUBLISHED=`date "+%m/%d/%Y"` # date formated for index page entry
#FORMAT_FUNC=format_with_groff
#FORMAT_DISPATCHER=default_set_format_func
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3242c88

Please sign in to comment.