Conf file syntax highlights

Jamie, it's time, I believe, to add code highlights for all conf files that you can edit using Webmin/Virtualmin.

I personally do a lot of it and it makes my head literally go dizzy reading through that un-highlighted texts!

Something like this would be perfect!! http://www.sublimetext.com/forum/viewtopic.php?f=3&t=856

Is this possible? It would be appreciated with most people, I think!

Status: 
Active

Comments

Does that package you linked to support highlighting in text boxes in the browser though? If not, Webmin/Virtualmin can't really use it.

I'll have a look into this. However, since Webmin is designed to protect you from having to edit config files manually, it isn't a very high priority.

Also, I suspect that most syntax highlighters are designed for languages like C, Perl, Python and HTML - not the obscure config formats used by Apache, BIND and so on.

Ilia's picture
Submitted by Ilia on Thu, 01/23/2014 - 00:49

Also, I suspect that most syntax highlighters are designed for languages like C, Perl, Python and HTML - not the obscure config formats used by Apache, BIND and so on.

Well probably, but it's not that important as as long as it's highlighted your brain will do most of the work. :) It's also important to have line number on the left.

Webmin is designed to protect you from having to edit config files

Jamie, with all respect to your uncomparable work - there is nothing better than editing config files manually.

There is no reason to limit other users to edit config files with comfort - they anyway will! It's better if they use Webmin/Virtualmin, I suppose!

The issue is that it isn't really possible to have a "generic" highlighter - the highlighting code would need to know the format of each config file so it can parse it properly.

Ilia's picture
Submitted by Ilia on Fri, 01/24/2014 - 00:59

Ok, Jamie! I have tested it a little bit and it seems that you're right!

But I still have a solution. Having the following would be more than enough for Webmin/Virtualmin in-build code editor:

  1. Line numbers
  2. Downlighting comments, based on comment type: # // -- and etc (so they would look a little greyish (on white bg))

Having only this drastically change editing experience!!

Could you please implement this?

I'll take a look. If you could point to a simple JS library that can just be added to an existing text box to add this, it would greatly speed up the process.

Those are nice, but they only apply to static text on a web page - not an editable text box.

Cool - I'll take a look at those. Hopefully they have compatible licences..

Ilia's picture
Submitted by Ilia on Sun, 01/26/2014 - 04:42

Codemirror is MIT licensed. You can reuse it as much as you want even in proprietary software

Codepress is LGPLv2.

editArea and Ace are just like Webmin, under BSD license - (LGPL, Apche and BSD licenses) and BSD accordingly.

Ilia's picture
Submitted by Ilia on Sat, 09/13/2014 - 04:50

I would like to ask about this code highlight feature? Any luck with this? It's not implemented yet, right? Or I have missed something?

Thanks, Ilia

No, we haven't looked into this much yet.