test md to HTML #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: sed test | |
run: | | |
mkdir test | |
echo "<figure>" > test.txt | |
echo "before" | |
cat test.txt | |
man sed | |
echo "after" | |
cat test.txt | |
exit | |
- 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 ${dest} | |
[ ! -d "${path}/data" ] || cp -r "${path}/data" ${dest}/ | |
[ ! -d "${path}/imgs" ] || cp -r "${path}/imgs" ${dest}/ | |
cp 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 | |
ls -R ${dest} | |
done | |