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

hiccup

  • Sr. Member
  • ****
  • Posts: 7937
Here are some User Defined Language (UDL) files for Notepad++ (a.k.a. Notepad Plus, NPP, NP+) that I created.

These UDL files define a layout for the edit panel, and can include colouring, fonts and highlighting features.
I have created four 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


- - -


MusicBee Theater Modes  -  for editing Theater Mode XMLs:

The colouring aims to differentiate between:

<!-- comments -->    (do not use \\ or // slashes for comments)
basic elements  values  position/size elements  font elements  image elements
child elements  other elements  settings elements  autohide panel elements  (can be collapsed)






DOWNLOAD MusicBee Theater Modes 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
 
 
Last Edit: November 16, 2023, 03:28:20 PM by hiccup

psychoadept

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

Latest patches (3.5/3.6)
(Unzip and overwrite existing program files)

hiccup

  • Sr. Member
  • ****
  • Posts: 7937
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

  • Sr. Member
  • ****
  • Posts: 4669
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

  • Sr. Member
  • ****
  • Posts: 7937

hiccup

  • Sr. Member
  • ****
  • Posts: 7937
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

  • Sr. Member
  • ****
  • Posts: 4669


hiccup

  • Sr. Member
  • ****
  • Posts: 7937
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

  • Sr. Member
  • ****
  • Posts: 7937
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

  • Sr. Member
  • ****
  • Posts: 7937
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

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

hiccup

  • Sr. Member
  • ****
  • Posts: 7937
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

  • Sr. Member
  • ****
  • Posts: 7937
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 or the Artist Variables plugin (both by rdswift) are purple.

Last Edit: July 28, 2023, 05:38:54 PM by hiccup

hiccup

  • Sr. Member
  • ****
  • Posts: 7937
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