Open jeanetteclark opened 2 months ago
@jeanetteclark Fully agree that markdown support in check results would be super useful.
I briefly looked into how we handle this in the current system. Basically, there is a MdqRunView
that renders the report runs by 1) fetching the report from solr, 2) parsing it into a model collection named QualityReport
, and 3) passing the data from that report model to a template to be rendered.
The result output then gets rendered in the template by iterating over the results, and creating either an img
tag or a span
with class check-output
based on the type of the output. See: https://github.com/NCEAS/metacatui/blob/main/src/js/templates/mdqRun.html#L274-L279
To add markdown support should be a matter of inserting a new block for markdown type outputs -- basically an else if
in the view logic in a couple of places. See the current markdown template here: https://github.com/NCEAS/metacatui/blob/main/src/js/templates/markdown.html along with the associated MarkdownView
that renders the Markdown. I think you could reuse a lot of this, and it may involve inserting a directive like <div class="markdown"><%- output.value %></div>
in the report template in the output block around line 277.
I hope @robyngit can help guide us on what the approach would be to integrating the MarkdownView into the quality reports.
Describe the feature you'd like
Rendering Markdown using showdown.js on metadig reports would give us a lot of flexibility to create much better looking reports.
Is your feature request related to a problem? Please describe.
We would like to show some informational checks with tables showing summaries of files. For example
would look like:
(except without the colors maybe)
Right now the best we have is:
which is not so readable.
I'd argue that this functionality is basically a requirement for the data quality suite to proceed. @mbjones can also weigh in on priority