Support User Defined Languages for Syntax Highlighting in Code Blocks #3447

Closed
opened 2026-02-05 06:44:57 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @carlossierra311 on GitHub (Jan 13, 2023).

Describe the feature you'd like

I've seen several posts (e.g. #481 and #2057) requesting support for custom highlighting capabilities in code blocks. I too have such a need, because our documentation includes proprietary languages that required full syntax highlighting to be properly included in our documentation. Other people have asked for it because they use not-too-popular languages, proprietary languages, need custom line coloring, etc.

The way I've solved all these needs in the past has been:

  • By creating a User Defined Language (UDL) in Notepad++, which provides a form where you can specify formatting for groups of keywords, comments, operators, etc. This way, I can get my code to be properly highlighted.
    image

  • Another approach I've used in the past is to generate an XML block, with the information needed to produce the desired highlighting, and paste it in some text box in the application, so that it is made available as a new syntax highlighting mode (e.g. GoCoEdit for iOS's custom syntax modes).

The problem with these two approaches is that, by Notepad++ and GoCoEdit not being web apps, I need to share my UDLs/XMLs with my teammates, and they need to "install" import them in their computers/tablets. Or I can simply share the code as an image, but this has many limitations as well.

Describe the benefits this would bring to existing BookStack users

We would be able to document code blocks more completely and clearly, so that the users of the documentation we produce (many of whom are non-technical), don't need additional tools, or know about XML blocks, UDLs, or any other means that we are using to overcome this limitation.

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

We could use inline code, which allows robust formatting/highlighting, but this would mean that everything related to code syntax and formatting would have to be done manually: line numbering, keyword and operator highlighting, code folding, etc. It would be so cumbersome, that I would prefer to keep doing what I do currently with Notepad++ or GoCoEdit.

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?

6 months to 1 year

Additional context

No response

Originally created by @carlossierra311 on GitHub (Jan 13, 2023). ### Describe the feature you'd like I've seen several posts (e.g. #481 and #2057) requesting support for custom highlighting capabilities in code blocks. I too have such a need, because our documentation includes proprietary languages that required full syntax highlighting to be properly included in our documentation. Other people have asked for it because they use not-too-popular languages, proprietary languages, need custom line coloring, etc. The way I've solved all these needs in the past has been: - By creating a User Defined Language (UDL) in Notepad++, which provides a form where you can specify formatting for groups of keywords, comments, operators, etc. This way, I can get my code to be properly highlighted. ![image](https://user-images.githubusercontent.com/23511373/212198243-fcfbfcc6-163c-4b91-b214-ad9f4a211848.png) - Another approach I've used in the past is to generate an XML block, with the information needed to produce the desired highlighting, and paste it in some text box in the application, so that it is made available as a new syntax highlighting mode (e.g. [GoCoEdit for iOS's custom syntax modes](https://gocoedit.app/docs/custommodes)). The problem with these two approaches is that, by Notepad++ and GoCoEdit not being web apps, I need to share my UDLs/XMLs with my teammates, and they need to "install" import them in their computers/tablets. Or I can simply share the code as an image, but this has many limitations as well. ### Describe the benefits this would bring to existing BookStack users We would be able to document code blocks more completely and clearly, so that the users of the documentation we produce (many of whom are non-technical), don't need additional tools, or know about XML blocks, UDLs, or any other means that we are using to overcome this limitation. ### Can the goal of this request already be achieved via other means? We could use inline code, which allows robust formatting/highlighting, but this would mean that everything related to code syntax and formatting would have to be done manually: line numbering, keyword and operator highlighting, code folding, etc. It would be so cumbersome, that I would prefer to keep doing what I do currently with Notepad++ or GoCoEdit. ### 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? 6 months to 1 year ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 06:44:57 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 13, 2023):

Thanks for the request but we already have #2057 open which essentially covers the fundamental request here so I'm going to therefore close this off as a duplicate.

@ssddanbrown commented on GitHub (Jan 13, 2023): Thanks for the request but we already have #2057 open which essentially covers the fundamental request here so I'm going to therefore close this off as a duplicate.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3447