On Fri, 2004-02-06 at 09:28, Thomas, Mark - BLS CTR wrote:
> What would be really nice is a way to automatically generate a visual tree
> representing the data structure that is available in the template, allowing
> the designer to see at a glance what they can insert into the template.

You can get a simple dump with Template::Plugin::Stash and
Data::Dumper.  If you want to make it fancy, you can use something like
Data::Walker instead of Data::Dumper.  You could probably write a
template with the latter that would generate some nice POD for the data
structure.

>  2. A method to automatically intercept a data structure from
>     perl before it is sent to the template, so that it can be
>     visualized as above. It would be best if this did not
>     require changing the script or the template.

Uh, you have to change something.  You can easilly do this in either
place, but using a special template seems like a natural if your goal is
to generate docs.

I doubt that non-programmers will be thrilled with the data
visualization tools that programmers use, but I've had no problems
giving POD (as HTML) to non-programmers with this kind of structure:

       * audio_tracks [ARRAY]
           List of audio_tracks for this music product.

           * audio_tracks.number
               The number of this audio track.

           * audio_tracks.title
               The title of this audio track.

           * audio_tracks.url
               The URL of this audio track, if it is available for down-
               load/streaming.

- Perrin


_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to