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
|
# NOTE: .sty and .cls are essentially the same in terms of documentation
|
||||||
# generation...
|
# generation...
|
||||||
# XXX should these depend on $(DOC) ???
|
# XXX should these depend on the $(DOC) script ???
|
||||||
%.tex: %.sty %-meta.tex
|
%.tex: %.sty %-meta.tex
|
||||||
$(DOC) $< $@
|
$(DOC) $< $@
|
||||||
|
|
||||||
|
|||||||
@ -1,18 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
SCRIPT_NAME=$(basename $0)
|
SCRIPT_NAME=$(basename $0)
|
||||||
|
|
||||||
printusage(){
|
|
||||||
echo "Usage:"
|
|
||||||
echo " $SCRIPT_NAME [OPTIONS] INPUT OUTPUT"
|
|
||||||
}
|
|
||||||
|
|
||||||
printerror(){
|
|
||||||
echo Error: $@
|
|
||||||
echo
|
|
||||||
printusage
|
|
||||||
}
|
|
||||||
|
|
||||||
printhelp(){
|
printhelp(){
|
||||||
echo "Generate docs from latex package/class"
|
echo "Generate docs from latex package/class"
|
||||||
echo
|
echo
|
||||||
@ -48,11 +38,24 @@ printhelp(){
|
|||||||
echo " in both the repo and in installed form, so .dtx is not used."
|
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=%
|
PREFIX=%
|
||||||
|
|
||||||
# args...
|
|
||||||
while true ; do
|
while true ; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-h|--help)
|
-h|--help)
|
||||||
@ -91,7 +94,10 @@ fi
|
|||||||
MODULE=$(basename "$INPUT")
|
MODULE=$(basename "$INPUT")
|
||||||
MODULE=${MODULE/.*/}
|
MODULE=${MODULE/.*/}
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
# do the work...
|
# do the work...
|
||||||
|
|
||||||
cat "$INPUT" \
|
cat "$INPUT" \
|
||||||
| egrep '(^%'$PREFIX'|^\\edef\\'$MODULE'@[A-Z][A-Z]+)' \
|
| egrep '(^%'$PREFIX'|^\\edef\\'$MODULE'@[A-Z][A-Z]+)' \
|
||||||
| sed 's/^\(\\edef\\\)'$MODULE'@/%'$PREFIX'\1/' \
|
| sed 's/^\(\\edef\\\)'$MODULE'@/%'$PREFIX'\1/' \
|
||||||
@ -103,4 +109,5 @@ cat "$INPUT" \
|
|||||||
> "$OUTPUT"
|
> "$OUTPUT"
|
||||||
|
|
||||||
|
|
||||||
# vim:set ts=4 sw=4 nowrap :
|
#----------------------------------------------------------------------
|
||||||
|
# vim:set ts=4 sw=4 nowrap :
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user