Last active
May 10, 2022 14:56
-
-
Save wbamberg/05e16bfbc59652f3243b3762064b86c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, re | |
from os import walk, path | |
dir = sys.argv[1] | |
threshold = 20 | |
for (dirpath, dirnames, filenames) in walk(dir): | |
for filename in filenames: | |
if filename.endswith("index.md"): | |
in_file = open(path.join(dirpath, filename), "r") | |
lines = in_file.readlines() | |
h3s = 0 | |
for line in lines: | |
if line.startswith("### "): | |
h3s = h3s+1 | |
if h3s > threshold: | |
print("{} : {}".format(dirpath, h3s)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment