MediaWiki markup syntax highlighting

MediaWiki markup syntax highlighting

3
NewbieNewbie
3

    May 23, 2008#1

    Editing on UltraEdit, for use on MediaWiki, it is unformatted text, but can contain the following elements helpful for highlighting:

    [[PAGENAME]] or [[PAGENAME|narrative]]
    [http://url] or [http://url narrative]
    <~A-Z>http://url
    <~A-Z>WP:SHORTCUT<~A-Z>
    <~A-Z>WT:SHORTCUT<~A-Z>

    The complete list of highlighting. It is great difficulty to write a simple syntax highlighting file that'll highlight this.

    The minimum to be useful:

    [...] ([..] and anything inside it) and
    http://... (http:// and ending with any WHITESPACE. , ; [ ] )

    Would love if this can be helped!

    Can someone help what a basic syntax file to handle some of these, would look like? I'm getting completely headache after the time trying to work it properly. I am sorry to ask, but it's small, I think, and I find it still unable to work out.

    Until a better one arrives, I use this. Please improve?

    Code: Select all

    /L20"MediaWiki"
    /Delimiters = !"^&* ()	-_+=.,;:'@#~[]{}?/\|
    /Marker Characters = "[]{}"
    /C1"Keywords"
    WP
    /C2"delimited text square"
    []
    /C3"delimited text curly"
    {}
    /C4"urls"
    http
    ftp
    mailto
    /C5"url ends"
    com
    org
    net
    pdf
    htm
    html
    php
    php3
    phtml
    /C6"Separators"
    [
    ]
    {
    }
    I color /C1 = BLUE, /C2 = BLUE, /C3 = BLUE, /C4 = LIGHT BLUE + UNDERLINE, /C5= LIGHT BLUE, /C6 = BLUE

    Thank you!

    6,675585
    Grand MasterGrand Master
    6,675585

      May 25, 2008#2

      Without knowing anything about MediaWiki and it's syntax what about following syntax highlighting definition:

      /L20"Mediawiki" Nocase DisableMLS Block Comment On = [ Block Comment Off = ] NestBlockComments File Extensions = TXT
      /Delimiters = , ;tab<>[]{}
      /Marker Characters = "<>{}"
      /C1"Delimited text {}"
      {}
      /C2"Delimited text <>"
      <>
      /C4
      ** ftp http mailto

      Note: tab must be replaced after copying it into your wordfile by a real horizontal tab (key TAB).
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        May 27, 2008#3

        Following discussion with one of the guys at IDM, we now have a reasonable first stab at MediaWiki syntax marking:

        Code: Select all

        /L14"MediaWiki" String Chars = ¦ Line Comment = 
        /Delimiters = .:;/\? '"	!%&^*()-`
        /Marker Characters = "[]{}=="
        /C1"Keywords"
        WP
        /C2"delimited text square"
        []
        /C3"delimited text curly"
        {}
        /C4"headers"
        ==
        /C5"urls"
        http
        ftp
        mailto
        /C6"url ends"
        com
        org
        net
        pdf
        htm
        html
        php
        php3
        phtml
        /C7"Separators"
        [
        ] ]]
        {
        }
        
        The boldening of =..= is dodgy, since MediaWiki can contain lines with 2 or 3 or more of these in a row, whereas syntax marking expects a clear "one size fits all". But mostly, this seems to work. A problem that needed some attention was the string handling, there is an "unusual character" used to delimit strings, which was used to fix this.