Dozens B. McCuzzins 2022-11-01 15:18:05 -06:00
commit 06935185be
5 changed files with 126 additions and 0 deletions

43 100644
View File

@ -0,0 +1,43 @@
# Rolldown
> Rolling dice in markdown!
> Can it be done??
watch the video:
this repo contains:
├── db.rec
├── justfile
├── macros.m4
1. -- this file
2. db.rec -- a 'recfile' containing one record per possible outcome of rolling 2d6 based on a loose interpretation of the Powered By The Apocalypse system
3. justfile -- just a collection of scripts
4. macros.m4 -- an m4 macros file. no longer used, but preserved for historical value
5. -- a daring story about love, danger, and potatoes
other goodies:
- tmux: `tmux send-keys` allows you to send arbitrary key strokes to other tmux panes. In the video, I used it to tell lynx to refresh itself each time the html file is recompiled.
- snippets: here's the snippet i ended up using to roll the dice:
snippet res "roll 2d6!"
`recsel -P result -m 1 db.rec`
more reading:

db.rec 100644
View File

@ -0,0 +1,35 @@
%rec: roll
%doc: a dice roll
id: 2
result: hella bad
id: 3
result: bad
id: 4
result: bad
id: 5
result: bad
id: 6
result: bad
id: 7
result: mixed success
id: 8
result: success with consequence
id: 9
result: hard choice
id: 10
result: good
id: 11
result: good
id: 12
result: uncomfortably good

justfile 100644
View File

@ -0,0 +1,23 @@
# show all commands
just --list --unsorted
# build html
pandoc -t html -o index.html
# watch for updates and build html
ls | entr -c just html
# m4 demonstration
echo "hello this is patrick" | m4 -D "patrick=krusty krab"
# roll some dice
recsel -P result -m 1 db.rec
# show all bad results
recsel -e "id <= 6" -G result -p id,result db.rec

macros.m4 100644
View File

@ -0,0 +1 @@
define(`__result', `esyscmd(recsel -P result -m 1 db.rec)')

24 100644
View File

@ -0,0 +1,24 @@
# my story #
## in the beginning ##
i was walking down the street and things were bad
## and then ##
I saw a bear! and i tried to run away, and I did bad. so i did not evade the bear, in fact i tripped and fell!
## and so
and so i tried to appeal to reason, and i the bear paused and i got to get away, but i sprained my ankle! and had to hide behind a dumpster for 3 hours until it went away
## eventually
I finally got to the library and was able to return my books, but the books were so overdue, that the feral librarians sold me into indentured servitude
## later
I was toiling away at the hobbit's potato farm. and i made a plan to escape. but the farmer's daughter found out, and threatened to tell if I dind't take her with me.
so under the cover of night, we tried to escape, but were captured by orcs, who planned eat us during the Festival of the Blood Moon