systemnotes org Location: System Notes / download / Shell / html2page.sh.html

Help for Aspiring Sysadmins

Linux / Open Source / Howto / Tips & Tricks

Language: en
 






Latest News

2009.07.29
RHCE Flash Cards Released

2008.01.11
Website Design Updated. This is a work in progress...

2008.01.11
RHCE Study Guide Removed due to a potential copyright issue

2007.12.03
RHCE Study Guide Released

 

Links:



Do you find this site useful?

donate









Spread Firefox Affiliate Button

Documents


#!/bin/sh

# html2page
# scottm, 2009/07/30
# Extracts data from .html files to .page files for webgen.
# This allows OpenOffice.org presentations to be converted to a webgen site.
# Contents of .page files could also be used for a content management site.
# run from cygwin, or linux
# .page files are overwritten

# Read .html files that OpenOffice.org Impress generated for each slide
#for file in `ls img.html text.html|awk -F\. ‘{print $1}’`
echo "Generating .page files…"
for file in `ls .html|sed -e s/.html//`
do 
        #generate title section from slide title
        export title=`grep "<title>" ${file}.html | sed -e s#<title>##g’| sed -e s#</title>##g`
        echo "-" > ${file}.page
        echo "title: ${title}" >> ${file}.page
        echo "-" >> ${file}.page
        #strip out extra html lines from top an bottom
done
echo "cleaning .page files…"
# get rid of the closing body tag (may not be on a line by itself)
sed -e s#</body>## -i 
.page

echo "adding tags…"
# add some line breaks to the img version to make the menu look better
sed -e s#\<br\>#br/><br/><br/><br/# -i img.page

# resize picasa files
sed -e s/width="640" height="479"/width="540" height="404"/g -i target
.page

#optional
unix2dos *.page

echo "done."