Last active
May 8, 2024 19:08
-
-
Save ailtonbsj/7285f8acb1e7bafae44de488cfd38d39 to your computer and use it in GitHub Desktop.
Hackers for good HTML Reporter
This file contains hidden or 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
#!/bin/bash | |
# | |
# USAGE: h4g-html-reporter.sh > module.html | |
# | |
# Folders structure: | |
# . | |
# ├── 1.1 | |
# │ ├── 1.png | |
# │ ├── 6.png | |
# ├── 1.2 | |
# │ ├── 2.png | |
# │ ├── 8.png | |
cat << EOF | |
<style> | |
@media print { | |
.pagebreak { page-break-before: always; } | |
div { break-inside: avoid; } | |
} | |
</style> | |
EOF | |
ls -1d */ | cut -d/ -f1 | sort -n | while read activity; do | |
echo "<h1 class=\"pagebreak\">Atividade $activity</h1>" | |
ls -1 $activity/ | sort -n | while read screen; do | |
screenName="$(echo $screen | cut -d. -f1)" | |
echo "<div>" | |
echo "<h2>Passo $screenName</h2>" | |
echo "<img src=\"$activity/$screen\" width=\"100%\" />" | |
echo "</div>" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment