mirror of
https://github.com/flynx/photobook.git
synced 2025-10-29 10:20:08 +00:00
cleanup....
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
dc05a7c3c4
commit
e0e498543c
2
Makefile
2
Makefile
@ -40,7 +40,7 @@ DOC := ./scripts/cls2tex.sh
|
||||
|
||||
# NOTE: .sty and .cls are essentially the same in terms of documentation
|
||||
# generation...
|
||||
# XXX should these depend on $(DOC) ???
|
||||
# XXX should these depend on the $(DOC) script ???
|
||||
%.tex: %.sty %-meta.tex
|
||||
$(DOC) $< $@
|
||||
|
||||
|
||||
@ -1,18 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
SCRIPT_NAME=$(basename $0)
|
||||
|
||||
printusage(){
|
||||
echo "Usage:"
|
||||
echo " $SCRIPT_NAME [OPTIONS] INPUT OUTPUT"
|
||||
}
|
||||
|
||||
printerror(){
|
||||
echo Error: $@
|
||||
echo
|
||||
printusage
|
||||
}
|
||||
|
||||
printhelp(){
|
||||
echo "Generate docs from latex package/class"
|
||||
echo
|
||||
@ -48,11 +38,24 @@ printhelp(){
|
||||
echo " in both the repo and in installed form, so .dtx is not used."
|
||||
}
|
||||
|
||||
printusage(){
|
||||
echo "Usage:"
|
||||
echo " $SCRIPT_NAME [OPTIONS] INPUT OUTPUT"
|
||||
}
|
||||
|
||||
printerror(){
|
||||
echo Error: $@
|
||||
echo
|
||||
printusage
|
||||
}
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# Args and defaults...
|
||||
|
||||
# defaults...
|
||||
PREFIX=%
|
||||
|
||||
# args...
|
||||
while true ; do
|
||||
case $1 in
|
||||
-h|--help)
|
||||
@ -91,7 +94,10 @@ fi
|
||||
MODULE=$(basename "$INPUT")
|
||||
MODULE=${MODULE/.*/}
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# do the work...
|
||||
|
||||
cat "$INPUT" \
|
||||
| egrep '(^%'$PREFIX'|^\\edef\\'$MODULE'@[A-Z][A-Z]+)' \
|
||||
| sed 's/^\(\\edef\\\)'$MODULE'@/%'$PREFIX'\1/' \
|
||||
@ -103,4 +109,5 @@ cat "$INPUT" \
|
||||
> "$OUTPUT"
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# vim:set ts=4 sw=4 nowrap :
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user