about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-06-25 15:45:06 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-06-25 16:31:19 -0700
commit9a7e1a0f362cce3f9c1501e08743f09bfa9f8cb1 (patch)
treed7f95afe3943c022c53cf868956f16394deb9e40
parent67160f82f285e4422927346c4ab0b5dd164b8544 (diff)
downloadmu-9a7e1a0f362cce3f9c1501e08743f09bfa9f8cb1.tar.gz
3961
Expand the steps in `update_html` and try to process each set of files
separately so we can see commonality.

The eventual goal is a script that can selectively process a subset of
files. But this is a good first step: I can at least easily comment out
different subsets.
-rwxr-xr-xupdate_html67
1 files changed, 39 insertions, 28 deletions
diff --git a/update_html b/update_html
index 835a9320..dc91660d 100755
--- a/update_html
+++ b/update_html
@@ -3,6 +3,7 @@
 
 set -e
 
+# convert a single file to html
 process() {
   vim -c "set number" -c TOhtml -c write -c qall $1
 
@@ -36,44 +37,54 @@ process() {
   mv -i $1.html html/`dirname $1`
 }
 
-if [ $# -gt 0 ]
-then
-  for f in $*
+( cd linkify; build; )
+
+  rm html/*.cc.html
+  for f in *.cc
   do
     process $f
   done
-  exit 0
-fi
-
-rm html/*.html html/edit/*.html
+  ctags -x *.cc  |grep -v "^operator \| member \| variable "  > /tmp/tags
+  linkify/linkify /tmp/tags html/*.cc.html
+  for f in html/*.cc.html
+  do
+    mv $f.out $f
+  done
 
-for f in *.cc *.mu edit/*.mu
-do
-  process $f
-done
+  rm html/[0-9]*.mu.html
+  for f in [0-9]*.mu
+  do
+    process $f
+  done
+  ctags -x [0-9]*.mu  > /tmp/tags
+  linkify/linkify /tmp/tags html/[0-9]*.mu.html
+  for f in html/[0-9]*.mu.html
+  do
+    mv $f.out $f
+  done
 
-if which ctags >&/dev/null
-then
-  ( cd linkify; build; )
-  ctags -x *.cc  |grep -v "^operator \| member \| variable "  > cpp.tags
-  linkify/linkify cpp.tags html/*.cc.html
-  rm cpp.tags
-  ctags -x [0-9]*.mu  > mu.tags
-  linkify/linkify mu.tags html/[0-9]*.mu.html
   for f in [a-zA-Z]*.mu
   do
-    ctags -x [0-9]*.mu $f  > mu.tags
-    linkify/linkify mu.tags html/$f.html
+    rm html/$f.html
+    process $f
+    ctags -x [0-9]*.mu $f  > /tmp/tags
+    linkify/linkify /tmp/tags html/$f.html
+    mv html/$f.html.out html/$f.html
+  done
+
+  rm html/edit/*.html
+  for f in edit/*.mu
+  do
+    process $f
   done
-  rm mu.tags
   ( cd edit
-    ctags -x ../[0-9]*.mu *.mu  > mu.tags
-    ../linkify/linkify mu.tags ../html/edit/*.mu.html
-    rm mu.tags
+    ctags -x ../[0-9]*.mu *.mu  > /tmp/tags
   )
-  ( cd linkify; clean; )
-  for f in html/*.html html/edit/*.html
+  linkify/linkify /tmp/tags html/edit/*.mu.html
+  for f in html/edit/*.mu.html
   do
     mv $f.out $f
   done
-fi
+
+rm /tmp/tags
+( cd linkify; clean; )