A tool to create a complete, completely static ro-crate-preview.html
file with the same functionality as ro-crate-html-js but without any dependence on online resources or JavaScript (except for some small helpers).
HTML Preview Lite is available without any installation at the RO-Crate Playground.
npm install .
node index.js [options] <path_to_crate_directory>
Load an RO-Crate from a specified directory.
Arguments:
path_to_crate_directory Path to the crate directory.
Options:
-l, --layout <layoutPath> Filepath or URL to a layout file in JSON format. This forces the script to use the specified layout instead of the default or the one present in the crate. Use raw link if URL is from GitHub. (Default: "https://github.com/Language-Research-Technology/crate-o/blob/main/src/lib/components/default_layout.json")
-m, --multipage-config <configPath> Filepath or URL to a multipage configuration file in JSON format.
-h, --help Display help for command.
To generate an About page for the site:
- Include an entry for the file in the RO-Crate with
@type
ofFile
andAboutPage
. Use the path to the about content (in markdown format) as the entry's@id
. TheencodingFormat
describes the markdown file media type, andisRef_about
indicates that the about information is related to the collection (rather than, say one of the collection objects).
{
"@id": "about/about.md",
"@type": [
"File",
"AboutPage"
],
"encodingFormat": "text/markdown",
"isRef_about": "./"
},
-
Save the markdown file in the crate directory according to the path given as the file ID.
-
Associate the
AboutPage
type with a template in the multipage config.
Sample crate:
node index.js test_data/sample
Farms to freeways -- multipages
node index.js -m test_data/f2fnew/f2fconfig.json test_data/f2fnew/data
To format the template run npm run format
This repo has HTML validation set up to run on push/PR. It prints the report on the summary page of each Actions workflow run. The CI run won't fail on any validation errors, it's just for our information.
The validator is currently set up to only check test_data/**/ro-crate-preview.html
files, this means that multipage previews won't be validated. Since the purpose of the validation is to check, by proxy, the validity of the template, CI for the multipage previews will be added as separate workflow in the future.