Skip to content

Commit fcbf338

Browse files
committed
scripts/docstats to count words in article content
1 parent 84b5b07 commit fcbf338

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

scripts/docstats

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
echo "Word counts of all <article> content:"
4+
echo =============
5+
echo
6+
7+
for dir in build/*/*/
8+
do
9+
WC=$(
10+
find $dir \
11+
-name '*.html' \
12+
-exec scripts/hwc {} ';' \
13+
| perl -ne '$SUM += $_; END { print "$SUM\n" }' )
14+
15+
if [[ -n "$WC" && "$WC" -gt 0 ]]; then
16+
echo $dir
17+
echo $WC
18+
fi
19+
done
20+
21+
echo
22+

scripts/hwc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
htmlq -t -f $1 article | wc -c

0 commit comments

Comments
 (0)