Hi.
I've gotten several requests for adding inherit-graphs to the Pike documentation. I now have a proof of concept that renders the graphs as a <pre>-formatted block similar to the corresponding feature in javadoc (but supporting multiple-inherits). Some examples:
| Class SSL.https | Inherit graph | | predef::ADT.Queue | | | | predef::SSL.context | | | | | | predef::Stdio.Port | | | | | +---+---+--predef::SSL.sslport | | | +--predef::SSL.https
| Class Parser.XML.Tree.SimpleRootNode | Inherit graph | | predef::Parser.XML.Tree.AbstractSimpleNode | | | | predef::Parser.XML.Tree.VirtualNode | | | | | | predef::Parser.XML.Tree.XMLParser | | | | | +---+------predef::Parser.XML.Tree.SimpleNode | | | | +---+--predef::Parser.XML.Tree.SimpleRootNode
| Class GTK2.FileChooserDialog | Inherit graph | | predef::GTK2.Object | | | +--predef::GTK2.Widget | | | +--predef::GTK2.Container | | | +--predef::GTK2.Bin | | | +--predef::GTK2.Window | | | | predef::GTK2.FileChooser | | | | +------predef::GTK2.Dialog | | | | +---+--predef::GTK2.FileChooserDialog
I however prefer not using <pre>, so I'd like some suggestions for alternative renditions.
/grubba
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<text x="0" y="20">predef::ADT.Queue</text> <text x="40" y="40">predef::SSL.context</text> <text x="80" y="60">predef::Stdio.Port</text> <text x="120" y="80">predef::SSL.sslport</text> <text x="160" y="100">predef::SSL.https</text>
<line x1="5" y1="25" x2="5" y2="76" style="stroke:rgb(0,0,0);stroke-width:2" /> <line x1="45" y1="45" x2="45" y2="76" style="stroke:rgb(0,0,0);stroke-width:2" /> <line x1="85" y1="65" x2="85" y2="76" style="stroke:rgb(0,0,0);stroke-width:2" /> <line x1="5" y1="75" x2="115" y2="75" style="stroke:rgb(0,0,0);stroke-width:2" /> <line x1="125" y1="85" x2="125" y2="96" style="stroke:rgb(0,0,0);stroke-width:2" /> <line x1="125" y1="95" x2="155" y2="95" style="stroke:rgb(0,0,0);stroke-width:2" />
</svg>
In a real implementation the style attributes would be moved to the stylesheet where they belong (and only give once), yes?
I've now implemented generation of SVG graphs per the example, and restarted the manual extractor at http://pike.lysator.liu.se/. The extractor has only reached 7.3.9, so to view some inherit graphs, take a look at the GTK documentation.
On Fri, May 04, 2012 at 06:10:02PM +0000, Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum wrote:
I've now implemented generation of SVG graphs per the example, and restarted the manual extractor at http://pike.lysator.liu.se/. The extractor has only reached 7.3.9, so to view some inherit graphs, take a look at the GTK documentation.
very, very nice!! (i am looking forward to see the graphs on the calendar module ;-)
greetings, martin.
On Fri, May 04, 2012 at 06:10:02PM +0000, Henrik Grubbstr m (Lysator) @ Pike (-) developers forum wrote:
I've now implemented generation of SVG graphs per the example, and restarted the manual extractor at http://pike.lysator.liu.se/. The extractor has only reached 7.3.9, so to view some inherit graphs, take a look at the GTK documentation.
very, very nice!! (i am looking forward to see the graphs on the calendar module ;-)
Hmm... The MirarDoc extractor didn't generate correct markup for inherits.
Fixed.
I've restarted the extractor once more, so now it's back at ulpc...
As a teaser, I can say that a few of the Calendar module inherit graphs are rather exotic (there are actually places where the same class is inherited multiple times through different other classes).
4 maj 2012 kl. 21:55 skrev Henrik Grubbström (Lysator) @ Pike (-) developers forum:
On Fri, May 04, 2012 at 06:10:02PM +0000, Henrik Grubbstr m (Lysator) @ Pike (-) developers forum wrote:
I've now implemented generation of SVG graphs per the example, and restarted the manual extractor at http://pike.lysator.liu.se/. The extractor has only reached 7.3.9, so to view some inherit graphs, take a look at the GTK documentation.
very, very nice!! (i am looking forward to see the graphs on the calendar module ;-)
Hmm... The MirarDoc extractor didn't generate correct markup for inherits.
Fixed.
I've restarted the extractor once more, so now it's back at ulpc...
As a teaser, I can say that a few of the Calendar module inherit graphs are rather exotic (there are actually places where the same class is inherited multiple times through different other classes).
... which is not that much of a surprise as Martin B. implied.
He just voiced the curiosity I thought myself about the Calendar module when you published the visualization-inherit-graphs-thingy.
And I do not mean to be disrespectful to Mirar, since I really like the Calendar module, and consider it immensely useful.
Too bad those pages consistently crash latest Safari (at least for me, anyone else more successful?).
Seems to be the xlink:href pointing to a page in the page cache that is the trigger, and since all graphs contain a link to the current page that condition is always satisfied. Even if we bug-report this there will be a tail of older browsers that can't read the documentation.
Nice! Can the unnecessary crossing lines be detected and removed by reordering the classes? I.e.:
| Class Parser.XML.Tree.SimpleRootNode | Inherit graph | | predef::Parser.XML.Tree.AbstractSimpleNode | | | | predef::Parser.XML.Tree.VirtualNode | | | | +---+--predef::Parser.XML.Tree.SimpleNode | | | | predef::Parser.XML.Tree.XMLParser | | | | +---+--predef::Parser.XML.Tree.SimpleRootNode
With a little modification of the algorithm, I think I've gotten an acceptable order for the tree case, while still surviving the DAG case:
| Class SSL.https | Inherit graph | | predef::ADT.Queue | | | | predef::SSL.context | | | | | | predef::Stdio.Port | | | | | +---+---+--predef::SSL.sslport | | | +--predef::SSL.https
| Class Parser.XML.Tree.SimpleRootNode | Inherit graph | | predef::Parser.XML.Tree.XMLParser | | | | predef::Parser.XML.Tree.AbstractSimpleNode | | | | | | predef::Parser.XML.Tree.VirtualNode | | | | | | +---+--predef::Parser.XML.Tree.SimpleNode | | | | +-----------+--predef::Parser.XML.Tree.SimpleRootNode
| Class GTK2.FileChooserDialog | Inherit graph | | predef::GTK2.FileChooser | | | | predef::GTK2.Object | | | | | +--predef::GTK2.Widget | | | | | +--predef::GTK2.Container | | | | | +--predef::GTK2.Bin | | | | | +--predef::GTK2.Window | | | | | +--predef::GTK2.Dialog | | | | +-----------------------+--predef::GTK2.FileChooserDialog
Hi.
I've gotten several requests for adding inherit-graphs to the Pike documentation. I now have a proof of concept that renders the graphs as a <pre>-formatted block similar to the corresponding feature in javadoc (but supporting multiple-inherits).
The inherit graphs have now been extended with the immediate children (if any).
I've also had a first go at fixing another top wish-list item for the manual: documentation of inherited symbols. The navigation now (with the help of some self-generating javascript) includes the inherited symbols.
/grubba
pike-devel@lists.lysator.liu.se