Forem Creators and Builders


Feature request: add syntax highlighting for .prisma files

mabdelwahab profile image Mahmoud Abdelwahab ・1 min read

Prisma schemas don't have proper syntax highlighting in articles.


For more info, check out this GitHub issue on the rouge-ruby repo

Discussion (1)

rhymes profile image

Hi @mabdelwahab , unfortunately as you surmised we have to wait for Ruby Rouge to add it, we've been monitoring it for a while:

Support for syntax highlighting for Prisma schemas in Markdown #10467

Is your feature request related to a problem? Please describe.

Prisma is a database toolkit that comes with its own data modeling language to define the so-called Prisma schema.

Right now, Prisma schemas don't have proper syntax highlighting in articles.

Describe the solution you'd like

Ideally, could support the prisma annotation on fenced code blocks to render Prisma schemas more colorful! For example:

datasource db {
  url      = env("DATABASE_URL")
  provider = "postgresql"
generator client {
  provider = "prisma-client-js"
model User {
  id        Int      @id @default(autoincrement())
  createdAt DateTime @default(now())
  email     String   @unique
  name      String?
  role      Role     @default(USER)
  posts     Post[]
model Post {
  id        Int      @id @default(autoincrement())
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  published Boolean  @default(false)
  title     String
  author    User?    @relation(fields: [authorId], references: [id])
  authorId  Int?
enum Role {

Additional context

This has been enabled on GitHub already (see here).

This is the PR that enabled syntax highlighting for Prisma schemas on GitHub:



As soon as Rouge implements it, we'll get it as well

Forem Open with the Forem app