initial checkin
This commit is contained in:
commit
a8157509b6
|
@ -0,0 +1,10 @@
|
||||||
|
# mk_nb_pages repo
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This repo contains the mk_nb_pages shell script, which creates simple web
|
||||||
|
pages out of the contents of the nb notebooks located in ~/.nb. These web pages
|
||||||
|
are placed in a syncthing source directory, where they will be copied to my cell
|
||||||
|
phone. This allows me to view the contents of my nb notes while away with only
|
||||||
|
the phone for access.
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
srcDir="/home/rmorrow/.nb/"
|
||||||
|
bookList="journal notes exercise"
|
||||||
|
|
||||||
|
dstDir="/home/rmorrow/wikis/"
|
||||||
|
|
||||||
|
for book in $bookList
|
||||||
|
do
|
||||||
|
dstFile="${dstDir}/nb_${book}.html"
|
||||||
|
list=$(ls -1 ${srcDir}/${book}/*.md | sort -r)
|
||||||
|
|
||||||
|
echo "<HTML>" > ${dstFile}
|
||||||
|
echo "<HEAD>" >> ${dstFile}
|
||||||
|
echo " <TITLE>nb_${book}</TITLE>" >> ${dstFile}
|
||||||
|
echo "</HEAD>" >> ${dstFile}
|
||||||
|
echo "<BODY>" >> ${dstFile}
|
||||||
|
echo "<HR>" >> ${dstFile}
|
||||||
|
echo "<P>" >> ${dstFile}
|
||||||
|
|
||||||
|
for i in $list
|
||||||
|
do
|
||||||
|
title=$(head -1 $i)
|
||||||
|
target=$(basename $i)
|
||||||
|
|
||||||
|
echo "<H3>${target}</H3>" >> ${dstFile}
|
||||||
|
echo "<P>" >> ${dstFile}
|
||||||
|
echo "<PRE>" >> ${dstFile}
|
||||||
|
cat $i >> ${dstFile}
|
||||||
|
echo "</PRE>" >> ${dstFile}
|
||||||
|
echo "<P>" >> ${dstFile}
|
||||||
|
echo "<HR>" >> ${dstFile}
|
||||||
|
echo "<P>" >> ${dstFile}
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "</BODY>" >> ${dstFile}
|
||||||
|
echo "</HTML>" >> ${dstFile}
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in New Issue