aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2024-11-20 15:59:33 -0500
committerAnthony Wang2024-11-20 15:59:33 -0500
commit51f3c1abc086735568d2bd9884ff72f41cd461c2 (patch)
tree61c77f32af823b923c520a961342ec056e6d5a42
parent15c2dcf5be4c02b98536bbcf09438eb806d95102 (diff)
Word count checker script
-rw-r--r--static/src/check-about.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/static/src/check-about.py b/static/src/check-about.py
new file mode 100644
index 0000000..e7bf62d
--- /dev/null
+++ b/static/src/check-about.py
@@ -0,0 +1,13 @@
+import re
+
+PI = '31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679'
+
+i = 0
+with open('content/about/_index.md') as f:
+ for l in f.readlines()[5:]:
+ if l == '\n':
+ continue
+ cnt = str(len(re.sub(r']\([^\)]*\)', '', l).split()))
+ if cnt != PI[i:i+len(cnt)]:
+ print(l, cnt, PI[i])
+ i += len(cnt)