Permalink
Browse files

Factor out scripts/html.sh so that other repos can use it.

Also, remove unused imports.
  • Loading branch information...
Andy Chu
Andy Chu committed Feb 19, 2018
1 parent 0e25182 commit 82e936acd23e6250858499e266fd1ee8680317f2
Showing with 51 additions and 32 deletions.
  1. +43 −0 scripts/html.sh
  2. +8 −30 scripts/release.sh
  3. +0 −2 test/wild_report.py
View
@@ -0,0 +1,43 @@
#!/bin/bash
#
# Usage:
# ./html.sh <function name>
set -o nounset
set -o pipefail
set -o errexit
basic-head() {
local title=$1
cat <<EOF
<!DOCTYPE html>
<html>
<head>
<title>$title</title>
<style>
body {
margin: 0 auto;
width: 40em;
}
#home-link {
text-align: right;
}
</style>
</head>
<body>
<p id="home-link">
<a href="/">oilshell.org</a>
</p>
<h3>$title</h3>
<p>
EOF
}
basic-tail() {
cat <<EOF
</body>
</html>
EOF
}
"$@"
View
@@ -420,35 +420,13 @@ compress-benchmarks() {
}
metrics-index() {
# TODO: Have to write index.html so it will serve out of .wwz.
cat <<EOF
<!DOCTYPE html>
<html>
<head>
<title>Line Counts</title>
<style>
body {
margin: 0 auto;
width: 40em;
}
#home-link {
text-align: right;
}
</style>
</head>
<body>
<p id="home-link">
<a href="/">oilshell.org</a>
</p>
<h3>Line Counts</h3>
<p>
EOF
find $out -name '*.txt' -a -printf '<a href="%P">%P</a> <br/>\n'
cat <<EOF
</p>
</body>
</html>
EOF
local dir=$1
scripts/html.sh basic-head "Line Counts"
echo '<p>'
find $dir -name '*.txt' -a -printf '<a href="%P">%P</a> <br/>\n'
echo '</p>'
scripts/html.sh basic-tail "Line Counts"
}
line-counts() {
@@ -468,7 +446,7 @@ line-counts() {
scripts/count.sh oil-osh-cloc > $out/oil-osh-cloc.txt
metrics-index > $out/index.html
metrics-index $out > $out/index.html
tree $out
}
View
@@ -4,10 +4,8 @@
"""
import json
import glob
import os
import sys
from collections import defaultdict
import jsontemplate

0 comments on commit 82e936a

Please sign in to comment.