Skip to content

Commit

Permalink
add table scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
leohhhn committed Sep 30, 2024
1 parent 604f47a commit 4163337
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
ROWS=15
FILE="README.md"

build:
# Delete table if it already exists
./scripts/del-existing-rows.sh $(ROWS) $(FILE)

go run scripts/csvgen.go -path ./presentations -out scripts/data.csv -rows $(ROWS)
cat scripts/data.csv | go run moul.io/mdtable csv > scripts/table.md
go run github.com/campoy/embedmd -w README.md
# Clean up
rm scripts/data.csv scripts/table.md

./scripts/del-codeblock.sh

./scripts/del-codeblock.sh $(FILE)

17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ presentations.
## Previous workshops & talks

[embedmd]:# (scripts/table.md)
|Date |Title |Speakers |Presentation |Recording |
|---- |----- |-------- |------------ |--------- |
|2023-10-09 |Generating Audio |@schollz |--- |--- |
|2023-09-26 |Chess The Gnolang Way |@thehowl |--- |--- |
|2023-09-11 |Gno.land: The Key To Perpetual Transparency |@moul |[Slides](https://gnolang.github.io/workshops/presentations/2023-09-11--dappcon-key-perpetual-transparency--manfred/presentation.slide.html) |--- |
|2023-07-24 |Examining the Gno Core Stack |@moul |[Slides](https://gnolang.github.io/workshops/presentations/2023-07-24--talk-nebular--manfred/presentations.slide.html#1) |--- |
|2023-07-23 |Getting Started with Gno! |@moul, @thehowl |[Slides](./README.md) |--- |
|2023-06-26 |Go -> Gno |@schollz |[Slides](./slides.pdf) |--- |
|2023-06-06 |Proof of Contribution in Gno.land |@moul |[Slides](https://gnolang.github.io/workshops/presentations/2023-06-06--buidl-asia--manfred/presentations.slide.html) |--- |
|2023-06-05 |Gno.land for Go Developers |@moul |[Slides](https://gnolang.github.io/workshops/presentations/2023-06-05--getting-to-gno-seoul--manfred/presentations.slide.html#1) |--- |
|2023-06-03 |A journey into Gno.land - the Evolution of Smart Contracts |@moul |[Slides](https://gnolang.github.io/workshops/presentations/2023-06-03--eth-seoul--manfred/presentations.slide.html#1) |--- |
|2023-06-02 |Alice in Gno.land |@zivkovicmilos |[Slides](./README.md) |--- |
|2023-03-16 |How to build a forum in Gno.land |@zivkovicmilos |[Slides](./README.md) |[Video](https://www.youtube.com/watch?v=gmP-mH-64HA) |
|2023-03-03 |Plan9 as Metaverse |@jaekwon |[Slides](./README.md) |--- |
|2022-11-29 |Minimal meetup.com clone |@moul, @pwnh4 |[Slides](https://github.com/xplrz/gnoland-meetup) |--- |
|2022-11-15 |Intro to gno.land |@moul |--- |--- |
|2022-11-03 |Intro to gno.land |@moul |--- |--- |

_This table is autogenerated based on the [./presentations](./presentations) folder._

Expand Down
2 changes: 1 addition & 1 deletion scripts/del-codeblock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ FILE="README.md"
# Use sed to remove the code block backticks
sed -i '' '/^```md$/d; /^```$/d' "$FILE"

echo "Removed code block formatting from $FILE."
echo "Successfully generated table for $FILE."
13 changes: 13 additions & 0 deletions scripts/del-existing-rows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

ROWS=$1
FILE=$2
NUM_LINES=$(($ROWS - 1))
HEADER1="|Date |Title |Speakers |Presentation |Recording |"

if grep -qF "$HEADER1" "$FILE" && grep -qF "$HEADER2" "$FILE"; then
echo "Old table found, deleting."
# Use sed to find and delete the two header lines and the next $ROWS lines
sed -i '' "/$HEADER1/{N;N;$(for i in $(seq 1 $NUM_LINES); do echo -n 'N;'; done)d;}" "$FILE"
fi

2 changes: 1 addition & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Define the file to be processed
FILE="README.md"
FILE=$1

# if found line, remove table of size 17 rows

Expand Down

0 comments on commit 4163337

Please sign in to comment.