
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
prism-remote
Advanced tools
A custom element for displaying remote code blocks with syntax highlighting provided by Prism
Easily embed remote code with syntax highlighting provided by Prism using a custom HTML element. No other dependencies other than Prism itself.
Example:
<prism-remote
src="https://github.com/Fingel/prism-remote/blob/main/prism-remote.js"
start="1"
end="10"
lang="javascript"
>
</prism-remote>
Would result in:
Provide the following attributes to the <prism-remote>
tag:
src
(required) The URL to the text you want to display.lang
(required) The language for highlighting.start
The first line to display (1 indexed).end
The last line to display.If you are using Github it's possible to provide the natural URL instead of the raw URL. For example: https://github.com/Fingel/prism-remote/blob/main/prism-remote.js instead of https://raw.githubusercontent.com/Fingel/prism-remote/main/prism-remote.js . The attribution link at the bottom will point to the natural URL.
The attribution link has a class of prism-remote-attribution
so you can style it (or hide it alltogether).
Make sure you already have Prism available.
Include prism-remote.js directly
Include prism-remote.js on your page and load it. Make sure to use
type="module"
<script src="prism-remote.js" type="module"></script>
Use a CDN
<script
src="https://unpkg.com/prism-remote@latest/prism-remote.js"
type="module"
></script>
Install with npm
npm -i prism-remote
Then do Javascript things.
FAQs
A custom element for displaying remote code blocks with syntax highlighting provided by Prism
We found that prism-remote demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.