Skip to content

test md to HTML

test md to HTML #6

Workflow file for this run

# Develop code to build markup files into HTML
#
name: test md to HTML
on: [workflow_dispatch]
permissions:
contents: write
id-token: write
pages: write
jobs:
build: # Build web pages
runs-on: ubuntu-latest
steps:
- name: Install pandoc
uses: pandoc/actions/setup@v1
- name: Checkout
uses: actions/checkout@v4
- name: convert tutorials
run: |
cd MDtutorials
for path in ./*; do
[ -d "${path}" ] || continue # skip if not a directory
dirname="$(basename "${path}")"
dest="../$dirname)
mkdir -v ${dest}
[ -d "${path}/data" ] || cp -rv "${path}/data" ${dest}/
[ -d "${path}/imgs" ] || cp -rv "${path}/imgs" ${dest}/
cp -v tutorial.css ${dest}
for fil in $dirname/*.md; do
echo $fil
outfile="${dest}/$(basename "${fil%.md}.html")"
echo $outfile
pandoc --standalone ${fil} --css tutorial.css -o ${outfile}
sed -i '' 's/<figure>/<BR clear=all><figure>/g' ${outfile}
done
done