Compare commits
No commits in common. "99f98d08ca500f41da5ef9c7824d165dfcc633f0" and "9bac5ecb7026207a3bb66e580c21414d8028018e" have entirely different histories.
99f98d08ca
...
9bac5ecb70
2
00001.md
2
00001.md
|
@ -4,11 +4,13 @@
|
||||||
(@)(@) {0,0}
|
(@)(@) {0,0}
|
||||||
(~~~~) ./)_)
|
(~~~~) ./)_)
|
||||||
(>vv<) " "
|
(>vv<) " "
|
||||||
|
|
||||||
\
|
\
|
||||||
ya see, some people go real fast
|
ya see, some people go real fast
|
||||||
and other people they go real slow
|
and other people they go real slow
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
(@)(@) {0,0} -- Hoo?
|
(@)(@) {0,0} -- Hoo?
|
||||||
(~~~~) ./)_)
|
(~~~~) ./)_)
|
||||||
|
|
18
bin/rss.sh
18
bin/rss.sh
|
@ -1,18 +0,0 @@
|
||||||
#bin/sh
|
|
||||||
echo "<rss version=\"2.0\"><channel><title>It's Pro Toad and Superb Owl</title>" > feed.xml
|
|
||||||
echo "<link>https://git.tilde.town/dozens/protoadandsuperbowl</link><description>It's Pro Toad and Superb Owl!</description><atom:link rel="self" type="application/rss+xml" href="https://git.tilde.town/dozens/protoadandsuperbowl/raw/branch/master/feed.xml"/><generator>/bin/sh</generator>" >> feed.xml
|
|
||||||
|
|
||||||
|
|
||||||
for f in $(find . -type f -iname '*.md' -depth 1 ! -name 'README.md' | sed 's/\.\///'); do
|
|
||||||
echo "<item>
|
|
||||||
<title>$f</title>
|
|
||||||
<link>https://git.tilde.town/dozens/protoadandsuperbowl/raw/branch/master/$f</link>
|
|
||||||
<pubDate>$(stat -f "%m%t%Sm %N" $f | cut -f2 | cut -f1-4 -d ' ')</pubDate>
|
|
||||||
<description><![CDATA[" >> feed.xml
|
|
||||||
pandoc $f >> feed.xml
|
|
||||||
echo "]]></description>
|
|
||||||
</item>" >> feed.xml
|
|
||||||
done
|
|
||||||
|
|
||||||
echo '</channel></rss>' >> feed.xml
|
|
||||||
|
|
195
bin/toad.md
195
bin/toad.md
|
@ -1,195 +0,0 @@
|
||||||
# toad.md
|
|
||||||
|
|
||||||
> the pro toad and superb owl comic generator
|
|
||||||
|
|
||||||
## about
|
|
||||||
|
|
||||||
This program reads a script file and interpolates its contents with some ascii art, and then writes the result to stdout.
|
|
||||||
|
|
||||||
The end goal is automating the creation of [Pro Toad and Superb Owl][ptso] comics.
|
|
||||||
|
|
||||||
[ptso]: https://git.tilde.town/dozens/protoadandsuperbowl
|
|
||||||
|
|
||||||
## usage
|
|
||||||
|
|
||||||
$ retro toad.md path/to/script.txt > comic.txt
|
|
||||||
|
|
||||||
## components
|
|
||||||
|
|
||||||
the components of the program are:
|
|
||||||
|
|
||||||
1. IO - open the text file, read it line by line, close the file, write to stdout
|
|
||||||
|
|
||||||
2. input parser - there are 2 line types in the script file:
|
|
||||||
|
|
||||||
- a text line, and
|
|
||||||
- a separator line: a special `---` line to separate panels.
|
|
||||||
|
|
||||||
3. comic builder - build the first panel, the second panel (no input needed, just output tanel 2), and the 3rd panel (repeat steps needed for 1st panel)
|
|
||||||
|
|
||||||
4. panel builder - for as long as art array has length, and as long as the current input line has length or until the input parser hits the separator line or the end of the file, call the line builder with the next line of the art array (if there is one) and the input line.
|
|
||||||
|
|
||||||
If the input line has no length, and the next line is not the separator, have the line builder insert a "blank line" and get a new input line.
|
|
||||||
|
|
||||||
5. line builder - given two strings, build a new string containing the first, and appending words from the second up to a total of ~80 cols.
|
|
||||||
|
|
||||||
## argument validation
|
|
||||||
|
|
||||||
print a helpful message if the script is called without an argument
|
|
||||||
|
|
||||||
~~~
|
|
||||||
script:arguments #0 eq? [ 'Error:_Missing_argument s:put ] if;
|
|
||||||
~~~
|
|
||||||
|
|
||||||
## panels
|
|
||||||
|
|
||||||
okay let's go
|
|
||||||
|
|
||||||
There are two panels: one where toad speaks, and one where owl speaks. Let's save each to an array, one string per line.
|
|
||||||
|
|
||||||
Here's toad (panels 1 & 3):
|
|
||||||
|
|
||||||
~~~
|
|
||||||
'toad var
|
|
||||||
{
|
|
||||||
'_(@)(@)_____{0,0}__
|
|
||||||
'_(~~~~)____./)_)___
|
|
||||||
'_(>vv<)______"_"___
|
|
||||||
'___________________
|
|
||||||
'_____\_____________
|
|
||||||
} !toad
|
|
||||||
~~~
|
|
||||||
|
|
||||||
Here's owl (panel 2):
|
|
||||||
|
|
||||||
~~~
|
|
||||||
'owl var
|
|
||||||
{
|
|
||||||
'_(@)(@)_____{0,0}__--_Hoo?
|
|
||||||
'_(~~~~)____./)_)__________
|
|
||||||
'_(>vv<)______"_"__________
|
|
||||||
} !owl
|
|
||||||
~~~
|
|
||||||
|
|
||||||
Also here are some code fences, because we'll need those too:
|
|
||||||
|
|
||||||
~~~
|
|
||||||
:fences '``` s:put nl ;
|
|
||||||
~~~
|
|
||||||
|
|
||||||
## Input/output
|
|
||||||
|
|
||||||
open the file for reading and save the file handle to `file`
|
|
||||||
|
|
||||||
save the file fize. we'll use this to check for end of file.
|
|
||||||
|
|
||||||
~~~
|
|
||||||
'handle var
|
|
||||||
'size var
|
|
||||||
|
|
||||||
#0 script:get-argument
|
|
||||||
file:open-for-reading !handle !size
|
|
||||||
|
|
||||||
:get-line @handle file:read-line ;
|
|
||||||
~~~
|
|
||||||
|
|
||||||
## Input Parser
|
|
||||||
|
|
||||||
TODO: this isn't tested or used anywhere yet.
|
|
||||||
|
|
||||||
~~~
|
|
||||||
{{
|
|
||||||
:end-of-file? (-) @handle file:tell @size gteq? ;
|
|
||||||
:separator? (m-f) '--- eq? ;
|
|
||||||
---reveal---
|
|
||||||
:end-of-section? (-f) separator? end-of-file? or ;
|
|
||||||
}}
|
|
||||||
~~~
|
|
||||||
|
|
||||||
## Line wrapping
|
|
||||||
|
|
||||||
Here's a line wrapping module.
|
|
||||||
|
|
||||||
~~~
|
|
||||||
{{
|
|
||||||
#0 'displayed var-n
|
|
||||||
#40 'wrap-at var-n
|
|
||||||
:wrap? dup @displayed + @wrap-at gt? ;
|
|
||||||
:display [ nl !displayed ] [ displayed v:inc-by ] choose s:put sp ;
|
|
||||||
---reveal---
|
|
||||||
:s:put-wrapped (s-) ASCII:SPACE s:tokenize
|
|
||||||
[ dup s:length wrap? display ] a:for-each
|
|
||||||
#0 !displayed ;
|
|
||||||
}}
|
|
||||||
~~~
|
|
||||||
|
|
||||||
src:
|
|
||||||
|
|
||||||
<https://github.com/crcx/retroforth/blob/master/example/wordwrap.retro>
|
|
||||||
|
|
||||||
|
|
||||||
## Panel 1
|
|
||||||
|
|
||||||
print out the first panel
|
|
||||||
|
|
||||||
ascii art:
|
|
||||||
|
|
||||||
~~~
|
|
||||||
fences
|
|
||||||
@toad [ s:put nl ] a:for-each
|
|
||||||
~~~
|
|
||||||
|
|
||||||
text:
|
|
||||||
|
|
||||||
~~~
|
|
||||||
[
|
|
||||||
get-line
|
|
||||||
dup '--- s:eq? not [
|
|
||||||
dup s:put-wrapped nl
|
|
||||||
] if
|
|
||||||
'--- s:eq? not
|
|
||||||
] while
|
|
||||||
~~~
|
|
||||||
|
|
||||||
wrap it up:
|
|
||||||
|
|
||||||
~~~
|
|
||||||
fences nl nl
|
|
||||||
~~~
|
|
||||||
|
|
||||||
## Panel 2
|
|
||||||
|
|
||||||
~~~
|
|
||||||
fences
|
|
||||||
@owl [ s:put nl ] a:for-each
|
|
||||||
fences nl nl
|
|
||||||
~~~
|
|
||||||
|
|
||||||
## Panel 3
|
|
||||||
|
|
||||||
print the ascii:
|
|
||||||
|
|
||||||
~~~
|
|
||||||
fences
|
|
||||||
@toad [ s:put nl ] a:for-each
|
|
||||||
~~~
|
|
||||||
|
|
||||||
print the text:
|
|
||||||
|
|
||||||
~~~
|
|
||||||
[
|
|
||||||
get-line
|
|
||||||
s:put-wrapped nl
|
|
||||||
@handle file:size @handle file:tell gt?
|
|
||||||
] while
|
|
||||||
~~~
|
|
||||||
|
|
||||||
wrap it up
|
|
||||||
|
|
||||||
~~~
|
|
||||||
fences
|
|
||||||
~~~
|
|
||||||
|
|
||||||
## Conclusion
|
|
||||||
|
|
||||||
That's all! That's the end
|
|
1
feed.xml
1
feed.xml
|
@ -1,5 +1,4 @@
|
||||||
<rss version="2.0"><channel><title>It's Pro Toad and Superb Owl</title>
|
<rss version="2.0"><channel><title>It's Pro Toad and Superb Owl</title>
|
||||||
<link>https://git.tilde.town/dozens/protoadandsuperbowl</link><description>It's Pro Toad and Superb Owl!</description><atom:link rel=self type=application/rss+xml href=https://git.tilde.town/dozens/protoadandsuperbowl/raw/branch/master/feed.xml/><generator>/bin/sh</generator>
|
|
||||||
<item>
|
<item>
|
||||||
<title>00004.md</title>
|
<title>00004.md</title>
|
||||||
<link>https://git.tilde.town/dozens/protoadandsuperbowl/raw/branch/master/00004.md</link>
|
<link>https://git.tilde.town/dozens/protoadandsuperbowl/raw/branch/master/00004.md</link>
|
||||||
|
|
20
justfile
20
justfile
|
@ -1,20 +0,0 @@
|
||||||
# list available commands and exit
|
|
||||||
default:
|
|
||||||
@just --list --unsorted
|
|
||||||
|
|
||||||
# build rss feed
|
|
||||||
rss:
|
|
||||||
@./bin/rss.sh
|
|
||||||
|
|
||||||
# watch toad.md for changes
|
|
||||||
watch:
|
|
||||||
@ls bin/toad.md | entr -c retro bin/toad.md src/00001.txt
|
|
||||||
alias dev := watch
|
|
||||||
|
|
||||||
# build all comics
|
|
||||||
build:
|
|
||||||
#!/usr/bin/env sh
|
|
||||||
for f in $(ls src/*.txt); do
|
|
||||||
base=`basename ${f}`
|
|
||||||
retro bin/toad.md ${f} > "${base/txt/md}"
|
|
||||||
done
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#bin/sh
|
||||||
|
echo "<rss version=\"2.0\"><channel><title>It's Pro Toad and Superb Owl</title>" > feed.xml
|
||||||
|
|
||||||
|
for f in $(find . -type f -iname '*.md' ! -name 'README.md' | sed 's/\.\///'); do
|
||||||
|
echo "<item>" >> feed.xml
|
||||||
|
echo "<title>$f</title>" >> feed.xml
|
||||||
|
echo "<link>https://git.tilde.town/dozens/protoadandsuperbowl/raw/branch/master/$f</link>" >> feed.xml
|
||||||
|
echo "<pubDate>$(stat -f "%m%t%Sm %N" $f | cut -f2 | cut -f1-4 -d ' ')</pubDate>" >> feed.xml
|
||||||
|
echo "<description><![CDATA[" >> feed.xml
|
||||||
|
pandoc $f >> feed.xml
|
||||||
|
echo "]]></description>" >> feed.xml
|
||||||
|
echo "</item>" >> feed.xml
|
||||||
|
done
|
||||||
|
|
||||||
|
echo '</channel></rss>' >> feed.xml
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
ya see, some people go real fast
|
|
||||||
and other people they go real slow
|
|
||||||
yeah that's it doncha know
|
|
||||||
---
|
|
||||||
yeah that's the real root cause of most workplace conflict
|
|
||||||
ayup
|
|
||||||
okay that's it bye
|
|
|
@ -1,3 +0,0 @@
|
||||||
...and that's how a became a YAML engineer.
|
|
||||||
---
|
|
||||||
To be honest, I'm not sure it's a real job either. But they keep giving me YAML and I keep ENGINEERING it!
|
|
|
@ -1,3 +0,0 @@
|
||||||
So did you watch the Super Bowl?
|
|
||||||
---
|
|
||||||
Yeah, me neither.
|
|
|
@ -1,3 +0,0 @@
|
||||||
Did you know that one of the very first television advertisements during the AFL–NFL World Championship Game was for Budweiser beer?
|
|
||||||
---
|
|
||||||
Yep! I guess you could say it was a SUPER BOWL PROTO AD!
|
|
|
@ -1,3 +0,0 @@
|
||||||
Who even ever asked for or wanted an information SUPERHIGHWAY anyway?
|
|
||||||
---
|
|
||||||
All I want is like a small cute remote information HIKING TRAIL somewhere out in the woods where I can see some flowers and leaves and listen to the birds and stuff.
|
|
|
@ -1,3 +0,0 @@
|
||||||
Is there even such a thing as "mainstream" anymore? I mean it used to be the case that everybody watched the same nightly news and listened to the same radio station. And "counterculture" was growing your hair long and listening to rock and roll. Now the duality of mainstream vs. counterculture seems as quaint as the idea that there are only two genders or only two sexes. Kids don't listen to rock & roll to rebel, they listen to soundcloud emo rap, or whatever, and if the niche sound that speaks directly to them doesn't exist, they can invent it and upload it for the world to hear with little more than a cheap laptop.
|
|
||||||
---
|
|
||||||
At the other end of the LONG TAIL of the internet is a metaphorical infosec furry, and because of them there are as many small STREAMS and countercultures as there are individual people.
|
|
|
@ -1,3 +0,0 @@
|
||||||
There was a sense of euphoria while we were in flow, like we were invinsible, but afterwards everything seemed brittle and fragile like it was held together with duct tape and kite string and like it might all come crumbling down if the wind blew in from the wrong direction. And there we were in the aftermath, unsure whether we accomplished our goals, who we hurt in the process, or if there was anything good about it all.
|
|
||||||
---
|
|
||||||
So anyway that's what we call a "hackathon". The tech bros invited me to "do some lines" and at this point I can't remember if it was code or coke.
|
|
|
@ -1,5 +0,0 @@
|
||||||
So I picked up a book in the middle of this epic fantasy series. It's by this author who I heard does really good sword and sorcery stories, and I'm into that. Anyway the story opens on a tragic, lonely noble lord, last of his line, subject to disfigurement because of the family curse and whatnot. But, get this, it totally takes place in Old Germany during the rise of the Nazi party!
|
|
||||||
---
|
|
||||||
I was so disoriented that I looked it up, and there will eventually be a classic fantasy storyline that interweaves with the modern nazi storyline.
|
|
||||||
|
|
||||||
Which means eventually the hero is literally going ride a dragon to Hitler's bunker and punch him in the face and if there's one thing this world needs more of, it's mother fucking dragons beating the shit out of nazis.
|
|
Loading…
Reference in New Issue