You can look to lib/puppet/util/rdoc/parser.rb in the puppet codebase.
This is what implements "puppet doc".
This parses a set of manifests and introspect the returned AST to build
rdoc data structure to produce documentation.
The specific is that it is designed to parse independently all the
manifests, instead of globally like puppet does usually.
--
Brice Figureau
Follow the latest Puppet Community evolutions on
www.planetpuppet.org!