Author Topic: User Defined Language templates for editing skins and virtual tags in Notepad++  (Read 21028 times)

hiccup

  • Hero Member
  • *****
  • Posts: 6853
I created some User Defined Language (UDL) files for Notepad++ (a.k.a. Notepad Plus, NPP, NP+)

Such files define a layout for the edit panel, and can include colouring, fonts, and highlighting features.
I have created three of them for different purposes related to MusicBee:


MusicBee virtual tags  -  for editing virtual tags and other MB formulas:

dark version:



light version:



DOWNLOAD MusicBee virtual tags Notepad++ udl


- - -


MusicBee xml skins  -  for editing xml skins:

dark version:



light version:



DOWNLOAD MusicBee skinning Notepad++ udl


- - -


Picard scripting  -  for editing Picard scripts:

dark version:



light version:



DOWNLOAD Picard scripting Notepad++ udl


- - - - - - - - - - - - -


Especially the one for xml skins has a lot of highlighting features, most of them to improve readability, some of them to help indicating flaws in syntaxes.
So don't get scared when you make a syntax mistake somewhere, and everything below it turns into a red bloody mess.
It should be helpful to locate the error at where the flood of red begins.
(you may need to refresh the view to get the correct highlight colours back after you fixed the mistake)


howto:

- Download the file(s)

- Navigate to your NPP installation folder and locate the folder: userDefineLangs

- Copy the UDL file(s) there

- Open Notepad++
  Now in the menubar under [Language], the new UDL should be available.

That should be all.


- - - - - - - - - - - - - - - -


note 1:

Important!

Notepad++ has an UDL import feature by means of an [Import...] button in the UDL settings panel.
Do not use that to import these UDL files!
NPP currently seems to have a bug that deletes font specifications from UDL files when importing.
(currently at v7.8.3)

note 2:

There are several fonts referenced to in these UDL's:

Segoe UI
Segoe UI Symbol
Calibri
Verdana
Consolas
Source Code Pro (Regular, Medium and Semibold)

If I am not mistaken Windows 10 will have the first five installed by default.
The others are included in the download links.

note 3:

UDL language files are limited to the extent of what elements of NPP they can define colours for.
For example, you will need to set the background colour in NPP's Style Configurator.
(rgb 30,30,30 is suggested for the dark versions, 242,242,242 for the light ones)

The same goes for items such as the line numbers sidebar, folding controls, brackets, etc.


You are obviously free to edit these themes' colours and fonts to your own liking.
And then perhaps post and share the results in this thread?


- - - - - - - - - - - - - - - -


bonus:

I created some icons making it possible to differentiate between xml files, MusicBee formula files, and Picard scripting files.:



Updated:

-  48x48 desktop icons are now non-transparent. (better for desktops with an image as background)
-  I added icons for .ini and .config.






DOWNLOAD XML/MusicBee/Picard coding file icons


(some tags for possibly improving search results a bit: notepad++ notepadplus npp np++ user defined language udl dark light theme musicbee skinning virtual tags musicbrainz picard scripting free download !)
Last Edit: November 25, 2022, 05:24:02 PM by hiccup

psychoadept

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10694
This is awesome, thanks!  I think I will move it to Tips & Tricks
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

hiccup

  • Hero Member
  • *****
  • Posts: 6853
This is awesome, thanks!  I think I will move it to Tips & Tricks

Thanks psychoadept. Fwiw; I am trying to make the virtual tag script work for Picard scripting also.
At the moment I am running into some difficulties making it work for both MB and Picard, but I hope I can solve it.

boroda

  • Hero Member
  • *****
  • Posts: 4162
But if I am not mistaken, there are also functions that can be used when Additional Tagging Tools is installed.
Functions such as $Date, $Round, $Div, etc.
Would it be useful to add those too?
And if so, does anybody have a complete list of available functions?

Code
$Random(max_number)
$Add(number1,number2)
$Sub(number1,number2)
$Mul(number1,number2)
$Div(number1,number2)
$Round(number,number_of_digits_after_decimal_point)
$Abs(number)
$Now(): returns current date/time
$AddDuration(duration1,duration2): duration format is similar to date/time format
     without "am/pm" suffix, but allowed values are different,
     e.g. 00/01/0000 00:00:00 is valid duration, but not valid date/time. Either
     date part or time part can be omitted, it will be defaulted to zero value.
$SubDuration(duration1,duration2)
$SubDateTime(datetime1,datetime2): returns duration between datetime1 and
     datetime2. Date/time format depends on your Windows regional settings,
     e.g. 12/31/2018 11:59:59 pm. For datetime1 and datetime2 either date part or
     time part can be omitted, it will be defaulted to current date or
     time 00:00:00 am.
$NumberOfDays(datetime1,datetime2): returns number of days between
     datetime1 and datetime2 rounded down to nearest integer value.
$AddDurationToDateTime(datetime,duration)
$SubDurationFromDateTime(datetime,duration)
$And(parameter1,parameter2) is MusicBee native function
$Or(parameter1,parameter2) is MusicBee native function
$Xor(parameter1,parameter2)
$Not(parameter)
$Log(number,base)
$Lg(number): decimal logarithm
$Ln(number): natural logarithm
$Sqrt(number): square root. May be useful for gathering some library
     statistics (in conjunction with ALR functions).
$Len(string): length of string
$Name(filename): returns file name without extension and
     path to file
$CutLeft(string,count): removes number of chars from
     the left of the string
$CutRight(string,count): removes number of chars from
     the right of the string
$RoundDown(number,number_of_digits_after_decimal_point): $RoundDown(4.28,1)
     returns 4.2
$RoundUp(number,number_of_digits_after_decimal_point): $RoundUp(5.2,0)
     returns 6
$Mod(number1,number2): returns the remainder of division

hiccup

  • Hero Member
  • *****
  • Posts: 6853

hiccup

  • Hero Member
  • *****
  • Posts: 6853
Update; I also created a dedicated Notepad++ language file for MusicBrainz' Picard scripting.
Details and a screenshot are at the bottom of the start post.

boroda

  • Hero Member
  • *****
  • Posts: 4162


hiccup

  • Hero Member
  • *****
  • Posts: 6853
Update:

I created some icons making it possible to differentiate between xml files, MusicBee formula files, and Picard scripting files.:



details are in the start post

hiccup

  • Hero Member
  • *****
  • Posts: 6853
Update:

Since the days are getting longer, I decided to complete the light versions of the UDL files.

They are included in the downloads.
See the startpost for further details.

hiccup

  • Hero Member
  • *****
  • Posts: 6853
The UDL files for Picard scripting were updated.

The recently added tags:
Code
 _releasegroup_firstreleasedate
 _recording_firstreleasedate
and functions:
Code
$datetime
$find
$foreach
$getmulti
$join
$lenmulti
$map
$reverse
$reversemulti
$slice
$sortmulti
$substr
$while
Are now recognised.

hiccup

  • Hero Member
  • *****
  • Posts: 6853
The UDL language files for MusicBee virtual tags and Picard scripting were updated with recently added functions.

hiccup

  • Hero Member
  • *****
  • Posts: 6853
updated

1.
All UDLs now have transparency for their backgrounds.
This means that it is not necessary anymore to set the background colour of your Notepad++ theme to exactly 30,30,30 (dark theme) or 242,242,242 (light theme)
The UDLs will still look fine when using darker or lighter backgrounds.

2.
More functions now have distinct colouring.
The most notable one probably being regex functions.

3.
The matching of brackets has improved.

- - -

A quick impression:

MusicBee formulas:



Picard scripting:



(the colours for matching (and bad) brackets can be set under Settings > Style configurator > "Brace highlight style" and "Bad brace colour")

BAD bracket!:
Last Edit: August 01, 2022, 09:55:19 PM by hiccup

hiccup

  • Hero Member
  • *****
  • Posts: 6853
A small update for the Picard scripting UDLs:

A new discriminating colour for some functions that need a plugin to function was added.

- Functions that are by default available in Picard are blue.
- Functions that need the Classical Extras plugin to function are green.
- Functions that need the Additional Artists Variables, the AlbumArtist Extension, or the Artist Variables plugin (all by rdswift) are purple.


 

hiccup

  • Hero Member
  • *****
  • Posts: 6853
The information is very special
Yes, I think it is too. Thanks for noticing.
I'll settle for appreciation from a bot.

Moderator's Note: The post that was quoted in this message has been removed due to spam.
Last Edit: December 28, 2022, 03:29:01 AM by phred