Skip to content

Commit 90f3a6d

Browse files
committed
Add script to create README
1 parent bd068d2 commit 90f3a6d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

makemd

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cd "$(dirname "$(which "$0")")"
6+
7+
# Remove Windows line endings from csv file and replace ';' by ','
8+
tr <videos_and_logs.csv -d '\r' | tr ';' ',' >/tmp/makemd.tmp && mv /tmp/makemd.tmp videos_and_logs.csv
9+
10+
# Output table header
11+
echo >README.md "| Event | Time | F | ½ | # | Team A | Team B | Video | GC Log | TCM Log |"
12+
echo >>README.md "|:--|:--|:--:|:--:|:--:|:--|:--|:--:|:--:|:--:|"
13+
14+
# Append table from csv and use non-breaking spaces and hyphens in some places
15+
tail <videos_and_logs.csv -n +2 \
16+
| tr ' ' ' ' \
17+
| sed >>README.md \
18+
-e 's%\,\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\)% | \1 | \2 | \3 | \4 | \5 | \6 | [video](\7) | [GC](\8) | [TCM](\9) |%' -e 's%^%| %' \
19+
-e 's%\([0-9]*\)-\([0-9]*\)-\([0-9]*\)%\1‑\2‑\3%' -e 's%\[video\]() %%'

0 commit comments

Comments
 (0)