9f067dca27
* chore: remove changesets patch * chore: add changesets * chore: version packages * chore: normalize formatting * chore: update lockfile * chore: fix codeblocks * Update packages/astro/CHANGELOG.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update packages/astro/CHANGELOG.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update packages/astro/CHANGELOG.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * chore: fixup code samples * chore: move v0.25 message out of note Co-authored-by: Nate Moore <nate@astro.build> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> |
||
---|---|---|
.. | ||
src | ||
CHANGELOG.md | ||
package.json | ||
Prism.astro | ||
README.md | ||
tsconfig.json |
@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');