please add TypeScript and GraphQL syntax highlighting #2842

Closed
opened 2026-02-05 05:26:02 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @ionics on GitHub (Jun 10, 2022).

Describe the feature you'd like

please add TypeScript and GraphQL syntax highlighting.

This was asked already in 2020.

Describe the benefits this would bring to existing BookStack users

Users documenting TypeScript and GraphQL will have propper syntax highlighting in their pages.

Can the goal of this request already be achieved via other means?

NO

Was this asked before?

Partly > but attached to an issue asking for VB support, see anutator's feature request at the bottom of this issue talk: https://github.com/BookStackApp/BookStack/issues/2255

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundemental request

How long have you been using BookStack?

1 to 5 years

Additional context

No response

Originally created by @ionics on GitHub (Jun 10, 2022). ### Describe the feature you'd like please add TypeScript and GraphQL syntax highlighting. This was asked already in 2020. ### Describe the benefits this would bring to existing BookStack users Users documenting TypeScript and GraphQL will have propper syntax highlighting in their pages. ### Can the goal of this request already be achieved via other means? NO ### Was this asked before? Partly > but attached to an issue asking for VB support, see anutator's feature request at the bottom of this issue talk: https://github.com/BookStackApp/BookStack/issues/2255 ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundemental request ### How long have you been using BookStack? 1 to 5 years ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 05:26:02 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jun 10, 2022):

Thanks for the request @ionics,

  • Looks like there's a typescript mode built into the JavaScript mode we can use.
  • For GraphQL, there's no official codemirror mode which makes me apprehensive and I don't usually support non-official modes. But there is a mode provided & maintained by graphql themselves, so maybe that's viable. Just need to double check weight impact and support stability.
@ssddanbrown commented on GitHub (Jun 10, 2022): Thanks for the request @ionics, - Looks like there's a typescript mode [built into the JavaScript mode](https://codemirror.net/5/mode/javascript/index.html) we can use. - For GraphQL, there's no official codemirror mode which makes me apprehensive and I don't usually support non-official modes. But there is a [mode provided & maintained by graphql](https://github.com/graphql/graphiql/tree/main/packages/codemirror-graphql#readme) themselves, so maybe that's viable. Just need to double check weight impact and support stability.
Author
Owner

@ssddanbrown commented on GitHub (Jun 21, 2022):

Typescript now added as of the changes in #3512 which will be part of the next release. Therefore I'm going to close this off.

While doing those changes, I quickly attempted adding the official graphql mode also but I could not seem to use it without massively impacting the JS bundle size. I didn't dig too far into it though.

Since there's not official codemirror mode, and due to the above with the officially supported graphql mode, I'm going to say we won't support it but if there is a way to (directly) use the offical graphql with minimal impact I'd be happy to accept a PR for it.

@ssddanbrown commented on GitHub (Jun 21, 2022): Typescript now added as of the changes in #3512 which will be part of the next release. Therefore I'm going to close this off. While doing those changes, I quickly attempted adding the official graphql mode also but I could not seem to use it without massively impacting the JS bundle size. I didn't dig too far into it though. Since there's not official codemirror mode, and due to the above with the officially supported graphql mode, I'm going to say we won't support it but if there is a way to (directly) use the offical graphql with minimal impact I'd be happy to accept a PR for it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2842