bowl 4
This commit is contained in:
parent
9f40a83d41
commit
d97a95f80f
@ -321,14 +321,14 @@ with open('../$0', 'r') as f:
|
|||||||
with open(day.split('\n')[0]+'.html', 'x') as g:
|
with open(day.split('\n')[0]+'.html', 'x') as g:
|
||||||
g.write(prefix+day+'\n'+suffix)
|
g.write(prefix+day+'\n'+suffix)
|
||||||
";cd blah;for f in *.html;do #in glob we trust
|
";cd blah;for f in *.html;do #in glob we trust
|
||||||
test -z "$last" || sed -i "s,_NAVIGATION_,$nav<A HREF=\"$f\">\></A></P>," \
|
test -z "$last" || sed -i "s,_NAVIGATION_,$nav<A HREF=\"$f\">\></A></P>," \
|
||||||
"$last";nav="<P>";test -z "$last"||nav="$nav<A HREF=\"$last\">\<</A>"
|
"$last";nav="<P>";test -z "$last"||nav="$nav<A HREF=\"$last\">\<</A>"
|
||||||
nav="$nav<A HREF=\"index.html\">^</A>";last="$f";done
|
nav="$nav<A HREF=\"index.html\">^</A>";last="$f";done
|
||||||
sed -i "s,_NAVIGATION_,$nav</P>," "$last";for f in *.html;do #e unibus puellam
|
sed -i "s,_NAVIGATION_,$nav</P>," "$last";for f in *.html;do #e unibus puellam
|
||||||
fi="$(echo "$f" | cut -d . -f 1)";test "$fi" = "index" && continue
|
fi="$(echo "$f" | cut -d . -f 1)";test "$fi" = "index" && continue
|
||||||
printf '<A HREF="/blah/%s.html">%s</A>\n' "$fi" "$fi"; done|sort -r|\
|
printf '<A HREF="/blah/%s.html">%s</A>\n' "$fi" "$fi"; done|sort -r|\
|
||||||
sed -e "1i<!DOCTYPE html><HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY><PRE>\
|
sed -e "1i<!DOCTYPE html><HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY><PRE>\
|
||||||
<A HREF="..">..</A>" -e '$a</PRE></BODY></HTML>'>index.html
|
<A HREF="..">..</A>" -e '$a</PRE></BODY></HTML>'>index.html
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
That's the source code to this blog, in its entirety. My writing
|
That's the source code to this blog, in its entirety. My writing
|
||||||
@ -362,7 +362,7 @@ with open('../$0', 'r') as f:
|
|||||||
]
|
]
|
||||||
) + '\n'
|
) + '\n'
|
||||||
continue
|
continue
|
||||||
elif day.split('\n')[0][:4] == '<!--':
|
elif day.split('\n')[0][:4] == '<!--':
|
||||||
suffix = day
|
suffix = day
|
||||||
continue
|
continue
|
||||||
with open(day.split('\n')[0]+'.html', 'x') as g:
|
with open(day.split('\n')[0]+'.html', 'x') as g:
|
||||||
@ -389,14 +389,14 @@ cd blah
|
|||||||
for f in *.html
|
for f in *.html
|
||||||
do
|
do
|
||||||
test -z "$last" || sed -i \
|
test -z "$last" || sed -i \
|
||||||
-e "s,_NAVIGATION_,$nav<A HREF=\"$f\">\></A></P>," "$last"
|
-e "s,_NAVIGATION_,$nav<A HREF=\"$f\">\></A></P>," "$last"
|
||||||
nav="<P>"
|
nav="<P>"
|
||||||
test -z "$last" \
|
test -z "$last" \
|
||||||
|| nav="$nav<A HREF=\"$last\">\<</A>"
|
|| nav="$nav<A HREF=\"$last\">\<</A>"
|
||||||
nav="$nav<A HREF=\"index.html\">^</A>"
|
nav="$nav<A HREF=\"index.html\">^</A>"
|
||||||
last="$f"
|
last="$f"
|
||||||
done
|
done
|
||||||
sed -i "s,_NAVIGATION_,$nav</P>," "$last"
|
sed -i "s,_NAVIGATION_,$nav</P>," "$last"
|
||||||
|
|
||||||
This replaces _NAVIGATION_ with an actual navigation bar. The actual
|
This replaces _NAVIGATION_ with an actual navigation bar. The actual
|
||||||
string has two underscores before and after NAVIGATION but this blog is held
|
string has two underscores before and after NAVIGATION but this blog is held
|
||||||
@ -418,12 +418,12 @@ for f in *.html
|
|||||||
fi="$(echo "$f" | cut -d . -f 1)"
|
fi="$(echo "$f" | cut -d . -f 1)"
|
||||||
test "$fi" = "index" \
|
test "$fi" = "index" \
|
||||||
&& continue
|
&& continue
|
||||||
printf '<A HREF="/blah/%s.html">%s</A>\n' "$fi" "$fi"
|
printf '<A HREF="/blah/%s.html">%s</A>\n' "$fi" "$fi"
|
||||||
done \
|
done \
|
||||||
| sort -r \
|
| sort -r \
|
||||||
| sed \
|
| sed \
|
||||||
-e "1i\
|
-e "1i\
|
||||||
<!DOCTYPE html><HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY><PRE><A HREF="..">..</A>" \
|
<!DOCTYPE html><HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY><PRE><A HREF="..">..</A>" \
|
||||||
-e '$a</PRE></BODY></HTML>' \
|
-e '$a</PRE></BODY></HTML>' \
|
||||||
> index.html
|
> index.html
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user