Forem Creators and Builders

Mahmoud Abdelwahab
Mahmoud Abdelwahab

Posted on

Feature request: add syntax highlighting for .prisma files

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

image

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

Discussion (1)

Collapse
rhymes profile image
rhymes

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 dev.to articles.

Describe the solution you'd like

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

```prisma
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 {
  USER
  ADMIN
}
```

Additional context

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

This is the PR that enabled syntax highlighting for Prisma schemas on GitHub: github.com/github/linguist/pull/46...

image

image

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