In preparation for moving this to Jekyll repo.
shapes.html \
arrows.html \
schema.html \
+ arrow_grammar.html \
+ arrow_table.html \
brewer_colors.html \
svg_colors.html \
x11_colors.html
grammar.html : grammar mklang
./mklang grammar grammar.html
-arrows.html : arrow_grammar arrows.1 arrows.2 mkarrowtbl.sh mklang $(AGIF) $(A2GIF)
- ./mklang arrow_grammar gramtmp
- cat arrows.1 > arrows.html
- cat gramtmp >> arrows.html
- cat arrows.2 >> arrows.html
- ./mkarrowtbl.sh $(A2GIF) >> arrows.html
- rm gramtmp
+arrow_grammar.html: mklang arrow_grammar
+ ./mklang arrow_grammar arrow_grammar.html
+
+arrow_table.html: mkarrowtbl.sh $(A2GIF)
+ ./mkarrowtbl.sh $(A2GIF) >> arrow_table.html
+
+arrows.html : mkarrowshtml.py arrow_grammar.html arrow_table.html $(AGIF)
+ ./mkarrowshtml.py arrow_grammar.html arrow_table.html > arrows.html
mklang : mklang.y
yacc mklang.y
+++ /dev/null
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<!--
- This is a generated document. Do not edit.
--->
-<HTML VERSION="2.0">
-<HEAD>
-<TITLE>Arrow Shapes</TITLE>
-</HEAD>
-<BODY BGCOLOR=white>
-<A NAME="top"></A>
-<H1 ALIGN=CENTER>Arrow Shapes</H1>
-<HR>
-Arrow shapes can be specified and named using the following simple
-grammar.
-Terminals are shown in bold font and nonterminals in italics.
-Literal characters are given in single quotes.
-Square brackets [ and ] enclose optional items.
-Vertical bars | separate alternatives.
-<TABLE>
--- /dev/null
+#!/usr/bin/env python3
+# Generates arrows.html.
+
+import markupsafe
+import sys
+import templates
+
+template = templates.env().get_template('arrows.html.j2')
+print(template.render(
+ arrow_grammar=markupsafe.Markup(open(sys.argv[1]).read()),
+ arrow_table=markupsafe.Markup(open(sys.argv[2]).read()),
+))
echo " </TR>"
}
-echo "<CENTER>"
-echo "<TABLE>"
-
while (( $# > 0 ))
do
ARROW=${1%.*} # abc_arrowname
done
closeLine
-
-echo "</TABLE>"
-echo "</CENTER>"
-echo "</BODY>"
-echo "</HTML>"
-
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<!--
+ This is a generated document. Do not edit.
+-->
+<HTML VERSION="2.0">
+<HEAD>
+<TITLE>Arrow Shapes</TITLE>
+</HEAD>
+<BODY BGCOLOR=white>
+<A NAME="top"></A>
+<H1 ALIGN=CENTER>Arrow Shapes</H1>
+<HR>
+Arrow shapes can be specified and named using the following simple
+grammar.
+Terminals are shown in bold font and nonterminals in italics.
+Literal characters are given in single quotes.
+Square brackets [ and ] enclose optional items.
+Vertical bars | separate alternatives.
+<TABLE>
+{{ arrow_grammar }}
</TABLE>
<P>
The primitive shapes are:
arrow shape. The node attached to the arrow is not drawn but would appear
on the right side of the edge.
<P>
+<CENTER>
+<TABLE>
+{{ arrow_table }}
+</TABLE>
+</CENTER>
+</BODY>
+</HTML>
+