|
From: Michalis K. <mic...@gm...> - 2010-10-29 21:16:05
|
I implemented in trunk a fix/feature (depends how you look at it :) ) called "external class hierarchy". The idea is that the "Class Hierarchy" generated by PasDoc (both in HTML page and for GraphViz graph) was sometimes not perfect, because PasDoc doesn't know about the hierarchy of classes defined outside of your source files. For example: suppose you have classes A, B descending from TObject, and classes C, D descending from Exception. Your source code contains classes A, B, C, D, but does not contain definitions for standard TObject and Exception classes. So PasDoc was showing them as TObject |- A |- B Exception |- C |- D That is, PasDoc had no idea that class Exception descends (directly!) from TObject. Right now, this will be shown correctly as TObject |- A |- B |- Exception |- C |- D A screenshot showing the two outputs side-by-side is probably better than my ascii art :), attaching. We now provide PasDoc with built-in knowledge of hierarchy of the common RTL/component classes. This is encoded in source/component/external_class_hierarchy.txt file in SVN (and processed to .inc file and embedded in executable, just like our CSS file). This hierarchy is taken from FreePascal RTL/FCL units, see script source/tools/fpc_sources_parse_for_external_class_hierarchy.sh . Format is a trivial text file with lines TChildClass=TParentName. You can also provide your own file with class hierarchy by --external-class-hierarchy=file.txt command-line option. The docs are on http://pasdoc.sipsolutions.net/ExternalClassHierarchy#preview Everyone is welcome to share (you can paste it to that wiki page, for example) the class hierarchy made specially for other libraries, like Delphi RTL (if the differences between Delphi and FPC RTL will be too much nuisance), VCL, or just any other library. For the future: - Implementation of --external-class-hierarchy= may be improved one day to be able to take a dot (GraphViz) file. This would allow you to 100% automatically generate a class hierarchy for your library, by existing --graphviz-classes option, that can be later used by others by --external-class-hierarchy= option. If / when I will implement it depends on the success of this feature :), unless someone has ready patch of course. Michalis |