[Dot] Allow including of .dot files for reuseability.
Ported Issue from Mantis Original ID: 1251 Reported By: Pander
SEVERITY: MINOR Submitted: 2008-01-28 11:02:46
OS: --
VERSION: 2.17
DESCRIPTION
Allow including of .dot files for reuseability.
E.g.
file a.dot
digraph test {
rankdir=LR;
include="c.dot";
}
file b.dot
digraph test {
rankdir=TB;
include="c.dot";
}
file c.dot
a -> b;
b -> c;
It would take a simple recursive search and replace of all "include='file';" with the content of the named file. Of course reporting errors on line numbers will have to take care of correct messaging (naming also the file).
Implementing this feature will allow reusing graphs or parts of graphs in different end product graphs. Of course on can 'cat' text file together but not all end users are able to set up scripting etc.
STEPS TO REPRODUCE
digraph test { rankdir=LR; include="c.dot"; }
ADDITIONAL INFORMATION
Not a perfect solution, but one can always use one's favorite macro language to get the desired effect. In particular, if one uses cpp, the dot parser handles line numbers correctly.