]> granicus.if.org Git - graphviz/commitdiff
Code to support the updating of the website database with dynamically generated documents
authordperry <devnull@localhost>
Thu, 24 Feb 2011 23:15:31 +0000 (23:15 +0000)
committerdperry <devnull@localhost>
Thu, 24 Feb 2011 23:15:31 +0000 (23:15 +0000)
doc/webupdate/convert_and_upload [new file with mode: 0755]
doc/webupdate/convert_arrows [new file with mode: 0755]
doc/webupdate/convert_attrs [new file with mode: 0755]
doc/webupdate/convert_colors [new file with mode: 0755]
doc/webupdate/convert_command [new file with mode: 0755]
doc/webupdate/convert_lang [new file with mode: 0755]
doc/webupdate/convert_output [new file with mode: 0755]
doc/webupdate/convert_shapes [new file with mode: 0755]
doc/webupdate/db_upload [new file with mode: 0755]

diff --git a/doc/webupdate/convert_and_upload b/doc/webupdate/convert_and_upload
new file mode 100755 (executable)
index 0000000..bdcf868
--- /dev/null
@@ -0,0 +1,9 @@
+#! /bin/bash
+
+for doc in arrows attrs colors command lang output shapes
+do
+       ./convert_${doc}; ./db_upload ${doc}_db | mysql -u root -pgraphviz2011 -D graphviz;
+       rm ${doc}_db
+done
+
+
diff --git a/doc/webupdate/convert_arrows b/doc/webupdate/convert_arrows
new file mode 100755 (executable)
index 0000000..7211b43
--- /dev/null
@@ -0,0 +1,6 @@
+#! /bin/bash
+
+dir="/home/dperry/graphviz2/doc/info"
+cat ${dir}/arrows.html | sed -e /"DOCTYPE HTML"/,/"BODY BGCOLOR"/d -e /"Arrow Shapes<\/H1>"/d -e /"<\/BODY>"/d -e /"<\/HTML>"/d | \
+sed -e s/'SRC=\"'/'SRC=\"\/doc\/info\/'/g  > arrows_db
+
diff --git a/doc/webupdate/convert_attrs b/doc/webupdate/convert_attrs
new file mode 100755 (executable)
index 0000000..8047655
--- /dev/null
@@ -0,0 +1,19 @@
+#! /bin/bash
+
+dir="/home/dperry/graphviz2/doc/info"
+cat ${dir}/attrs.html | sed -e /"DOCTYPE HTML"/,/"BODY BGCOLOR"/d -e /"Node, Edge and Graph Attributes<\/H1>"/d \
+-e /"<\/BODY>"/d -e /"<\/HTML>"/d | \
+sed -e s/"d:"/"d"/g -e s/"k:"/"k"/g -e s/"a:"/"a"/g \
+| sed -e s/'http:\/\/www.graphviz.org\/doc\/info\/lang.html'/'dot-language'/g \
+-e s/'http:\/\/www.graphviz.org\/Documentation\/html\/layers\/'/'graphviz-layered-drawing'/g \
+-e s/'http:\/\/www.graphviz.org\/Documentation\/html\/shapehowto.html'/'\/Documentation\/html\/shapehowto.html'/g \
+-e s/'http:\/\/www.graphviz.org\/doc\/info\/output.html'/'output-formats'/g \
+-e s/'http:\/\/www.graphviz.org\/Documentation'/'\/Documentation'/g \
+-e s/"output.html"/"output-formats"/g -e s/"attrs.html"/"attrs"/g  -e s/'SRC=\"'/'SRC=\"\/doc\/info\/'/g  \
+| sed -e s/"colors.html"/"color-names"/g -e s/"shapes.html"/"node-shapes"/g \
+-e s/"command.html"/"command-line-invocation"/g \
+-e s/"en.wikipedia.org\/wiki\/Point_(typography)"/"en.wikipedia.org\/wiki\/Point_(typography) target="_blank""/g \
+-e s/"cab38\/ColorBrewer\/ColorBrewer_intro.html"/"cab38\/ColorBrewer\/ColorBrewer_intro.html target="_blank""/g \
+> attrs_db
+
+
diff --git a/doc/webupdate/convert_colors b/doc/webupdate/convert_colors
new file mode 100755 (executable)
index 0000000..ac05ac1
--- /dev/null
@@ -0,0 +1,9 @@
+#! /bin/bash
+
+dir="/home/dperry/graphviz2/doc/info"
+cat ${dir}/colors.html | sed -e /"DOCTYPE HTML"/,/"BODY BGCOLOR"/d -e /"Color Names<\/H1>"/d \
+-e /"<\/BODY>"/d -e /"<\/HTML>"/d | \
+sed -e s/"d:"/"d"/g -e s/"attrs.html"/"attrs"/g \
+> colors_db
+
+
diff --git a/doc/webupdate/convert_command b/doc/webupdate/convert_command
new file mode 100755 (executable)
index 0000000..2f1d0ad
--- /dev/null
@@ -0,0 +1,8 @@
+#! /bin/bash
+
+dir="/home/dperry/graphviz2/doc/info"
+cat ${dir}/command.html | sed -e /"DOCTYPE HTML"/,/"BODY BGCOLOR"/d -e /"Command-line Invocation"/d -e /"<\/BODY>"/d -e /"<\/HTML>"/d | \
+sed -e s/"d:"/"d"/g -e s/'http:\/\/www.graphviz.org\/doc\/info\/output.html'/output-formats/g \
+-e s/"output.html"/output-formats/g -e s/"attrs.html"/attrs/g \
+> command_db
+
diff --git a/doc/webupdate/convert_lang b/doc/webupdate/convert_lang
new file mode 100755 (executable)
index 0000000..7c655cc
--- /dev/null
@@ -0,0 +1,10 @@
+#! /bin/bash
+
+dir="/home/dperry/graphviz2/doc/info"
+cat ${dir}/lang.html | sed -e /"DOCTYPE HTML"/,/"BODY BGCOLOR"/d -e /"The DOT Language<\/H1>"/d \
+-e /"<\/BODY>"/d -e /"<\/HTML>"/d | \
+sed -e s/"attrs.html"/"attrs"/g  -e s/"a:"/"a"/g  \
+-e s/"http:\/\/www.graphviz.org\/doc\/char.html\">"/"\/doc\/char.html\" target=\"_blank\">"/g \
+> lang_db
+
+
diff --git a/doc/webupdate/convert_output b/doc/webupdate/convert_output
new file mode 100755 (executable)
index 0000000..f6f53c8
--- /dev/null
@@ -0,0 +1,20 @@
+#! /bin/bash
+
+dir="/home/dperry/graphviz2/doc/info"
+cat ${dir}/output.html | sed -e /"DOCTYPE HTML"/,/"BODY BGCOLOR"/d -e /"Output Formats<\/H1><\/H1>"/d \
+-e /"<\/BODY>"/d -e /"<\/HTML>"/d | \
+sed -e s/"d:"/"d"/g -e s/"a:"/"a"/g -e s/"k:"/"k"/g \
+| sed -e s/'http:\/\/www.gtk.org\/\">'/'http:\/\/www.gtk.org\/\" target=\"_blank\">'/g \
+-e s/'icon_image_file_format)\">'/'icon_image_file_format)\" target=\"_blank\">'/g \
+-e s/'devnet\/pdf\/\">'/'devnet\/pdf\/\" target=\"_blank\">'/g \
+-e s/'www.adobe.com\/svg\/\">'/'www.adobe.com\/svg\/\" target=\"_blank\">'/g \
+-e s/'www.libtiff.org\/\">'/'www.libtiff.org\/\" target=\"_blank\">'/g \
+-e s/"TR\/NOTE-VML\">"/"TR\/NOTE-VML\" target=\"blank\">"/g \
+-e s/"www.vrml.org\/\">"/"www.vrml.org\/\" target=\"blank\">"/g \
+-e s/"wiki\/Xlib\">"/"wiki\/Xlib\" target=\"blank\">"/g \
+-e s/"wiki\/Bitmap\">"/"wiki\/Bitmap\" target=\"blank\">"/g \
+-e s/"lang.html"/"dot-language"/g  \
+-e s/"attrs.html"/"attrs"/g  \
+> output_db
+
+
diff --git a/doc/webupdate/convert_shapes b/doc/webupdate/convert_shapes
new file mode 100755 (executable)
index 0000000..ed51c8c
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/bash
+
+dir="/home/dperry/graphviz2/doc/info"
+cat ${dir}/shapes.html | sed -e /"DOCTYPE HTML"/,/"BODY BGCOLOR"/d -e /"Node Shapes<\/H1>"/d \
+-e /"<\/BODY>"/d -e /"<\/HTML>"/d | \
+sed -e s/"attrs.html"/"attrs"/g  -e s/"a:"/"a"/g -e s/"d:"/"d"/g -e s/"k:"/"k"/g \
+-e s/"http:\/\/www.graphviz.org\/doc\/char.html\">"/"\/doc\/char.html\" target=\"_blank\">"/g \
+-e s/"A HREF=html"/"A HREF=\/doc\/info\/html"/g \
+-e s/"<A HREF=shapes.html"/"<A HREF="/g \
+-e s/'SRC='/'SRC=\/doc\/info\/'/g \
+> shapes_db
+
+
diff --git a/doc/webupdate/db_upload b/doc/webupdate/db_upload
new file mode 100755 (executable)
index 0000000..6f93aba
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+#start construction of the sql stored procedure
+echo -n "call update_html('" ;
+#dump content of converted file and escape single quotes with backslash
+echo -n "testing";
+cat $1 | sed -e "s/[\\']/\\\'/g"; 
+#insert the title of the page being inserted as the second argument to the stored procedure
+case $1 in
+       arrows_db) echo -n "','Arrow Shapes";;
+       attrs_db) echo -n "','attrs";;
+       colors_db) echo -n "','Color Names";;
+       command_db) echo -n "','Command-line Invocation";;
+       lang_db) echo -n "','The DOT Language";;
+       output_db) echo -n "','Output Formats";;
+       shapes_db) echo -n "','Node Shapes";;
+       *)      echo -n "unkown option";exit 1;;
+esac
+echo "');" ;
+
+#pipe output to
+#mysql -u root -ppassword -D drupal
+