BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

Codemirror Custom mode support

Open Naltaris opened this issue 5 years ago • 7 comments

Codemirror supports adding new mode(s) (language syntax) but this is not leveraged here.

Because of javascript sources in this project are minimized it is not possible add new CodeMirror mode outside of full development where new branch for this needs to be kept.

Would it be possible to add support so that we can add new codemirror modes easily as a sort of "plugin"?

Naltaris avatar Apr 21 '20 13:04 Naltaris

Hi @Naltaris,

I could expose some kind of JavaScript hooks if really wished for but they'll only be semi-officially supported. To be honest, as long as the languages you want to add are fairly common i'd be happy to add them in to the core list anyway.

ssddanbrown avatar Apr 25 '20 18:04 ssddanbrown

Hi @ssddanbrown ,

I would really appreciate the hooks.

Company I work for is using Proprietary languages so it is not possible to have them in official release :(

Thank you

Naltaris avatar Apr 30 '20 17:04 Naltaris

HI Dan @ssddanbrown

Sorry to bump an old thread, but I was wondering whether .NET is in the core list? I see VBScript is, but using VB.NET (which is how it seems to be specified in the CodeMirror language modes page) doesn't appear to be enabled. I still have to document a lot of VB and .NET code in my work, so this would be very useful if you could enable it.

Thanks!

Mark

techauthoruk avatar Aug 03 '21 11:08 techauthoruk

Hi @techauthoruk, Sorry, I'm not too familiar with the world of .net and VBscript, My understanding was that a lot of .net was c#. I see that VB.NET is something else within the .net landscape, Seems popular enough and supported officially by codemirror so feel free to open a new issue for that to be added to the default included options. Not currently included but could be sneaked into the next release quite easily.

ssddanbrown avatar Aug 03 '21 19:08 ssddanbrown

Hi, I same request, I was trying to add commonlisp https://codemirror.net/mode/commonlisp/index.html.

Could you expose or add the language please ?

Quentin

DomiQuentin avatar Mar 11 '22 16:03 DomiQuentin

+1 for this feature.

Would love to add an Apache config mode that isn't bundled with codemirror https://github.com/gauthier-th/codemirror-mode-apache

If this is a non trivial thing to include as a base feature in BookStack (easily adding custom modes), perhaps we could get a basic instructional guide on how to do this manually? As it stands I'm confused how this would have to done.

Thanks!

Mazvy avatar Apr 08 '22 10:04 Mazvy

Very closely related to #844

ssddanbrown avatar May 30 '22 13:05 ssddanbrown

I also support this feature.

Is there any work beeing done on this topic? We need to have Structured Text, one of the IEC 61131-3 Standardized languages, to be integrated within codemirror. unfortunately it is not part of the official package or offically registered as community-mode on the codemirror-project. Is there a possibility to integrate it ourselfes (we have a IT-company maintaining our bookstack-app, i would ask them to do so) or would be risk not to be able to update in the future (or similar)?

I love to use bookstack, thanks for the good work, i highly appreciate! Thank you!

momomsr avatar Nov 28 '22 08:11 momomsr

@ssddanbrown, do you have plans to include this in a near version? Thanks

carlossierra311 avatar Jan 13 '23 00:01 carlossierra311

@carlossierra311 Probably not too soon to be honest. Could have added sooner via a hacky way but wanted to think about doings things a bit nicer. #3904 would work towards that. Also need to think about the move away from CodeMirror 5 since that would affect things here, hence no point moving this forward beforehand really.

ssddanbrown avatar Jan 13 '23 00:01 ssddanbrown

Too bad. Thanks anyway.

carlossierra311 avatar Jan 13 '23 00:01 carlossierra311

Thanks for the honest answer. If there would be any workaround to get it working with a custom language please let us know. Thanks for the great work in general!

momomsr avatar Jan 17 '23 07:01 momomsr