Skip to content

Commit e15ebf2

Browse files
committed
bin: init
Move all tooling to bin/. Add to PATH via direnv. Add new tooling. - import-events: generate stub events from TSV data - elucidate: mass edit aforementioned stub events.
1 parent d0fdd88 commit e15ebf2

File tree

6 files changed

+78
-0
lines changed

6 files changed

+78
-0
lines changed

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
use flake
2+
3+
PATH_add bin/

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
!.keep
55

66
/public/
7+
8+
*.bak

bin/elucidate

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env fish
2+
3+
test (count $argv) -gt 0 || exit
4+
5+
for x in $argv
6+
if ! test -f $x; exit; end
7+
end
8+
9+
echo "elucidating" (echo $argv | string join ", ")
10+
echo 'event description body, multiline
11+
Ctrl-D to stop.'
12+
set -l desc (read -z | string escape --style=regex |
13+
while read
14+
echo '\\'
15+
end | string collect)
16+
17+
echo "one line summary"
18+
set -l summ (read -P '')
19+
20+
for x in $argv
21+
sed -i.bak \
22+
"/<!-- more -->/ c\\
23+
$summ\\
24+
\\
25+
<!-- more --> \\
26+
\\
27+
$desc
28+
" $x
29+
end

bin/import-events

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env fish
2+
3+
pwd | if ! grep '/events' >/dev/null
4+
echo "Please run this from the events folder."
5+
exit 1
6+
end
7+
8+
gawk -F'\t' \
9+
'
10+
BEGIN {
11+
OFS="\n"
12+
}
13+
$2 ~ /[0-9]+/ {
14+
gsub(/#/, "", $1)
15+
print
16+
}
17+
' |
18+
while read -l name
19+
read -l date
20+
read -l time
21+
read -l location
22+
read -l owner
23+
set -l filename "$date-"(echo $name | string replace -a ' ' '-' | string lower).md
24+
if test -f $filename; continue; end
25+
26+
echo "+++
27+
title = \"$name\"
28+
date = $date
29+
30+
template = \"post.html\"
31+
32+
[taxonomies]
33+
tags = []
34+
35+
[extra]
36+
ztime = \"$time\"
37+
+++
38+
39+
<!-- more -->
40+
41+
## Organizer
42+
43+
* $owner
44+
" >$filename
45+
end
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)