Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Notepad++ Syntax Highlighting (here's my format)

edited April 2015 in Help! with 2.0
I was looking through and I saw some formats for Twine 1 and the sugar-thing, but nothing came up for Twine 2 Harlowe.  Sooo... since my brain was starting to cry trying to figure out where I was and wasn't closing things, and trying to read things in black-and-white..  Here you go.

It isn't great, this is my first time trying to make a user-defined-language for Notepad++ (and obviously I'm a newbie so I'm sure I'm missing a lot of Harlowe's capabilities, but its a start.  If I tweak it over time I'll upload more versions, and if you have something better feel free to share it here.  :)

[EDIT] I added a bit more functionality to it / supports a bit more syntax highlighting.  Not everything, and focused on the scripting side instead of the string formatting side.. if you want to play with your own version I've also included a sample file with most of the markups from Harlowe's site, so you can see how it currently behaves.  Enjoy :)

Comments

  • edited September 2016
    Very appreciated. Just trying to find the best style / color scheme now, with small adjustments (I've moved 1st, 2nd etc to a new group, so as math signals).
  • My format. Copy and paste in AppData/Roaming/Notepad++/userDefineLang.xml:
    <NotepadPlus>
        <UserLang name="Harlowe 1.0" ext="twine" udlVersion="2.1">
            <Settings>
                <Global caseIgnored="no" allowFoldOfComments="yes" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
                <Prefix Keywords1="no" Keywords2="yes" Keywords3="yes" Keywords4="yes" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
            </Settings>
            <KeywordLists>
                <Keywords name="Comments">00&lt;!-- 01 02--&gt; 03 04</Keywords>
                <Keywords name="Numbers, prefix1"></Keywords>
                <Keywords name="Numbers, prefix2"></Keywords>
                <Keywords name="Numbers, extras1"></Keywords>
                <Keywords name="Numbers, extras2"></Keywords>
                <Keywords name="Numbers, suffix1"></Keywords>
                <Keywords name="Numbers, suffix2"></Keywords>
                <Keywords name="Numbers, range"></Keywords>
                <Keywords name="Operators1"></Keywords>
                <Keywords name="Operators2"></Keywords>
                <Keywords name="Folders in code1, open"></Keywords>
                <Keywords name="Folders in code1, middle"></Keywords>
                <Keywords name="Folders in code1, close"></Keywords>
                <Keywords name="Folders in code2, open"></Keywords>
                <Keywords name="Folders in code2, middle"></Keywords>
                <Keywords name="Folders in code2, close"></Keywords>
                <Keywords name="Folders in comment, open"></Keywords>
                <Keywords name="Folders in comment, middle"></Keywords>
                <Keywords name="Folders in comment, close"></Keywords>
                <Keywords name="Keywords1">true false</Keywords>
                <Keywords name="Keywords2">$</Keywords>
                <Keywords name="Keywords3">(mouseover (mouseout (link (hook (replace (append (prepend (live (stop (openURL (gotoURL (goto (click</Keywords>
                <Keywords name="Keywords4">(text (font (background (transition (t8n (display (colour:</Keywords>
                <Keywords name="Keywords5">floor ceil round min max abs sign sin cos tan is not to into it time</Keywords>
                <Keywords name="Keywords6"></Keywords>
                <Keywords name="Keywords7"></Keywords>
                <Keywords name="Keywords8"></Keywords>
                <Keywords name="Delimiters">00(if: 00(elseif: 00(else: 00(either: 00(random: 00(history: 00(dataset: 00(datamap: 00(substring: 00(subarray: 00(array: 00(a: 00(count: 01chooses 01stuff 02) 02) 02) 02) 02) 02) 02) 02) 02) 02) 02) 02) 02) 03[ 04contain 04blocks 04of 04text 05] 06{ 07escape 07whitespaces 08} 09&quot; 10varType 10strings 11&quot; 12(set: 12(put: 12(move: 12(alert: 12(prompt: 12(print: 12(confirm: 13perform 13actions 14) 14) 14) 14) 14) 14) 14) 15 16 17 18 19 20 21&lt;div 21&lt;small 21&lt;span 21&lt;table 21&lt;p 21&lt;i 22 23/div&gt; 23/small&gt; 23/span&gt; 23/table&gt; 23/p&gt; 23/i&gt;</Keywords>
            </KeywordLists>
            <Styles>
                <WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="COMMENTS" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="LINE COMMENTS" fgColor="FF8040" bgColor="FFFFFF" fontName="Consolas" fontStyle="2" fontSize="11" nesting="0" />
                <WordsStyle name="NUMBERS" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="KEYWORDS1" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="KEYWORDS2" fgColor="FF0000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="KEYWORDS3" fgColor="008000" bgColor="FFFFFF" fontName="Source Code Pro" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="KEYWORDS4" fgColor="008000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="KEYWORDS5" fgColor="008000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="KEYWORDS8" fgColor="0000FF" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="OPERATORS" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="DELIMITERS1" fgColor="008000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="117702655" />
                <WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="117702655" />
                <WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="117702655" />
                <WordsStyle name="DELIMITERS4" fgColor="0000FF" bgColor="FFFFFF" fontName="Consolas" fontStyle="2" fontSize="11" nesting="0" />
                <WordsStyle name="DELIMITERS5" fgColor="008000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="117702655" />
                <WordsStyle name="DELIMITERS6" fgColor="0000FF" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="117702655" />
                <WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="0" />
                <WordsStyle name="DELIMITERS8" fgColor="0000FF" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="11" nesting="117702655" />
            </Styles>
        </UserLang>
    </NotepadPlus>
    
Sign In or Register to comment.