mirror of
https://github.com/flynx/photobook.git
synced 2025-11-02 12:20:08 +00:00
experimenting with dynamic fields in templates...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3eac98bb5d
commit
7ae71693ec
@ -223,6 +223,23 @@ getCaption(){
|
||||
echo ${C[*]}
|
||||
}
|
||||
|
||||
# XXX EXPERIMENTAL...
|
||||
# index ${VAR} variables in templates...
|
||||
declare -A TEMPLATE_INDEX
|
||||
indexTemplates(){
|
||||
#echo indexing templates...
|
||||
local lst
|
||||
local tpl
|
||||
for tpl in "${TEMPLATE_PATH}"/* ; do
|
||||
#echo ${tpl}...
|
||||
lst=( $(cat "${tpl}" \
|
||||
| grep -o '\${[A-Z0-9]\+}' \
|
||||
| sed 's/\${\(.*\)}/\1/g' \
|
||||
| sort) )
|
||||
TEMPLATE_INDEX[$(basename "${tpl}")]=${lst[@]}
|
||||
done
|
||||
}
|
||||
|
||||
getTemplate(){
|
||||
local SPREAD=$1
|
||||
local TYPE=$2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user