rouge icon indicating copy to clipboard operation
rouge copied to clipboard

Support for syntax highlighting for Prisma schemas

Open nikolasburk opened this issue 4 years ago • 2 comments

Is your enhancement 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 because their syntax highlighting is based on rouge.

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: https://github.com/github/linguist/pull/4668#issuecomment-541354215

I also opened a similar issue in the forem/forem repo (which is the source code for dev.to): https://github.com/forem/forem/issues/10467#issuecomment-700073251

nikolasburk avatar Sep 28 '20 15:09 nikolasburk

This issue has been automatically marked as stale because it has not had any activity for more than a year. It will be closed if no additional activity occurs within the next 14 days. If you would like this issue to remain open, please reply and let us know if the issue is still reproducible.

stale[bot] avatar Jan 03 '22 21:01 stale[bot]

Commenting so this issue won't be considered stale 🙏

nikolasburk avatar Jan 04 '22 07:01 nikolasburk