PrismJS / prism

Lightweight, robust, elegant syntax highlighting.
https://prismjs.com
MIT License
12.14k stars 1.28k forks source link

Add Prisma Support #3462

Open nexxeln opened 2 years ago

nexxeln commented 2 years ago

Language Prisma is a Next-generation Node.js and TypeScript ORM. It's basically the standard way to communicate to a database using TypeScript now. In Prisma, you have a schema.prisma file to write your database schema, but there is no syntax highlighting for .prisma in prism.

Additional resources

pkerschbaum commented 2 years ago

In case it helps anyone:

The official Prisma docs actually use Prism.js for their code blocks, seems like they have their language definition here: github.com/prisma/docs/blob/c72eb087fcf57f3c00d153f86c549ef28b3d0f44/src/components/customMdx/prism/prism-prisma.js.
I was able to reuse that language definition for rehype-prism-plus, see github.com/pkerschbaum/pkerschbaum-homepage/blob/5472b5af94159e58bd99c84d198227b56d8dad84/packages/libs/mdx/src/prism/lang-prisma.ts.