I am trying to remove the bullets in some HTML code created with a bash script. Currently, I seem to be having difficulty applying the style to the whole program. I have little to no experience with html and believe i may be misunderstanding or misplacing . Any help would be appreciated. The code is for a file hierarchy for a passed in directory.
#!/bin/bash
cd "$1" || exit 1
cat<<EOF
<html>
<body>
<style>
ul.tree, ul.tree ul {
list-style-type: none;
}
</style>
EOF
NESTDEPTH=0
find ./* | while read F; do
SLASHES=$(echo "$F" | tr -c -d '/' | wc -m | tr -d ' ');
if [ $SLASHES -gt $NESTDEPTH ];then
VAR=$(($SLASHES - $NESTDEPTH))
while [ $VAR -gt 0 ]; do
printf "<ul> \n"
VAR=$(($VAR - 1))
done
elif [ $NESTDEPTH -gt $SLASHES ]; then
VAR=$(($NESTDEPTH - $SLASHES))
while [ $VAR -gt 0 ];do
printf "</ul> \n"
VAR=$(($VAR - 1))
done
else
exit 1
fi
NESTDEPTH=$SLASHES
FNAME=$(basename "$F")
echo "<li>$FNAME"
while [ $NESTDEPTH -ne 0 ];do
echo "</ul>"
NESTDEPTH=$(($NESTDEPTH - 1))
done
done
cat<<EOF
</body>
</html>
EOF
It looks like the no-bullet style only applies to lists marked with the class "tree" but it doesn't look as though "tree" is ever applied to any of the <ul>
s. Try changing the CSS selector from ul.tree, ul.tree ul
to just ul
.