Try to use supported codemirror modes #2731

Closed
opened 2026-02-05 04:56:55 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @gchamon on GitHub (Mar 30, 2022).

Describe the feature you'd like

I have been documenting Groovy code and noted that, even though codemirror supports this mode, it is not mapped in modeMap. Maybe the codemirror controller should try to use whatever we pass as a markdown codeblock descriptor and fall back to plain text if not found.

Describe the benefits this would bring to existing BookStack users

It would enable with little maintenance all the highlighting modes codemirror provides.

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

I tried passing text/x-groovy as the MIME type defined in the mode documentation to no avail, so I think this must be implemented at the code level.

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 @gchamon on GitHub (Mar 30, 2022). ### Describe the feature you'd like I have been documenting Groovy code and noted that, even though codemirror supports this mode, it is not mapped in `modeMap`. Maybe the codemirror controller should try to use whatever we pass as a markdown codeblock descriptor and fall back to plain text if not found. ### Describe the benefits this would bring to existing BookStack users It would enable with little maintenance all the highlighting modes codemirror provides. ### Can the goal of this request already be achieved via other means? I tried passing `text/x-groovy` as the MIME type defined in the mode documentation to no avail, so I think this must be implemented at the code level. ### 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 04:56:55 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 31, 2022):

Hi @gchamon,

Maybe the codemirror controller should try to use whatever we pass as a markdown codeblock descriptor

It's not just setting the mode, The mode logic/functionality has to also be available. We don't every mode loaded as to avoid ballooning our script file-sizes, instead only those commonly desired. In addition, I prefer for us to define simpler, more common, language aliases rather than requiring usage of codemirror mode values so that content remains library abstract.

Is your core request here the addition of groovy? If so I can re-focus this issue and look to add it to the language list, assuming it's size impact is minimal.

@ssddanbrown commented on GitHub (Mar 31, 2022): Hi @gchamon, > Maybe the codemirror controller should try to use whatever we pass as a markdown codeblock descriptor It's not just setting the mode, The mode logic/functionality has to also be available. We don't every mode loaded as to avoid ballooning our script file-sizes, instead only those commonly desired. In addition, I prefer for us to define simpler, more common, language aliases rather than requiring usage of codemirror mode values so that content remains library abstract. Is your core request here the addition of groovy? If so I can re-focus this issue and look to add it to the language list, assuming it's size impact is minimal.
Author
Owner

@gchamon commented on GitHub (Mar 31, 2022):

Could we optionally extend Bookstack to include the languages we need that are supported by codemirror but not packed by default?

@gchamon commented on GitHub (Mar 31, 2022): Could we optionally extend Bookstack to include the languages we need that are supported by codemirror but not packed by default?
Author
Owner

@ssddanbrown commented on GitHub (Mar 31, 2022):

@gchamon Could do, has been requested in #2057.

@ssddanbrown commented on GitHub (Mar 31, 2022): @gchamon Could do, has been requested in #2057.
Author
Owner

@gchamon commented on GitHub (Mar 31, 2022):

I have no immediate need for groovy syntax that cannot wait for the other issue to be resolved.

@gchamon commented on GitHub (Mar 31, 2022): I have no immediate need for groovy syntax that cannot wait for the other issue to be resolved.
Author
Owner

@gchamon commented on GitHub (Apr 1, 2022):

Thanks for taking the time to answer me though! Much appreciated!

@gchamon commented on GitHub (Apr 1, 2022): Thanks for taking the time to answer me though! Much appreciated!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2731