2 # Regenerate html files.
3 # If given a single argument, try to regenerate just that file. Not supported everywhere.
7 ( cd tools
; c
++ -g linkify.cc
-o linkify
; )
9 # generate html/$1.html using /tmp/tags
11 mkdir
-p html
/$
(dirname $1)
14 tools
/linkify
/tmp
/tags
$1.html
15 mv $1.html.out html
/$1.html
19 URL_BASE
='https://github.com/akkartik/mu/blob/main'
22 vim
-c "set number" -c TOhtml
-c write -c qall
$1
24 sed -i 's,<title>.*/mu/,<title>Mu - ,' $1.html
25 sed -i 's,\.html</title>,</title>,' $1.html
27 sed -i "/^<body/a <a href='$URL_BASE/$1'>$URL_BASE/$1</a>" $1.html
29 sed -i 's/^\* { \(.*\) }/* { font-size:12pt; \1 }/g' $1.html
30 sed -i 's/^body { \(.*\) }/body { font-size:12pt; \1 }/g' $1.html
32 sed -i '/^body {/a a { color:inherit; }' $1.html
35 ctags
-x boot.subx
[0-9]*.subx
[0-9]*.mu
> /tmp
/tags
36 for f
in boot.subx
[0-9]*.subx
[0-9]*.mu
38 test $# -gt 0 && test $1 != $f && continue
42 for f
in [^
0-9]*.subx
[^
0-9]*.mu
44 test $# -gt 0 && test $1 != $f && continue
45 test $f = "boot.subx" && continue
46 ctags
-x boot.subx
[0-9]*.subx
[0-9]*.mu
$f > /tmp
/tags
52 test $# -gt 0 && test $1 != $f && continue
54 ctags
-x ..
/[0-9]*.subx ..
/[0-9]*.mu $
(basename $f) > /tmp
/tags
60 ctags
-x ..
/boot.subx ..
/[0-9]*.subx ..
/[0-9]*.mu
*.mu
> /tmp
/tags
64 test $# -gt 0 && test $1 != $f && continue
69 ctags
-x ..
/boot.subx ..
/[0-9]*.subx ..
/[0-9]*.mu
*.mu
> /tmp
/tags
71 for f
in browse-slack
/*.mu
73 test $# -gt 0 && test $1 != $f && continue
78 ctags
-x [0-9]*.subx
[0-9]*.mu
> /tmp
/tags
80 for f
in linux
/[0-9]*.subx linux
/[0-9]*.mu
85 for f
in linux
/[^
0-9]*.subx linux
/[^
0-9]*.mu
88 ctags
-x [0-9]*.subx
[0-9]*.mu $
(basename $f) > /tmp
/tags
93 for f
in linux
/apps
/*.subx linux
/apps
/*.mu
96 ctags
-x ..
/[0-9]*.subx ..
/[0-9]*.mu $
(basename $f) > /tmp
/tags
101 for f
in linux
/apps
/advent2020
/*.mu linux
/apps
/advent2017
/*.mu
104 ctags
-x ..
/..
/[0-9]*.subx ..
/..
/[0-9]*.mu $
(basename $f) > /tmp
/tags
110 ctags
-x ..
/[0-9]*.subx ..
/[0-9]*.mu
*.mu
> /tmp
/tags
112 for f
in linux
/tile
/*.mu
117 ( cd linux
/apps
/raytracing
118 ctags
-x ..
/..
/[0-9]*.subx ..
/..
/[0-9]*.mu
*.mu
> /tmp
/tags
120 for f
in linux
/apps
/raytracing
/*.mu
126 ctags
-x *.cc |
grep -v '^. ' > /tmp
/tags
# don't hyperlink every 'i' to the integer register variant
128 for f
in linux
/bootstrap
/*.cc