Skip to content

Commit 008e490

Browse files
committed
update script to include file directories, update action to run on PR for now
1 parent f1bb14e commit 008e490

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/table_of_contents.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44

55
name: Generate Table of Contents files
66

7+
env:
8+
# Force the stdout and stderr streams to be unbuffered
9+
PYTHONUNBUFFERED: 1
10+
711
on:
8-
push:
9-
branches: ["main"]
10-
schedule:
11-
- cron: '0 0 * * *' # Run daily at midnight
12+
pull_request:
13+
types:
14+
- synchronize
15+
- reopened
16+
- opened
1217

1318
jobs:
1419
generate_toc_formats:

scripts/table-of-contents-generator/toc_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def extract_title_description_slug(filename):
3939
elif line.startswith("slug:"):
4040
slug = line.strip().split(": ")[1]
4141
if title and slug and description:
42-
return {"title": title, "description": description, "slug": slug}
42+
return {"title": title, "description": description, "slug": slug, "dir": filename}
4343
return None
4444

4545
def walk_dirs(root_dir):

0 commit comments

Comments
 (0)