I would like to help create a syntax highlighting script for MediaWiki. I'm quick at learning new programming/scripting languages and I would really appreciate it if someone proficient in NP++ syntax highlighting would help out.
I have contributed a few enhancements to UDLs and the status bar display, fixing bugs in the process - perhaps those make it to the next release. After this, I'm considering starting to add material that would ultimatelu lead to translated versions of the wiki. While I won't translate everything at once, there is a little that can be done now.
So... I certainly am not adverse to it, but may not start implementing the lexer before a while. If anyone wishes to start the coding, I can help or join later. Oh, and see if I can implement my view on how to get macros to properly record and play back.
CChris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Firefox / Safari has a plugin called It's all Text which allows to automatically transfer the text of ny text area (like wiki editing) to an editor of your choice and back. That doesn't address the syntax highlighting though.
I wonder if the Scintilla project has such a lexer, I'd be surprised if they haven't. In that case, adding support would be easy - add the lexer, update constant lists and recompile SciLexer.dll
CChris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If an internal lexer is available, it is quite easy to add. Then, if you have the Visual Studio compiler, you can regenerate Scilexer.dll, and there you go.
Creating an external lexer is less straightforwrd perhaps, but you can have it do many related things, since it is both a plugin and a lexer.
CChris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How do I know if an "internal lexer" is available? You mean that NP++ comes prepackaged with a lot of unused Scintilla lexers, that can be used? I do not know how to "invoke" these in any case! Do you have any practical ideas that we can do?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Scintilla comes prepackaged with plenty of lexers, and Notepad++ uses most of them. Adding some more is possible, but requires adjusting Scilexer.dll source, recompiling it, and adding whatever is required in langs.xml and stylers.xml (plus all theme files). It can be done, but not in an automated way. And Scintilla does not _provide_ Mediawiki lexers. That does not mean no one ever submitted any to them.
CChris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've added a note at the scite-request Google Group, asking for help to create a syntax highlighting script for SciTE, which might be instrumental in adding support within Scintilla.. which might lead to it getting added to NP++!
Far fetched, but better start the wheels rolling, and besides, I can use SciTE for my everyday wikitext editing in place of NP++.
Let's see what is needed and reasonably achieved:
* Bold/Italic/Underline: could be rendered wysiwyg
* lists: a colouring for all list items? alternated colourings? colourings that differ according to the last nested markum (* / # / ; / :)? this is to be debated
* tags: highilght the html way
* tables: how fine grained should the marker go?
* templates: treat as autoclosing tags, with different markup
* [[Image:...]]: another autoclose tag
* Shortcuts: showing the piped part in a different way than the URL/page may be cool
Did I forget anything of substance?
CChris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Referring to my reasonably achievable "cheat sheet", I would suggest that we color:
* wiki tags [[Image:|thumb|150px]] or [[File:]] or [[Category:]] colored differently than
* links [[Page|name]] or [www.link.com name] <-- can be blue like hyperlink
* when using templates, the name=value pairs can have name colored differently from value
* raw HTML such as <div> or <table> or <references/> <--- can be red since rare
* raw HTML node attributes like <div style="display:inline">
* raw XML special chars like —
* tables can have 3 colors, (1) wiki table markup (2) header data (3) content data
* header & content data can have wikimarkup inside table cells
* sections headers, should be different, maybe a large font
* can have full wikimarkup between header open and close tags
* keywords, like __TOC__ and #REDIRECT
* wiki formatting markup like <sub> and <big> <--- can be grey since unimportant
"Cheat sheet"
I've made virtually exhaustive lists of most of the above in my txt file below, which you can use for experimenting, and please take a peek at what I've managed to achieve with NP++'s User Define Dialog, its an image. This pic will also be useful since I've chosen some colors we can start with.
How is the status of this project? I use the Firefox add-on <a href="https://addons.mozilla.org/en-US/firefox/addon/4125/">It's all text</a> for lengthy edits of MediaWiki markup with Notepad++ so syntax highlighting would be a big help. I'd like to help with this project.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here's a first stab at syntax highlighting for MediaWiki markup. It proves more difficult than I thought as MediaWiki often uses pairwise delimiters which is not supported very well by Notepad++, e.g. it allows only single characters as boundaries not double square brackets.
The day UDL support improves like asked many times and implemented in patches by myself and loreia2, then there will be clear progress, though I think an external lexer will be more adequate, due to the peculiar nature of this markup.
CChris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
An external lexer is a plugin which Scintilla can use to syntax highlight a document - modules that perform such a task are called "lexers" in Sintilla parlance.
This has the flexibility of a plugin (it could have menu commands to tweak settings on the fly etc), and requires the development work of a plugin, which is of course more than an xml configuration file. But you gain total control over styling and folding.
CChris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to help create a syntax highlighting script for MediaWiki. I'm quick at learning new programming/scripting languages and I would really appreciate it if someone proficient in NP++ syntax highlighting would help out.
I'm sure many people would prefer NP++ as a MediaWiki wikitext editor. I would. In comparison to the other rubbish text editors, NP++ stands out as the preferred option. -- http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#How_to_set_up_specific_editors_for_Wikipedia_editing
The basic syntax that must be supported -- http://en.wikipedia.org/wiki/Wikipedia:Cheatsheet
Other advanced syntax such as "template" syntax, can be developed later.
To be honest, not at the moment.
I have contributed a few enhancements to UDLs and the status bar display, fixing bugs in the process - perhaps those make it to the next release. After this, I'm considering starting to add material that would ultimatelu lead to translated versions of the wiki. While I won't translate everything at once, there is a little that can be done now.
So... I certainly am not adverse to it, but may not start implementing the lexer before a while. If anyone wishes to start the coding, I can help or join later. Oh, and see if I can implement my view on how to get macros to properly record and play back.
CChris
I've filed a request at the IdeaTorrent -- https://sourceforge.net/apps/ideatorrent/notepad-plus/ideatorrent/idea/65/
Firefox / Safari has a plugin called It's all Text which allows to automatically transfer the text of ny text area (like wiki editing) to an editor of your choice and back. That doesn't address the syntax highlighting though.
I wonder if the Scintilla project has such a lexer, I'd be surprised if they haven't. In that case, adding support would be easy - add the lexer, update constant lists and recompile SciLexer.dll
CChris
I don't understand what to do. Is it easy for me, or for the authors of NP++ to add the lexer?
I've added a small bit of support for MediaWiki using the UDL support, but there are problems. I need a better external lexer.
If an internal lexer is available, it is quite easy to add. Then, if you have the Visual Studio compiler, you can regenerate Scilexer.dll, and there you go.
Creating an external lexer is less straightforwrd perhaps, but you can have it do many related things, since it is both a plugin and a lexer.
CChris
This is a question for the Scintilla team:
http://groups.google.com/group/scintilla-interest
How do I know if an "internal lexer" is available? You mean that NP++ comes prepackaged with a lot of unused Scintilla lexers, that can be used? I do not know how to "invoke" these in any case! Do you have any practical ideas that we can do?
Scintilla comes prepackaged with plenty of lexers, and Notepad++ uses most of them. Adding some more is possible, but requires adjusting Scilexer.dll source, recompiling it, and adding whatever is required in langs.xml and stylers.xml (plus all theme files). It can be done, but not in an automated way. And Scintilla does not _provide_ Mediawiki lexers. That does not mean no one ever submitted any to them.
CChris
I've added a note at the scite-request Google Group, asking for help to create a syntax highlighting script for SciTE, which might be instrumental in adding support within Scintilla.. which might lead to it getting added to NP++!
Far fetched, but better start the wheels rolling, and besides, I can use SciTE for my everyday wikitext editing in place of NP++.
http://groups.google.com/group/scite-interest/browse_thread/thread/1424f3000255ff82#
Let's see what is needed and reasonably achieved:
* Bold/Italic/Underline: could be rendered wysiwyg
* lists: a colouring for all list items? alternated colourings? colourings that differ according to the last nested markum (* / # / ; / :)? this is to be debated
* tags: highilght the html way
* tables: how fine grained should the marker go?
* templates: treat as autoclosing tags, with different markup
* [[Image:...]]: another autoclose tag
* Shortcuts: showing the piped part in a different way than the URL/page may be cool
Did I forget anything of substance?
CChris
Referring to my reasonably achievable "cheat sheet", I would suggest that we color:
* wiki tags [[Image:|thumb|150px]] or [[File:]] or [[Category:]] colored differently than
* links [[Page|name]] or [www.link.com name] <-- can be blue like hyperlink
* when using templates, the name=value pairs can have name colored differently from value
* raw HTML such as <div> or <table> or <references/> <--- can be red since rare
* raw HTML node attributes like <div style="display:inline">
* raw XML special chars like —
* tables can have 3 colors, (1) wiki table markup (2) header data (3) content data
* header & content data can have wikimarkup inside table cells
* sections headers, should be different, maybe a large font
* can have full wikimarkup between header open and close tags
* keywords, like __TOC__ and #REDIRECT
* wiki formatting markup like <sub> and <big> <--- can be grey since unimportant
"Cheat sheet"
I've made virtually exhaustive lists of most of the above in my txt file below, which you can use for experimenting, and please take a peek at what I've managed to achieve with NP++'s User Define Dialog, its an image. This pic will also be useful since I've chosen some colors we can start with.
raw text - http://www.mediafire.com/file/twimkzi45nt/basic
colored pic - http://www.mediafire.com/?wuowmziqzym
Hope my information helps out, in whatever you're endeavoring!
Best regards, Jeremy.
@Cchris, Are you doing anything about this?
> colored pic - http://www.mediafire.com/?wuowmziqzym
The link's dead. Is there any interest in this plugin?
Combined to the It's All Text Firefox plugin, it would certainly help. I haven't had a chance to work on this - something about full plates, you know…
CChris
Is there any progress with MediaWiki highlighting scheme?
Not that I know.
CChris
How is the status of this project? I use the Firefox add-on <a href="https://addons.mozilla.org/en-US/firefox/addon/4125/">It's all text</a> for lengthy edits of MediaWiki markup with Notepad++ so syntax highlighting would be a big help. I'd like to help with this project.
Here's a first stab at syntax highlighting for MediaWiki markup. It proves more difficult than I thought as MediaWiki often uses pairwise delimiters which is not supported very well by Notepad++, e.g. it allows only single characters as boundaries not double square brackets.
http://www.nakohdo.de/downloads/userDefineLang_MediaWiki.xml
Hello?
Is there any progress on this? Or will Notepad++ never have Mediawiki Syntax Highlighting?
The day UDL support improves like asked many times and implemented in patches by myself and loreia2, then there will be clear progress, though I think an external lexer will be more adequate, due to the peculiar nature of this markup.
CChris
Any update on progress for this?
cchris - when you say "external lexer" what do you mean?
I guess you can't edit posts… Has anyone worked on an external lexer for MediaWiki support?
An external lexer is a plugin which Scintilla can use to syntax highlight a document - modules that perform such a task are called "lexers" in Sintilla parlance.
This has the flexibility of a plugin (it could have menu commands to tweak settings on the fly etc), and requires the development work of a plugin, which is of course more than an xml configuration file. But you gain total control over styling and folding.
CChris
*UPDATE* I've found the existing UDL files are suitable for my MediaWiki editing needs. Check it:
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files