Share

diary - console-based diary

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

dairy2html

You are viewing a single message from this topic. View all messages.

  1. 2003-08-25 18:51:06 UTC
    Hi,
    I found your program while searching for a kind og blog, which does not need php, mysql or anything like that. So I like your Program and I will use it. I have written some small enhancements, which i called dairy2html:
    #!/bin/bash

    DIARYDIR="$HOME/.diary"
    PAGEDIR="$DIARYDIR/pages"
    PICDIR="$DIARYDIR/pictures"

    cat $DIARYDIR/html_head.txt > $DIARYDIR/diary.html

    for i in `ls -r $PAGEDIR`; do
    cat $PAGEDIR/$i | sed -e '1s/\(.*\)/<h2>\1<\/h2>/;2,$s/$/\1<br>/' >> $DI
    ARYDIR/diarytmp.html
    #insert pictures
    for j in 1 2 3 4 5 6 7 8 9 ; do
    if [ -f $PICDIR/$i.$j.jpg ] ; then
    echo "<img src=\"pictures/$i.1.jpg\" alt=\"picture\">" >
    > $DIARYDIR/diarytmp.html
    fi
    done
    done

    cat $DIARYDIR/diarytmp.html >> $DIARYDIR/diary.html
    rm $DIARYDIR/diarytmp.html
    cat $DIARYDIR/html_foot.txt >> $DIARYDIR/diary.html

    Feel free to take it inside the repository, with, or without changes ...

    Bye

    Kim
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.