Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ro-crate-html-js
Advanced tools
Readme
This nodejs repository has code for generating HTML previews for Research Object Crates (RO-Crate)
RO-Crates are data packages consisting of a folder/directory of content with a JSON-LD manifest known as an RO-Crate Metadata File, which has the filename ro-crate-metadata.json
in the root folder. RO-Crates also should have an RO-Crate Website which is a local set of web resources, with an index page ro-crate-preview.html
.
This library consists of tools to create an RO-Crate Website for a crate, from the RO-Crate Metadata File.
There are two approaches to this:
rochtml
is a script that creates an HTML page that summarizes the RO-Crate root dataset (which is always a Schema.org Dataset object expressed in JSONLD) and then dynamically renders details about other entities, both Data Entities (files, datasets and other local and remote streams of data) and Contextual Entities (addition information about data provenance such how files were created, by whom and where) described in the crate. This script creates a single, small HTML file.
rocsite
is a script that creates a multi page RO-Crate Website* using some confguration.
In most cases rochtml
is the most appropriate tool unless the crate you are dealing with is very large (more than 5000 entities) or is largely made up of contextual entities such as historical events, people etc.
To install this from npm type:
npm install ro-crate-html-js
To make changes to this code:
git clone https://github.com/UTS-eResearch/ro-crate-html-js
cd ro-crate-htmljs
npm install .
npm link --local
To render HTML for an RO-Crate, use rochtml
:
rochtml test_data/sample-ro-crate-metadata.json
The script will create an HTML page:
test_data/sample-ro-crate-preview.html
The HTML page has a complete copy of the RO-Crate metadata file's JSON-LD content in a <script>
element in the <head>
, and references the compiled rendering script that can then dynamically generate web-views of the RO-Crate metadata: ro-crate-dynamic.js
. This is available via the Content Distribution Network (CDN) UNPKG which uses the NPM repository: https://unpkg.com/ro-crate-html-js/dist/ro-crate-dynamic.js.
To compile the rendering script for an RO-Crate HTML file (ro-crate-preview.html):
browserify lib/entry.js -o dist/ro-crate-dynamic.js
To make a crate that 'wraps' a series of crates that are in sub directories into a container crate:
metacrate -d directory_with_crates_in -n "Sample RO-Crates" -t "This RO-Crate links to other crates"
To create a RO-Crate multi-page HTML website for a crate, use rocsite
- this requires some fairly complicated configuration which is not yet documented, but you can look at an example in the Heurist2ro-crate project: https://github.com/UTS-eResearch/heurist2ro-crate
To compile the rendering script for the entry point to a multi-page HTML site RO-Crate HTML file (ro-crate-preview.html):
watchify lib/standAloneEntry.js -o dist/ro-crate-dynamic-multipage.js
See the MAKEFILE
for a commands that reference an configuration file.
TODO: Explain this properly.
For crates that have Class or Property definitions you can generate an HTML fragment that can be published on the web.
rocschema <path-to-crate>
Will create a markdown file that serves are rudimentary documentation. Add --html for HTML.
TODO: Add examples.
FAQs
Research Object Crate (RO-Crate) utilities for rendering a html representation
The npm package ro-crate-html-js receives a total of 45 weekly downloads. As such, ro-crate-html-js popularity was classified as not popular.
We found that ro-crate-html-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.