Socket
Socket
Sign inDemoInstall

@astrojs/prism

Package Overview
Dependencies
1
Maintainers
3
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @astrojs/prism

Add Prism syntax highlighting support to your Astro site


Version published
Weekly downloads
209K
increased by4.89%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

@astrojs/prism

Supports Prism highlighting in Astro projects

Component

This package exports a component to support highlighting inside an Astro file. Example:

---
import { Prism } from '@astrojs/prism';
---

<Prism lang="js" code={`const foo = 'bar';`} />

Internal

This package exports a runHighlighterWithAstro function to highlight while making sure the Astro language is loaded beforehand

import { runHighlighterWithAstro } from '@astrojs/prism';

runHighlighterWithAstro(
  `
  ---
    const helloAstro = 'Hello, Astro!';
  ---

  <div>{helloAstro}</div>
`,
  'astro'
);

Keywords

FAQs

Last updated on 11 Apr 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc