Skip Menu |

This queue is for tickets about the YAML-Yaml2Html CPAN distribution.

Report information
The Basics
Id: 17416
Status: open
Priority: 0/
Queue: YAML-Yaml2Html

People
Owner: Nobody in particular
Requestors: mark [...] summersault.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: wish: support for tables
Thanks for this module. It appeals to me as someone who would like to write a compact notation in my text editor and produce HTML pages. I'd like to see support for HTML tables added. It seems at a minimum this means adding a notation which means "This YAML structure is an HTML table" and possibly one which means "this is a header row". As long as the result serializes into an array of arrays, or array of hashrefs, it seems it should work out. Here's an example structure I have in mind: - name: Player Name hr: Home Runs avg: Average - name: Mark McGwire hr: 65 avg: 0.278 - name: Sammy Sosa hr: 63 avg: 0.288 Then, one of the existing tools to serialize YAML to Perl could be used, and the table could be produced readily with HTML::Table. http://search.cpan.org/~ajpeacock/HTML-Table-2.04a/Table.pm Mark
From: mark [...] summersault.com
The basics did turn out to be easy. (example below). A simple "table:" key could be added to denote the start of a table, and maybe "_is_header" could be a key to denote a header row. #!/usr/bin/perl use YAML::Syck; use HTML::Table; use strict; my $data = Load(q# - name: Mark age: 29 - name: Hopi age: 27 #); HTML::Table->new([map { [values %$_] } @$data ])->print;