Commit 3483169c authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add templates preprocessing scripts from Thanassis

parent 354e6571
all:
$(MAKE) -C preprocess
clean:
rm -rf preprocess/output/*
find preprocess/templates/ -type f -delete
all: clean
[ -f templates_from_wiki ] && ./maker.sh ./templates_from_wiki
clean:
rm -rf output templates
BEGIN {
inside=0;
insideSection=0;
}
/^=== / {
fname=$2;
order = "output/order.txt";
print fname > order;
insideSection=1;
}
/class.*wikitable/ {
inside=1;
}
/^\|}/ {
inside=0;
insideSection=2;
print $0 > fname ;
}
{
if (inside && insideSection == 1) {
print $0 > fname;
}
if (insideSection == 1 && !inside) {
pre = sprintf("%s.pre", fname);
print $0 > pre;
}
if (insideSection == 2 && !inside) {
post = sprintf("%s.post", fname);
print $0 > post;
}
}
#!/bin/bash
mkdir -p templates/concurrency_view/sub
mkdir -p templates/skeletons/sub
mkdir -p output
cat $1 | awk -f f.awk
find . -type f -iname '*tmplt' | \
cut -c 3- | \
while read ANS ; do \
mv -i "$ANS" output/"$(echo ${ANS/.tmplt/} | sed 's,[/-],_,g')" ; \
done
find . -type f -iname '*.pre' | \
cut -c 3- | \
while read ANS ; do \
cat "$ANS" | sed 1d > output/"$(echo ${ANS/.tmplt.pre/.pre} | sed 's,[/-],_,g')"
done
find . -type f -iname '*.post' | \
cut -c 3- | \
while read ANS ; do \
cat "$ANS" | sed 1d > output/"$(echo ${ANS/.tmplt.post/.post} | sed 's,[/-],_,g')"
done
rm -rf templates
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment