quest/justfile

76 lines
1.9 KiB
Plaintext
Raw Normal View History

2022-07-24 14:15:32 +00:00
# show all commands
default:
just --list --unsorted
2022-10-29 02:00:03 +00:00
# only run if changes are made to macros
freeze:
m4 -F macros.m4f macros
2022-07-31 01:40:41 +00:00
# build referee facing html
2022-07-26 22:08:23 +00:00
spoilers:
cat basement.order \
| xargs pandoc -f markdown -t markdown \
2022-10-29 02:00:03 +00:00
| m4 -R macros.m4f - \
| pandoc \
2022-07-24 14:15:32 +00:00
-t html \
--standalone \
--toc \
--metadata title="BASEMENT QUEST" \
-H includes/styles.html \
> /tmp/spoilers.html && cp /tmp/spoilers.html www/spoilers.html
2022-07-24 14:15:32 +00:00
2022-07-31 01:40:41 +00:00
# build player facing html
2022-07-26 22:08:23 +00:00
public:
cat basement.order \
| xargs -I % pandoc -f markdown -t markdown --template=templates/public.tmpl % \
2022-10-29 02:00:03 +00:00
| m4 -R macros.m4f - \
| pandoc -t html \
2022-07-24 14:15:32 +00:00
--standalone \
--toc \
--metadata title="BASEMENT QUEST" \
-H includes/styles.html \
> /tmp/quest.html && cp /tmp/quest.html www/index.html
2022-07-26 22:08:23 +00:00
# build rss
rss:
#!/bin/sh
echo "Building xml file!!"
echo "<?xml version=\"1.0\" ?>" > www/rss.xml
echo "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">" >> www/rss.xml
echo " <channel>" >> www/rss.xml
2022-07-27 02:41:08 +00:00
echo " <atom:link href=\"https://tilde.town/~dozens/quest/rss.xml\" rel=\"self\" type=\"application/rss+xml\" />" >> www/rss.xml
2022-07-26 22:08:23 +00:00
echo " <title>BASEMENT QWEST</title>" >> www/rss.xml
2022-07-27 02:41:08 +00:00
echo " <link>https://tilde.town/~dozens/quest/rss.xml</link>" >> www/rss.xml
2022-07-26 22:08:23 +00:00
echo " <description>Friends having ADVENTURES! Huzzah!</description>" >> www/rss.xml
2022-07-27 02:41:08 +00:00
fd . 'src/' -e md -x pandoc -f markdown+autolink_bare_uris --template=templates/feeditem.tmpl >> www/rss.xml
2022-07-26 22:08:23 +00:00
echo " </channel>" >> www/rss.xml
echo "</rss> " >> www/rss.xml
echo "Done building xml file \o/"
2022-07-27 02:41:08 +00:00
# upload
up:
rsync -zaP www/* tilde:public_html/quest/
2022-09-09 19:38:43 +00:00
# copy assets
assets:
rsync -vup assets/* www/
2022-09-09 19:38:43 +00:00
2022-10-29 19:18:02 +00:00
# build public, spoilers, assets, and rss
2022-09-09 19:38:43 +00:00
build: spoilers public rss assets
2022-07-31 01:40:41 +00:00
# watch for changes
watch:
ls src/**/**.md | entr just build
# open index
open:
open www/index.html
2022-10-29 19:18:02 +00:00
# watch and open
2022-07-31 01:40:41 +00:00
dev: open watch
# build and upload
all: build up