gkellogg / earl-report

Ruby gem to consolidate multiple EARL reports and generate a rollup conformance report
12 stars 3 forks source link

add summary table #6

Open VladimirAlexiev opened 2 years ago

VladimirAlexiev commented 2 years ago

(from this thread https://twitter.com/valexiev1/status/1546427579363631104)

Eg https://w3c.github.io/json-ld-api/reports/: add new sec 4 Summary Table with a summary like in this sheet image

These are hand-made optimizations that the feature probably cannot do:

@gkellogg "this is auto-generated from individual EARL reports. It would be cool to generate a table like this in HTML. Should be doable. The software that generates the report is open-source. The HTML version is generated from a Haml template, which iterates on the JSON-LD version. Adding a summary table should be straightforward."

Thanks! I don't know Ruby or Haml, but I've read some Ruby and I hope Haml is straightforward. If not, I'll try to coopt a colleague.

Can you point me to:

gkellogg commented 2 years ago

Default template is here. CSS for colors is in the head matter.

Most complicated inline code is for calculating test percentages, and it should be pretty close to what you need. Most be pre-computing and storing in memory would simplify the summary.

I can spend some time with it when I’m back from vacation next week.

VladimirAlexiev commented 2 years ago

@mkotoff is starting on this. We looked at the Haml, and we think all we need is there for the picking.

https://github.com/gkellogg/earl-report/blob/master/lib/earl_report/views/earl_report.html.haml is only an example, right? https://github.com/w3c/json-ld-api/blob/main/reports/template.haml is the only Haml used for the report in question?

So I think we'll submit a PR against the latter, with a small PR to the README of the former just describing the new functionality and providing a pointer?

gkellogg commented 2 years ago

The version in the earl_report gem is the default, and can be overridden, which is done in the json-ld report as you noted, so yes, changes to the base will need to be ported over, or changes to the template in the JSON-LD repo will need to be back-ported. Maybe easier to work on the one in the JSON-LD repo which has more data to look for the expected results. I can back-port to earl_report.

gkellogg commented 1 year ago

@VladimirAlexiev did you end up adding a summary report to one of your implementations? I'd like to add that into the built-in template. If you could provide a format, that would be great.