mu/update_html

97 lines
3.0 KiB
Plaintext
Raw Normal View History

2016-10-12 05:38:46 +00:00
#!/bin/bash
2015-05-31 02:30:33 +00:00
# Regenerate html files.
2016-12-27 19:14:12 +00:00
set -e
2017-11-05 19:17:34 +00:00
( cd linkify; build; )
# generate html/$1.html using /tmp/tags
2015-09-07 17:37:27 +00:00
process() {
rm -f html/$1.html
2017-11-05 19:17:34 +00:00
convert_html $1
linkify/linkify /tmp/tags html/$1.html
mv html/$1.html.out html/$1.html
}
convert_html() {
vim -c "set number" -c TOhtml -c write -c qall $1
2015-09-07 17:37:27 +00:00
sed -i 's,<title>.*/mu/,<title>Mu - ,' $1.html
2015-09-07 17:37:27 +00:00
sed -i 's,\.html</title>,</title>,' $1.html
2018-11-30 22:19:59 +00:00
sed -i 's/^\* { \(.*\) }/* { font-size:12pt; \1 }/g' $1.html
sed -i 's/^body { \(.*\) }/body { font-size:12pt; \1 }/g' $1.html
2017-03-09 03:02:59 +00:00
# turn most code grey
sed -i 's/#eeeeee/#aaaaaa/g' $1.html
4805 More tweaking of colors, as far as possible in 256-color terminal mode that's almost entirely just for me, and beyond that in the generated html that more people may look at. In the former I have to work with a limited palette, while I'd like the latter to be more accessible for others. Evolution of colors: === 1 .subxH1Comment { color: #00ffff; } .subxH2Comment { color: #00afff; } .subxComment { color: #00afff; } .subxS1Comment { color: #0080ff; } .subxS2Comment { color: #0040ff; } === 2 sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxH2Comment.*/.subxH2Comment { color:#00bbff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00bbff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#0098ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0070ff; }/' $1.html # slightly too dark === 3: http://www.perbang.dk/rgbgradient from start to end sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxH2Comment.*/.subxH2Comment { color:#00ddff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00bbff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#0099ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0078ff; }/' $1.html === 4: drop down to 4 colors sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00d2ff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#00a4ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0078ff; }/' $1.html === 4: make final one just a little too dark sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00cfff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#009fff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0070ff; }/' $1.html # slightly too dark === 5: make darkest shade a little less blue, just at the edge of too dark sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#16ccff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#2d99ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#4466ff; }/' $1.html # slightly too dark === 6: HSV gradient between the same endpoints sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#16bfff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#2d8cff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#4466ff; }/' $1.html # slightly too dark
2018-11-30 22:20:37 +00:00
# line numbers are darker than normal
2018-11-30 22:19:59 +00:00
sed -i 's/^\.LineNr .*/.LineNr { color:#444444; }/' $1.html # line numbers
2017-03-09 03:02:59 +00:00
# tweak contrast for remaining colors
2018-11-30 22:19:59 +00:00
sed -i 's/^\.Constant .*/.Constant { color:#00a0a0; }/' $1.html
sed -i 's/^\.muControl .*/.muControl { color:#c0a020; }/' $1.html
4805 More tweaking of colors, as far as possible in 256-color terminal mode that's almost entirely just for me, and beyond that in the generated html that more people may look at. In the former I have to work with a limited palette, while I'd like the latter to be more accessible for others. Evolution of colors: === 1 .subxH1Comment { color: #00ffff; } .subxH2Comment { color: #00afff; } .subxComment { color: #00afff; } .subxS1Comment { color: #0080ff; } .subxS2Comment { color: #0040ff; } === 2 sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxH2Comment.*/.subxH2Comment { color:#00bbff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00bbff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#0098ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0070ff; }/' $1.html # slightly too dark === 3: http://www.perbang.dk/rgbgradient from start to end sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxH2Comment.*/.subxH2Comment { color:#00ddff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00bbff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#0099ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0078ff; }/' $1.html === 4: drop down to 4 colors sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00d2ff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#00a4ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0078ff; }/' $1.html === 4: make final one just a little too dark sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00cfff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#009fff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0070ff; }/' $1.html # slightly too dark === 5: make darkest shade a little less blue, just at the edge of too dark sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#16ccff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#2d99ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#4466ff; }/' $1.html # slightly too dark === 6: HSV gradient between the same endpoints sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#16bfff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#2d8cff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#4466ff; }/' $1.html # slightly too dark
2018-11-30 22:20:37 +00:00
# comment colors manually adjusted for better contrast; browser has >256 colors
2018-11-30 22:19:59 +00:00
sed -i 's/^\.Delimiter .*/.Delimiter { color:#800080; }/' $1.html # not meant to be read; can be lower-contrast
sed -i 's/^\.PreProc .*/.PreProc { color:#800080; }/' $1.html # not meant to be read; can be lower-contrast
sed -i 's/^\.Identifier .*/.Identifier { color:#c0a020; }/' $1.html # same as muControl
sed -i 's/^\.Special .*/.Special { color:#c00000; }/' $1.html # same as traceAbsent..
4805 More tweaking of colors, as far as possible in 256-color terminal mode that's almost entirely just for me, and beyond that in the generated html that more people may look at. In the former I have to work with a limited palette, while I'd like the latter to be more accessible for others. Evolution of colors: === 1 .subxH1Comment { color: #00ffff; } .subxH2Comment { color: #00afff; } .subxComment { color: #00afff; } .subxS1Comment { color: #0080ff; } .subxS2Comment { color: #0040ff; } === 2 sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxH2Comment.*/.subxH2Comment { color:#00bbff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00bbff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#0098ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0070ff; }/' $1.html # slightly too dark === 3: http://www.perbang.dk/rgbgradient from start to end sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxH2Comment.*/.subxH2Comment { color:#00ddff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00bbff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#0099ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0078ff; }/' $1.html === 4: drop down to 4 colors sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00d2ff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#00a4ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0078ff; }/' $1.html === 4: make final one just a little too dark sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00cfff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#009fff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0070ff; }/' $1.html # slightly too dark === 5: make darkest shade a little less blue, just at the edge of too dark sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#16ccff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#2d99ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#4466ff; }/' $1.html # slightly too dark === 6: HSV gradient between the same endpoints sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#16bfff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#2d8cff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#4466ff; }/' $1.html # slightly too dark
2018-11-30 22:20:37 +00:00
sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html
sed -i 's/^\.subxComment.*/.subxComment { color:#16bfff; }/' $1.html
sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#2d8cff; }/' $1.html
sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#4466ff; }/' $1.html # slightly too dark
# comment links in regular colors, just underlined
sed -i '/^body {/ a .subxH1Comment a { color:inherit; }' $1.html
sed -i '/^body {/ a .subxH2Comment a { color:inherit; }' $1.html
sed -i '/^body {/ a .subxComment a { color:inherit; }' $1.html
sed -i '/^body {/ a .subxS1Comment a { color:inherit; }' $1.html
sed -i '/^body {/ a .subxS2Comment a { color:inherit; }' $1.html
2015-09-07 17:37:27 +00:00
2016-11-25 19:04:14 +00:00
# switch unicode characters around in the rendered html
# the ones we have in the source files render double-wide in html
# the ones we want in the html cause iTerm2 to slow down in alt-tabbing for some reason
# the following commands give us the best of both worlds
sed -i -e 's/┈/╌/g' -e 's/┊/╎/g' $1.html
2015-09-07 17:37:27 +00:00
mv -i $1.html html/`dirname $1`
}
2017-11-05 19:17:34 +00:00
ctags -x *.cc |grep -v "^operator \| member \| variable " > /tmp/tags
for f in *.cc
do
process $f
done
2016-10-22 23:33:06 +00:00
2017-11-05 19:17:34 +00:00
ctags -x [0-9]*.mu > /tmp/tags
for f in [0-9]*.mu
do
process $f
done
2017-11-05 19:17:34 +00:00
for f in [a-zA-Z]*.mu
do
ctags -x [0-9]*.mu $f > /tmp/tags
process $f
done
2017-11-05 19:17:34 +00:00
( cd edit
ctags -x ../[0-9]*.mu *.mu > /tmp/tags
)
for f in edit/*.mu
do
process $f
done
2017-11-05 19:17:34 +00:00
( cd subx
ctags -x *.cc |grep -v '^. ' > /tmp/tags # don't hyperlink every 'i' to the integer register variant
)
2018-09-07 22:08:54 +00:00
for f in subx/*.cc
2017-11-05 19:17:34 +00:00
do
process $f
done
2017-10-13 06:43:09 +00:00
2018-09-08 05:42:23 +00:00
echo > /tmp/tags
2018-10-02 08:21:01 +00:00
for f in subx/*.subx subx/examples/*.subx subx/apps/*.subx
2018-09-07 22:08:54 +00:00
do
process $f
done
2018-09-08 05:42:23 +00:00
rm /tmp/tags
( cd linkify; clean; )