commit 4de42f743b24e147c72db43128fa02088191353a
parent cd92f7db43796535467f080de9b2806975fdf935
Author: xfnw <xfnw@ttm.sh>
Date: Fri, 14 Aug 2020 18:47:35 -0400
comic jump buttons
Diffstat:
4 files changed, 48 insertions(+), 20 deletions(-)
diff --git a/template/page.html b/template/page.html
@@ -10,9 +10,18 @@
</head>
<body>
+<h1>XFSSTITLE</h1>
-<!-- xfss -->
+<center>
+ <a href="1.html"><<</a>
+ <a href="PRE.html"><</a>
+ <a href="RANDOM.html">?</a>
+ <a href="NEXT.html">></a>
+ <a href="LAST.html">>></a>
+</center>
+
+<!-- COMIC -->
</body>
</html>
diff --git a/template/style.css b/template/style.css
@@ -10,6 +10,10 @@ div, pre, summary {
padding: 10px;
}
+img.comic {
+ width:100%
+}
+
div {
border: 1px solid #aea;
border-left: 6px solid #7b7;
diff --git a/xfss b/xfss
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-BOOPTMP=$(mktemp)
-
-for fn in $(ls src); do
-NEWF=${fn%??}html
-TITLE=$(echo ${fn%???} | sed 's/_/ /g' | sed -e 's/[]$.*[\^]/\\&/g')
-echo "rendering $NEWF..."
-
-pandoc --from gfm <src/$fn >$BOOPTMP
-cp template/page.html $NEWF
-
-sed "/<body>/r $BOOPTMP" template/page.html > $NEWF
-
-sed -i "s/XFSSTITLE/$TITLE/" $NEWF
-
-done
-
-
diff --git a/xfwc b/xfwc
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+BOOPTMP=$(mktemp)
+
+TOTAL=$(ls src | wc -w)
+
+for fn in $(ls src); do
+NUM=$(echo "${fn%???}" | sed 's/[^0-9]*//g')
+NEWF=$NUM.html
+TITLE=$(echo ${fn%????} | sed 's/_/ /g; s/[0-9]*//g' | sed -e 's/[]$.*[\^]/\\&/g')
+echo "rendering $NEWF..."
+
+echo "<img class='comic' src='src/$fn'/>" > $BOOPTMP
+cp template/page.html $NEWF
+
+sed "/COMIC -->/r $BOOPTMP" template/page.html > $NEWF
+
+sed -i "s/XFSSTITLE/$TITLE/g" $NEWF
+
+sed -i "s/RANDOM/"$(( ( RANDOM % TOTAL ) + 1 ))"/" $NEWF
+
+
+sed -i "s/LAST/"$TOTAL"/" $NEWF
+
+
+[ "$NUM" = "1" ] || sed -i "s/PRE/"$(( NUM - 1 ))"/" $NEWF
+
+[ "$NUM" = "$TOTAL" ] || sed -i "s/NEXT/"$(( NUM + 1 ))"/" $NEWF
+
+sed -i 's/PRE/#/; s/NEXT/#/' $NEWF
+
+done
+
+