Scheme

Discussion Forums discussion Scheme

This topic contains 0 voices and has 12 replies.

Viewing 13 posts - 1 through 13 (of 13 total)
Author Posts
Author Posts
June 7, 2008 at 2:57 am #425

Bill
Member

All right, how do I create a new scheme?

I realize this is a general question, but I can’t for the life of me get a new scheme to display in the scheme dropdown in PN.

I’ve created a .scheme file, and a .schemedef file, and put it in the scheme folder. Nothing in the dropdown.

I’ve played with the ctags, but I’m thinking this is not what I’m looking for.

So, basically, how do I create a new scheme? What makes the scheme appear in the dropdowns???????

Oh, and kudos on this editor, I just stumbled upon it and from what I’ve seen so far, very nice.

– Bill

June 9, 2008 at 9:51 pm #15934

simon
Key Master

For a full user-defined language a .schemedef file is definitely what you’re looking for, perhaps you could paste the contents of the file you tried in here and I’ll have a look?

Simon.

June 11, 2008 at 7:10 pm #15935

Bill
Member

I just realized my mistake, I didn’t modify the .schemedef file at all, I just copied it from an existing one. I was assuming that PN would use the filename as the scheme name, but now I know better.

Thanks!

May 3, 2010 at 10:27 am #15936

rc-flitzer
Member

Hello!

I’m having trouble creating a very simple custom scheme file. I found the HowTo (http://pnotepad.org/docs/howto/add_support_for_your_language), but that is not a How To. It is just a description of the used XML scheme. I still don’t know, _what_ file to edit, _what_ neccassary and optional tags I have and _where_ to put those files to have it listed in scheme menu.

Simon, could you please create an example and a description that allows me to understand how it’s done? I’m quite experienced at programming but this … this is just try and error, and nowhere is explained, what the difference betweeen .scheme, .schemedef and .cscheme is (and why are they spread in two directories?), whether I need a lexer (and how to write it myself) or what PN is able to do on its own without any special lexer.

I discovered the powershell.schemedef sample, but there’s no explanation what it can do, where I have to put it to test the example etc. And there is already a powershell.scheme, so I really can’t reproduce / test the example.

I just want to create a scheme for RELAX NG (compact syntax), which is similiar to CSS. It has just five keywords and uses {()} for braces / indentation. Is it really a problem to create something that easy? In UltraEdit I just add the keywords to a text file, and voilà. They’re highlighted. I don’t want anything more than a colourful highlighting, but it seems that it is waaaay too complicated in PN. At least without a hint of a tutorial.

May 3, 2010 at 10:57 am #15937

rc-flitzer
Member

Ok, I created a .schemedef file, also used your Prolog .schemedef as an example. Then I put these files into schemes folder. Result: I have an option to assign RelaxNG (or Prolog) to a file extension, but it has no effect. The scheme is listed there but I can’t select it.

Then the scheme is NOT listed in View → Change scheme. So … please please please let me know how to extend PNotepad with additional schemes!

May 4, 2010 at 1:03 pm #15938

simon
Key Master

If for some reason the scheme isn’t showing up in the scheme change dialogs please try the following and let me know if it works:

1. Go to Tools | Options | Fonts and Colours

2. Press OK

3. Reload PN

This should cause a rebuild of the schemes. If this still doesn’t work, please send me the .schemedef file and I’ll have a look. A contributor is working on improving the custom lexer at the moment, and I’m also planning to improve this feature after the current text clip changes are completely finished. I’d like to make it ultra-simple (probably with a UI) to create your own language.

May 9, 2010 at 4:30 pm #15939

rc-flitzer
Member

Thank you, that works. But it’s not obvious to enter the fonts&colours setting to have a .schemedef activated. Also the scheme won’t disappear by simply deleting the .schemedef file. You have to delete the automatically created .cscheme in PN2 setting directory.

May I assume that a .scheme file is only useful either for the prebuilt languages or if you create you own lexer, respectively? And a .schemedef file always uses the custom lexer? If that is true, please state this in the tutorial because it isn’t described and is also not obvious.

You don’t have to make it “ultra” simple. You just have to explain properly what is to be done, and with working examples to reproduce and learn. But speaking of “ultra”, the UltraEdit way is quite simple and sufficient for all languages I ever needed. It has support for keyword groups, reseverd word, paranthesis, comment style, file extensions. All in a simple text file (used also by any other built-in language) which is used directly after reloading UE. I think that’s much more practical than writing XML files manually.

All UE wordfiles can be found here: http://www.ultraedit.com/downloads/extras.html#wordfiles

There are a lot of languages, I think because it’s so simple to create a simple word highlighting file which is what makes editing a lot easier.

May 9, 2010 at 4:37 pm #15940

rc-flitzer
Member

Hm, no.

The scheme Relax NG is listed in “change scheme” but the keywords are not highlighted. I uploaded my .schemedef file. Maybe you can tell me what’s wrong?

http://anyhub.net/file/relaxngc.schemedef

May 10, 2010 at 8:44 am #15941

simon
Key Master

But it’s not obvious to enter the fonts&colours setting to have a .schemedef activated.

Agreed, this was a bug which should be fixed for the next release.

I’ll take a look at your schemedef and get back to you.

May 11, 2010 at 3:31 pm #15942

patrick4kin
Member

Hallo!

I am a writer and not a programmer. I write in English and translate into German.

To markup text I will translate, is scheme what I should use in PyPN?

If it is, where are the best links to get started?

Where is the best documentation, on PyPN?

Are there any scripts, that members know of, which could be of use to me in learning?

Regards and thanks?

May 11, 2010 at 5:33 pm #15943

simon
Key Master

Hi Patrick,

Schemes are for syntax highlighting rather than scripting, PyPN is the right topic for scripting. You would need to explain more exactly what you’re looking to do for us to help in finding scripts (like your other questions).

You can find some sample scripts here: http://scriptshare.rocketmonkeys.com/

Thanks.

May 12, 2010 at 8:38 am #15944

simon
Key Master

@rc-flitzer: Your schemedef is almost right, only one change needed:

<lexer name="relaxngc" />

The lexer name should be the same as the schemedef name.

May 13, 2010 at 3:32 pm #15945

rc-flitzer
Member

Thank you that’s working properly. :-)

Is there a possibility to highlight different keyword lists in different colours? I can’t get it yet. (Also here a hint that this is quite easy using the UltraEdit wordfiles as described above.)

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.