How to add a new syntax theme

English main discussion
  • Author
  • Message
Offline
Posts: 3
Joined: Fri Dec 27, 2013 7:11 am

How to add a new syntax theme

Post by Run_LeoCat »

Dear all,

I want to add a syntax theme to AkelPad. (For example, add a syntax theme for SHELL), But, I didn't find the method to add it.

Who can give me a method for this demand?

Thanks. :D

Offline
Posts: 1161
Joined: Sun Oct 20, 2013 11:44 am

Post by Skif_off »

1 2 3 4
For example sh.coder
Last edited by Skif_off on Thu Jan 02, 2014 7:11 pm, edited 1 time in total.

Offline
Posts: 3
Joined: Fri Dec 27, 2013 7:11 am

Post by Run_LeoCat »

Skif_off wrote:1 2 3
For example sh.coder
Thanks a lot. But, I don't know how to use this "coder" file. Just put this file into "Plugs\Coder" directory, or need to do some other operations?

Thanks. :)

Offline
Posts: 1161
Joined: Sun Oct 20, 2013 11:44 am

Post by Skif_off »

Run_LeoCat wrote:Just put this file into "Plugs\Coder" directory
and update cache (if used): remove file "Plugs\Coder\cache" or external call "Call("Coder::Settings", 2)" (see Coder-Eng.txt).
There is the menu items examples at the end of the file "Docs\Coder-Eng.txt" (if you need the menu items).

Offline
Posts: 3
Joined: Fri Dec 27, 2013 7:11 am

Post by Run_LeoCat »

Skif_off wrote:
Run_LeoCat wrote:Just put this file into "Plugs\Coder" directory
and update cache (if used): remove file "Plugs\Coder\cache" or external call "Call("Coder::Settings", 2)" (see Coder-Eng.txt).
There is the menu items examples at the end of the file "Docs\Coder-Eng.txt" (if you need the menu items).
What a great job!!

Thanks a lot!!! :D

Offline
Posts: 23
Joined: Sat Sep 13, 2014 10:35 am

Post by Azev »

Ok, what about the name? Why it doesn't appear in the context menu even after a reload?

Image

Thanks!

Offline
Posts: 366
Joined: Mon Jan 10, 2011 5:28 pm
Contact:

Post by Lenchik »

Because menu is hardcoded. Or it is default behavior of menu because only these *.coder are provided with Coder plugin.
So you need to put menu item by yourself.
I have done that by putting in ContextMenu::Showmenu of ContextMenu Plugin this:

Code: Select all

"SYNTAXTHEME"
{
  "1С" Call("Coder::Settings", 1, "1S") Icon("%a\AkelFiles\Plugs\Toolbar\1S.ico")
  "ActionScript" Call("Coder::Settings", 1, "as") Icon("%a\AkelFiles\Plugs\Toolbar\as.ico")
  "AkelPad menu" Call("Coder::Settings", 1, "akelmenu")
  "Assembler" Call("Coder::Settings", 1, "asm") Icon("%a\AkelFiles\Plugs\Toolbar\asm.ico")
  "AutoHotkey" Call("Coder::Settings", 1, "ahk")  Icon("%a\AkelFiles\Plugs\Toolbar\ahk.ico")
  "AutoIt" Call("Coder::Settings", 1, "au3") Icon("%a\AkelFiles\Plugs\Toolbar\au3.ico")
  "Avisynth" Call("Coder::Settings", 1, "avs") Icon("%a\AkelFiles\Plugs\Toolbar\avisynth.ico")
  "AWK" Call("Coder::Settings", 1, "awk") Icon("%a\AkelFiles\Plugs\Toolbar\awk.ico")
  "Bat/Cmd" Call("Coder::Settings", 1, "bat") Icon("%a\AkelFiles\Plugs\Toolbar\bat.ico")
  "BibTeX" Call("Coder::Settings", 1, "bib") Icon("%a\AkelFiles\Plugs\Toolbar\TeX.ico")
  "BBCode" Call("Coder::Settings", 1, "bbc") Icon("%a\AkelFiles\Plugs\Toolbar\BBCode.ico")
  "C++" Call("Coder::Settings", 1, "cpp") Icon("%a\AkelFiles\Plugs\Coder.dll", 4)
  "Coder Syntax" Call("Coder::Settings", 1, "coder") Icon("%a\AkelFiles\Plugs\Coder.dll", 2)
  "CSS" Call("Coder::Settings", 1, "css") Icon("%a\AkelFiles\Plugs\Toolbar\css.ico")
  "diff" Call("Coder::Settings", 1, "diff")
  "fb2" Call("Coder::Settings", 1, "fb2") Icon("%a\AkelFiles\Plugs\Toolbar\fb2.ico")
  "Fortran" Call("Coder::Settings", 1, "ftn") Icon("%a\AkelFiles\Plugs\Toolbar\for.ico")
  "GRUB4Dos (*.lst)" Call("Coder::Settings", 1, "lst") 
  "Hash" Call("Coder::Settings", 1, "md5")
  "HTML" Call("Coder::Settings", 1, "html") Icon("%a\AkelFiles\Plugs\Toolbar\html.ico")
  "Ini" Call("Coder::Settings", 1, "ini") Icon("%a\AkelFiles\Plugs\Toolbar\css.ico")
  "Inno" Call("Coder::Settings", 1, "iss") Icon("%a\AkelFiles\Plugs\Toolbar\iss.ico")
  "Java" Call("Coder::Settings", 1, "java") Icon("%a\AkelFiles\Plugs\Toolbar\java.ico")
  "JScript" Call("Coder::Settings", 1, "js") Icon("%a\AkelFiles\Plugs\Toolbar\js.ico")
  "Kixtart" Call("Coder::Settings", 1, "kix") Icon("%a\AkelFiles\Plugs\Toolbar\kix.ico")
  "LaTeX" Call("Coder::Settings", 1, "tex") Icon("%a\AkelFiles\Plugs\Toolbar\TeX.ico")
  "Log" Call("Coder::Settings", 1, "log")
  "LSS" Call("Coder::Settings", 1, "lss") Icon("%a\AkelFiles\Plugs\Toolbar\lss.ico")
  "Lua" Call("Coder::Settings", 1, "lua") Icon("%a\AkelFiles\Plugs\Toolbar\lua.ico")
  "MaxScript" Call("Coder::Settings", 1, "mcr") Icon("%a\AkelFiles\Plugs\Toolbar\Maxscript.ico")
  "Mnu" Call("Coder::Settings", 1, "mnu") Icon("%a\AkelFiles\Plugs\Toolbar\Mnu.ico")
  "Msg" Call("Coder::Settings", 1, "msg")
  "NNCron" Call("Coder::Settings", 1, "spf")
  "NSIS" Call("Coder::Settings", 1, "nsi") Icon("%a\AkelFiles\Plugs\Toolbar\nsi.ico")
  "Pascal" Call("Coder::Settings", 1, "dpr") Icon("%a\AkelFiles\Plugs\Toolbar\Pascal.ico")
  "Perl" Call("Coder::Settings", 1, "pl")  Icon("%a\AkelFiles\Plugs\Toolbar\Perl.ico")
  "PHP" Call("Coder::Settings", 1, "php") Icon("%a\AkelFiles\Plugs\Toolbar\PHP.ico")
  "Powershell" Call("Coder::Settings", 1, "ps1") Icon("%a\AkelFiles\Plugs\Toolbar\powershell.ico")
  "PRG" Call("Coder::Settings", 1, "prg") Icon("%a\AkelFiles\Plugs\Toolbar\prg.ico")
  "Python" Call("Coder::Settings", 1, "py")  Icon("%a\AkelFiles\Plugs\Toolbar\Python.ico")
  "Resource" Call("Coder::Settings", 1, "rc") Icon("%a\AkelFiles\Plugs\Toolbar\rc.ico")
  "RDF" Call("Coder::Settings", 1, "rdf") Icon("%a\AkelFiles\Plugs\Toolbar\rdf.ico")
  ".scl" Call("Coder::Settings", 1, "scl")
  "Sharp" Call("Coder::Settings", 1, "cs") Icon("%a\AkelFiles\Plugs\Toolbar\Sharp.ico")
  "Smarty" Call("Coder::Settings", 1, "tpl") Icon("%a\AkelFiles\Plugs\Toolbar\smarty.ico")
  "SQL" Call("Coder::Settings", 1, "sql")  Icon("%a\AkelFiles\Plugs\Toolbar\sql.ico")
  "Text" Call("Coder::Settings", 1, "txt") Icon("notepad.exe",0)
  "Unix shell" Call("Coder::Settings", 1, "sh")
  "VB / VBScript" Call("Coder::Settings", 1, "vbs") Icon("%a\AkelFiles\Plugs\Toolbar\vbs.ico")
  "XBL" Call("Coder::Settings", 1, "xbl")
  "XML / DXL" Call("Coder::Settings", 1, "xml") Icon("%a\AkelFiles\Plugs\Toolbar\xml.ico")
  "XUL" Call("Coder::Settings", 1, "xul") Icon("%a\AkelFiles\Plugs\Toolbar\xul.ico")
  SEPARATOR
 "No filetype" Call("Coder::Settings", 1, "?")
}

and then in Edit Menu:

Code: Select all

"Syntax theme" Menu("SYNTAXTHEME") Icon("%a\AkelFiles\Plugs\Coder.dll", 4)

Offline
Posts: 23
Joined: Sat Sep 13, 2014 10:35 am

Post by Azev »

I have the context menu dll plugin installed but I don't know how to configure it!

The .coder file should have an entry like:

Code: Select all

Files:
;==========
;File types
;==========
*.ahk

CoderName: <----
AutoHotkey
So new entries could be added to context menu without further work and not depend on others plugins.

Offline
Posts: 366
Joined: Mon Jan 10, 2011 5:28 pm
Contact:

Post by Lenchik »

Plugins have documentations in english *.txt files. You should read them to understand how to configure plugins to work the way you like.

Your suggestion you should put in topic with suggestions: viewtopic.php?t=829

Also, you can read manual for scripts plugin and create a script for Akelpad community, that can be autoloaded and will be modifying menus as you described.

Offline
Posts: 23
Joined: Sat Sep 13, 2014 10:35 am

Post by Azev »

Thank you!
Worked!

I'm getting familiar with AkelPad. I'm coming from Np++.
I'll get to know it better and soon I'll be contributing with some code.

I just thought of "log.coder" with the keywords:
'error', 'fail', 'update', 'new', DD/MM/YYY, HH:MM:SS, 'created', 'creating', 'exist', ...
I'll get to it.


One detail...
When loading ahk.loader it gives an error message:
"Contatin Unknown section name "CompleteList"

Code: Select all

;----------------------------------------------;
;                 AutoComplete                 ;
;----------------------------------------------;

CompleteList:
;=======================
;ListFontStyle                ListFontSize                 ListFaceName                 ListLineGap                 ListBlockIcon                 ListBlockIconMargins "left;right"    ListHlBaseIcon                 ListHlBaseIconMargins "left;right"    ListDocWordIcon                 ListDocWordIconMargins "left;right"    ListBasicTextColor                 ListBasicBkColor                 ListSelTextColor                 ListSelBkColor
;=======================
${AutoComplete_ListBlockIcon} ${AutoComplete_ListBlockIconMargins} ${AutoComplete_ListHlBaseIcon} ${AutoComplete_ListHlBaseIconMargins} ${AutoComplete_ListDocWordIcon} ${AutoComplete_ListDocWordIconMargins} ${AutoComplete_ListBasicTextColor} ${AutoComplete_ListBasicBkColor} ${AutoComplete_ListSelTextColor} ${AutoComplete_ListSelBkColor}

Offline
Posts: 366
Joined: Mon Jan 10, 2011 5:28 pm
Contact:

Post by Lenchik »

There is one log.coder that can be easily modified to work with standard coloring themes.

Latest version of Coder plugin introduced this new section.

Offline
Posts: 23
Joined: Sat Sep 13, 2014 10:35 am

Post by Azev »

Thanks once again!

I updated the plugin and now it gives me lot of error messages regarding .coder files. Even after updating all the .coder files and the plugin.

Image


I can't get anything from this thread as it is in RUS:
viewtopic.php?t=1495&postdays=0&postorder=asc&start=915

Offline
Posts: 366
Joined: Mon Jan 10, 2011 5:28 pm
Contact:

Post by Lenchik »

Use google translate and probably viewtopic.php?p=25908#p25908 will be of help in mass update of your custom theme (named "test" in case of your screenshot).

Offline
Posts: 582
Joined: Mon Apr 08, 2013 9:50 pm
Location: Win7SP1x64, APx64

Post by Drugmix »

Azev wrote:Image
Means you've created a new color scheme named "test" and didn't add some widely used in .coder files variables and values (color+font style) to them.
Or you may just switch back to a standard theme.
Azev wrote:I can't get anything from this thread as it is in RUS:
viewtopic.php?t=1495&postdays=0&postorder=asc&start=915
Feel free to ask any questions in english in that topic and in the others in .

Offline
Posts: 2
Joined: Tue Sep 23, 2014 2:29 pm

Post by zeha »

Lenchik wrote:So you need to put menu item by yourself.
I have done that by putting in ContextMenu::Showmenu of ContextMenu Plugin this:

Code: Select all

"SYNTAXTHEME"
{
  "1С" Call("Coder::Settings", 1, "1S") Icon("%a\AkelFiles\Plugs\Toolbar\1S.ico")
  "ActionScript" Call("Coder::Settings", 1, "as") Icon("%a\AkelFiles\Plugs\Toolbar\as.ico")
  "AkelPad menu" Call("Coder::Settings", 1, "akelmenu")
  "Assembler" Call("Coder::Settings", 1, "asm") Icon("%a\AkelFiles\Plugs\Toolbar\asm.ico")
  "AutoHotkey" Call("Coder::Settings", 1, "ahk")  Icon("%a\AkelFiles\Plugs\Toolbar\ahk.ico")
  "AutoIt" Call("Coder::Settings", 1, "au3") Icon("%a\AkelFiles\Plugs\Toolbar\au3.ico")
  "Avisynth" Call("Coder::Settings", 1, "avs") Icon("%a\AkelFiles\Plugs\Toolbar\avisynth.ico")
  "AWK" Call("Coder::Settings", 1, "awk") Icon("%a\AkelFiles\Plugs\Toolbar\awk.ico")
  "Bat/Cmd" Call("Coder::Settings", 1, "bat") Icon("%a\AkelFiles\Plugs\Toolbar\bat.ico")
  "BibTeX" Call("Coder::Settings", 1, "bib") Icon("%a\AkelFiles\Plugs\Toolbar\TeX.ico")
  "BBCode" Call("Coder::Settings", 1, "bbc") Icon("%a\AkelFiles\Plugs\Toolbar\BBCode.ico")
  "C++" Call("Coder::Settings", 1, "cpp") Icon("%a\AkelFiles\Plugs\Coder.dll", 4)
  "Coder Syntax" Call("Coder::Settings", 1, "coder") Icon("%a\AkelFiles\Plugs\Coder.dll", 2)
  "CSS" Call("Coder::Settings", 1, "css") Icon("%a\AkelFiles\Plugs\Toolbar\css.ico")
  "diff" Call("Coder::Settings", 1, "diff")
  "fb2" Call("Coder::Settings", 1, "fb2") Icon("%a\AkelFiles\Plugs\Toolbar\fb2.ico")
  "Fortran" Call("Coder::Settings", 1, "ftn") Icon("%a\AkelFiles\Plugs\Toolbar\for.ico")
  "GRUB4Dos (*.lst)" Call("Coder::Settings", 1, "lst") 
  "Hash" Call("Coder::Settings", 1, "md5")
  "HTML" Call("Coder::Settings", 1, "html") Icon("%a\AkelFiles\Plugs\Toolbar\html.ico")
  "Ini" Call("Coder::Settings", 1, "ini") Icon("%a\AkelFiles\Plugs\Toolbar\css.ico")
  "Inno" Call("Coder::Settings", 1, "iss") Icon("%a\AkelFiles\Plugs\Toolbar\iss.ico")
  "Java" Call("Coder::Settings", 1, "java") Icon("%a\AkelFiles\Plugs\Toolbar\java.ico")
  "JScript" Call("Coder::Settings", 1, "js") Icon("%a\AkelFiles\Plugs\Toolbar\js.ico")
  "Kixtart" Call("Coder::Settings", 1, "kix") Icon("%a\AkelFiles\Plugs\Toolbar\kix.ico")
  "LaTeX" Call("Coder::Settings", 1, "tex") Icon("%a\AkelFiles\Plugs\Toolbar\TeX.ico")
  "Log" Call("Coder::Settings", 1, "log")
  "LSS" Call("Coder::Settings", 1, "lss") Icon("%a\AkelFiles\Plugs\Toolbar\lss.ico")
  "Lua" Call("Coder::Settings", 1, "lua") Icon("%a\AkelFiles\Plugs\Toolbar\lua.ico")
  "MaxScript" Call("Coder::Settings", 1, "mcr") Icon("%a\AkelFiles\Plugs\Toolbar\Maxscript.ico")
  "Mnu" Call("Coder::Settings", 1, "mnu") Icon("%a\AkelFiles\Plugs\Toolbar\Mnu.ico")
  "Msg" Call("Coder::Settings", 1, "msg")
  "NNCron" Call("Coder::Settings", 1, "spf")
  "NSIS" Call("Coder::Settings", 1, "nsi") Icon("%a\AkelFiles\Plugs\Toolbar\nsi.ico")
  "Pascal" Call("Coder::Settings", 1, "dpr") Icon("%a\AkelFiles\Plugs\Toolbar\Pascal.ico")
  "Perl" Call("Coder::Settings", 1, "pl")  Icon("%a\AkelFiles\Plugs\Toolbar\Perl.ico")
  "PHP" Call("Coder::Settings", 1, "php") Icon("%a\AkelFiles\Plugs\Toolbar\PHP.ico")
  "Powershell" Call("Coder::Settings", 1, "ps1") Icon("%a\AkelFiles\Plugs\Toolbar\powershell.ico")
  "PRG" Call("Coder::Settings", 1, "prg") Icon("%a\AkelFiles\Plugs\Toolbar\prg.ico")
  "Python" Call("Coder::Settings", 1, "py")  Icon("%a\AkelFiles\Plugs\Toolbar\Python.ico")
  "Resource" Call("Coder::Settings", 1, "rc") Icon("%a\AkelFiles\Plugs\Toolbar\rc.ico")
  "RDF" Call("Coder::Settings", 1, "rdf") Icon("%a\AkelFiles\Plugs\Toolbar\rdf.ico")
  ".scl" Call("Coder::Settings", 1, "scl")
  "Sharp" Call("Coder::Settings", 1, "cs") Icon("%a\AkelFiles\Plugs\Toolbar\Sharp.ico")
  "Smarty" Call("Coder::Settings", 1, "tpl") Icon("%a\AkelFiles\Plugs\Toolbar\smarty.ico")
  "SQL" Call("Coder::Settings", 1, "sql")  Icon("%a\AkelFiles\Plugs\Toolbar\sql.ico")
  "Text" Call("Coder::Settings", 1, "txt") Icon("notepad.exe",0)
  "Unix shell" Call("Coder::Settings", 1, "sh")
  "VB / VBScript" Call("Coder::Settings", 1, "vbs") Icon("%a\AkelFiles\Plugs\Toolbar\vbs.ico")
  "XBL" Call("Coder::Settings", 1, "xbl")
  "XML / DXL" Call("Coder::Settings", 1, "xml") Icon("%a\AkelFiles\Plugs\Toolbar\xml.ico")
  "XUL" Call("Coder::Settings", 1, "xul") Icon("%a\AkelFiles\Plugs\Toolbar\xul.ico")
  SEPARATOR
 "No filetype" Call("Coder::Settings", 1, "?")
}

and then in

Code: Select all

"Syntax theme" Menu("SYNTAXTHEME") Icon("%a\AkelFiles\Plugs\Coder.dll", 4)


I try to reproduce that, but I cannot identify where I have to put in that - can you please explain that a little more?

ContextMenu-Eng.txt explains very well how to config, but unfortunately it doesn't say where to config that.

The part of "Edit Menu" already written in Akelmenu (right click on toolbar), but I think the upper part "ContextMenu::Showmenu" is the important, so please explain me where I can find the position where I have to put that in.

Kind regards,
zeha


PS: I have found it... for all other who searching for that:

Options -> Plug-Ins... -> ContextMenu::Main -> Call


PPS: Is it possible, that you share your syntax icons from "%a\AkelFiles\Plugs\Toolbar\*.ico"? :-)