The latest release of Perinci::CmdLine (1.68) supports viewing program’s output in an external program. And also a new output format is introduced: html+datatables. This will show your program’s output in a browser and table data is shown as HTML table using jQuery and DataTables plugin to allow you to filter rows or sort columns. Here’s a video demonstration:
Your browser does not support the video tag, or WordPress filters the VIDEO element.
If the video doesn’t show, here’s the direct file link.
A MetaCPAN search has Perinci::CmdLine V 1.50. Any idea why?
And for displaying in multiple formats, did you consider Text::Table::Manifold?
LikeLiked by 1 person
Yeah, there’s a little problem in the naming of the module: Perinci::CmdLine was split to two (now three) different implementations. When I say Perinci::CmdLine, most of the time I’m actually referring to Perinci::CmdLine::Lite, the “default” implementation, but that’s a bit longer to type. This is explained in the Perinci::CmdLine POD. Someday I’d like to merge the implementations again.
Hm, I was not aware of Text::Table::Manifold before I wrote Text::Table::Any. But I was trying to reuse the Text::Table::Tiny (0.03) API, which is just a single function call. And Text::Table::Manifold’s deps are a bit too heavy for my needs (Moo, Types::Standard, Unicode::GCString). I explicitly exclude Unicode table output in Perinci::CmdLine and leave it for Perinci::CmdLine::Classic (the heavier implementation).
LikeLiked by 1 person
Hmm. Somehow I’m now viewing V 1.68 in MetaCPAN.
LikeLiked by 1 person
Yup, that’s the version for Perinci::CmdLine::Lite, which I should’ve said in the first place to avoid confusion. Sorry.
LikeLiked by 1 person
Also, did you know there is another version of datatables – https://github.com/Holt59/datatable – which does not require JQuery? It’s the one I use e.g. here https://savage.net.au/Flowers.html. Scroll down to Flower Catalog.
LikeLiked by 1 person
No, I didn’t. To be honest I didn’t do an exhaustive search for datatables stuff and just picked the first result from Google 🙂 I might take a look it. Thanks for the link.
LikeLiked by 1 person
This is handy for when reading benchmark result table from bencher, for example:
LikeLiked by 1 person