Visualizing a crate as HTML preview

Last updated on 2025-04-17 | Edit this page

Overview

Questions

  • How can an RO-Crate be rendered without showing the JSON?
  • How can I generate a preview of the RO-Crate?

Objectives

  • Explore a HTML preview of an RO-Crate
  • (Advanced) Try the ro-crate-html tool

HTML preview


An RO-Crate can be distributed on disk, in a packaged format such as a zip file or disk image, or placed on a static website. In any of these cases, an RO-Crate can have an accompanying HTML version (ro-crate-metadata.html) designed to be human-readable.

Example dataset for RO-Crate specification
  1. CC BY-NC-SA 4.0 International
  2. Brown University
  3. The context, and for root dataset: existance, valid identifier, name, description, license and date published.
  4. The other entities were not checked, e.g. the affiliation of the author.

Advanced: Generating HTML preview


If you have Node JS installed, you can install and try the ro-crate-html tool on your crate1 folder:

BASH

npm i -g ro-crate-html
rochtml crate1/ro-crate-metadata.json

Or if you have Docker, something like:

BASH

docker pull simleo/rochtml
docker run -v $(pwd):/crate -it simleo/rochtml -c ro-crate-preview_files /crate/ro-crate-metadata.json

The above will generate a ro-crate-preview.html file within your RO-Crate Root. Experiment with modifying the Metadata file and re-generating the HTML preview to see how your rendering differs from the running example.

Key Points

  • RO-Crate can be rendered into a HTML preview
  • RO-Crate previews tend to show each entity separately
  • The preview HTML can be added as part of the RO-Crate