update poorkyll.sh to most recent version, add more info to README.md

This commit is contained in:
YargoA2 2017-01-03 01:34:04 +01:00
parent 873d8161c8
commit e2093586fc
3 changed files with 53 additions and 10 deletions

View File

@ -1,3 +1,21 @@
# bin
Here are scripts used for conversion or handling sources.
This directory contains scripts used for conversion or handling sources.
They are run on a local machine to generate HTML files, which are then
commited to the repository for publication on github.io.
- `convchars.sh` is a sed/tr/shell script converting German umlauts and
some other special characters into HTML entities
- `mrkdwn.pl` is a stripped down version of the
[original Markdown]( https://daringfireball.net/projects/markdown/ )
Perl script _(note: needs at least Perl version 5.006)_
- `poorkyll.sh` uses `convchars.sh` and `mrkdwn.pl` to generate `*.html`
files from all `*.md` files in the current directory; it can be given
the name of a style file (which must be accessible on the host) for
inclusion in the generated HTML files. If you give it the name of a
nonexistent style file (like "-h"...) it will print some help/hints,
including where it expects the other two scripts.
---
_(2017 YCB)_

View File

@ -1,6 +1,8 @@
<html><head><title>
scripts
</title></head><body>
</title>
</head>
<body>
<h1>scripts</h1>
<p>This is a script directory, not meant for browsing.</p>

View File

@ -1,12 +1,35 @@
#!/bin/sh
# (2015 YCB)
# (2015,2016 YCB)
# change bindir according to your needs!
bindir=${BINDIR:-$HOME/bin}
if test "$1" = ""
then sfl=''
echo ": no stylesheet used"
else if test -f "$1"
then sfl="<link rel=\"stylesheet\" type=\"text/css\" href=\"$1\" />"
echo ": using stylesheet $1"
else cat <<EOU
stylesheet '$1' missing!
usage: $0 [<style>]
will generate files with .html suffix from all files with .md suffix,
converting Markdown to HTML, and add a link to the stylesheet <style>,
or no stylesheet if argument is missing
( scripts mrkdwn.pl and convchars.sh must be present and executable
in directory '$bindir' )
EOU
exit
fi
fi
for mf in *.md
do hf=${mf%md}html
do hf="${mf%md}html"
echo -n ": $mf / $hf : "
echo '<html><head><title>' >$hf
grep '^#' $mf | head -n 1 | sed -e 's/#* *//' | tee -a $hf
echo '</title></head><body>' >>$hf
convchars.sh <$mf | mrkdwn.pl >>$hf
echo '</body></html>' >>$hf
chmod a+r $hf
echo '<html><head><title>' >"$hf"
grep '^#' "$mf" | head -n 1 | sed -e 's/#* *//' | tee -a "$hf"
echo '</title>' >>"$hf"
echo "$sfl</head>" >>"$hf"
echo '<body>' >>"$hf"
$bindir/convchars.sh <$mf | $bindir/mrkdwn.pl >>"$hf"
echo '</body></html>' >>"$hf"
chmod a+r "$hf"
done