From 17e6b67d689c623802d4bec3511270a89f2a4091 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 22 Jan 2009 07:26:10 +0100 Subject: [PATCH] Make a little table of contents Signed-off-by: Johannes Schindelin --- upload.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/upload.sh b/upload.sh index f6dc827ab0..ca1292006d 100755 --- a/upload.sh +++ b/upload.sh @@ -12,7 +12,6 @@ # automatically renamed using the current timestamp. # TODO: generate an RSS feed, too -# TODO: generate TOC # TODO: have a configurable maximum number of entries per page, and links # to older pages @@ -151,12 +150,32 @@ make_html () {

$TITLE

EOF + # make toc + toc_width=400px + toc_style="position:absolute;top:50px;left:810px;width=$toc_width" + echo "
" + echo "
" + echo '

    ' + for file in $(ls -r source-*.txt) + do + basename=${file%.txt} + timestamp=${basename#source-} + date="$(date +"%d %b %Y" -d @$timestamp)" + title="$(sed 1q < $file | markup)" + echo "
  1. $date $title" + done + echo '
' + echo '

' + echo '
' + + # timestamps will not need padding to sort correctly, for some time... for file in $(ls -r source-*.txt) do basename=${file%.txt} timestamp=${basename#source-} echo "
$(make_date $timestamp)
" + echo "" echo "

$(sed 1q < $file | markup)

" echo "" echo "

" -- 2.11.4.GIT