diff --git a/generate_index.ml b/generate_index.ml index fed7de0..594b3c9 100644 --- a/generate_index.ml +++ b/generate_index.ml @@ -249,12 +249,12 @@ let overwrite_dot_file_with_url xref_table dot_file = (* dirty *) let generate_hierarchy_graph title xref_table output_dir dot_file = - overwrite_dot_file_with_url xref_table dot_file; +(* overwrite_dot_file_with_url xref_table dot_file;*) let png_filename = "hierarchy_graph.png" in let png_path = Filename.concat output_dir png_filename in let map_path = Filename.concat output_dir "hierarchy_graph.map" in Graphviz.from_file dot_file - |> Graphviz.generate_file png_path map_path; + |> Graphviz.neato png_path map_path; let map = read_file map_path in (*TODO: ↓ The map id (#Hierarchy) should be taken from dot file *) Printf.sprintf {|

Mathematical Structures (%s only)

diff --git a/graphviz.ml b/graphviz.ml index dfd5453..af8e2c2 100644 --- a/graphviz.ml +++ b/graphviz.ml @@ -4,3 +4,6 @@ let from_file filename = filename let generate_file pngfile mapfile srcfile = Common.shell (Printf.sprintf "tred %s | dot -Tpng -o %s -Tcmapx -o %s" srcfile pngfile mapfile) + +let neato pngfile mapfile srcfile = + Common.shell (Printf.sprintf "neato -Tpng -n2 %s -o %s -Tcmapx -o %s" srcfile pngfile mapfile) diff --git a/graphviz.mli b/graphviz.mli index d9ad32e..c431c4d 100644 --- a/graphviz.mli +++ b/graphviz.mli @@ -3,3 +3,4 @@ type t val from_file : string -> t val generate_file : string -> string -> t -> unit +val neato : string -> string -> t -> unit diff --git a/tools/generate-hierarchy-graph.sh b/tools/generate-hierarchy-graph.sh index dfc70f7..72a679c 100755 --- a/tools/generate-hierarchy-graph.sh +++ b/tools/generate-hierarchy-graph.sh @@ -1,6 +1,12 @@ +set -eux +DIR=$(pwd `dirname 0`) coqtop < $DIR/hierarchy-graph.dot diff --git a/tools/generate-mathcomp-analysis.sh b/tools/generate-mathcomp-analysis.sh index e11bc6e..b4ad4cb 100755 --- a/tools/generate-mathcomp-analysis.sh +++ b/tools/generate-mathcomp-analysis.sh @@ -26,12 +26,14 @@ sed -i 's/Analysis_stdlib/mathcomp\.analysis_stdlib/' depend.dot sed -i 's/\//\./g' depend.dot $DIR/tools/generate-hierarchy-graph.sh +HIERARCHY=$OUTDIR/hierarchy-graph.dot +cp hierarchy-graph.dot $HIERARCHY $DIR/coq2html -title "MathComp-Analysis($COMMIT_HASH)" -d $OUTDIR -base mathcomp \ -Q theories analysis -coqlib https://coq.inria.fr/doc/V8.18.0/stdlib/ \ -external https://math-comp.github.io/htmldoc_2_1_0/ mathcomp.ssreflect \ -external https://math-comp.github.io/htmldoc_2_1_0/ mathcomp.algebra \ - -hierarchy-graph "hierarchy-graph.dot" \ + -hierarchy-graph $HIERARCHY \ -dependency-graph "depend.dot" \ $FILES