zackz Posted January 3, 2012 Share Posted January 3, 2012 I think maybe should post this topic to "Developer Chat", but I can't... :-(Recently I put my script on github. But github not show au3 file with syntax highlighting, just raw text no color - https://github.com/zackz/PuTTYAssist/blob/master/PuTTYAssist.au3After some digging I found:* github use pygments for syntax highlighting, and github will support au3 if pygments support it, http://help.github.com/common-issues-and-questions/* dozens of autoit project are already on github, they need syntax highlighting, https://github.com/search?langOverride=...it&repo=&start_value=1&type=Re* pygments 1.4 (released Jan 03, 2011) starts support Autohotkey, so ahk file in github has syntax highlighting, https://bitbucket.org/birkenfeld/pygments-main/src/81d98983fd7f/CHANGESDon't know whether autoit team are working on or considering about pygments. Hope github support au3 highlighting soon..If there is a problem with github/pygments or python about highlighting, please let me know, maybe I can help Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 3, 2012 Moderators Share Posted January 3, 2012 zackz,"Ask and you shall receive".... M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
zackz Posted January 3, 2012 Author Share Posted January 3, 2012 Thanks Melba23 Again, if anything I can help, please let me know. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 3, 2012 Moderators Share Posted January 3, 2012 zackz,Just to be sure you understand, I was only referring to moving the thread into this forum. I am not doing anything about "pygments" - I do not even know what they are (and please do not bother to explain ).M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Mat Posted January 3, 2012 Share Posted January 3, 2012 Just to be sure you understand, I was only referring to moving the thread into this forum. I am not doing anything about "pygments" - I do not even know what they are (and please do not bother to explain ). It's similar to geshi but with python, and even more languages supported. I'm sure it's not a big deal to write a lexer, they seem to have a good framework for it there, but I don't know how to get it up to the same standard as the geshi we use (with internal and UDF functions highlighted differently and linked, some preprocessors handled differently like #include, and even send special strings highlighted (or is that just SciTE)). @OP, AutoIt would be fairly simple to implement... Provided you are not too fussy about getting it up to the forums standard. (see above) Variable: "$w+" Macro: "@w+" Keyword/function "[_A-z]w+" Number: "d+(.d+)?(e(+|-)?d+)" HexNumber: "0[xX][[:xdigit:]]+" Comment: ";[^n]*" Preprocessor: "#[^n]*" DoubleString: ""/*?"" (note this should work because even if you double up the quotes it will look the same ) SingleString: "'.*?'" Probably a few more as well, but AutoIt is fairly simple for the basic lexemes as you know the token by the first character usually. Above regexes are for AutoIt. No idea what engine python uses. Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
zackz Posted January 4, 2012 Author Share Posted January 4, 2012 Just to be sure you understand, I was only referring to moving the thread into this forum. I am not doing anything about "pygments" - I do not even know what they are (and please do not bother to explain ).It's good thing you guys start talking about it. Here is some lexers in pygments for reference* DiffLexer - a "Hello world"ish lexer in pygments documents* JavaLexer - quite simple one relative to Java's reputation* CLexer - slightly bigger than JavaLexer but not so big as DelphiLexer@Mat, it's make a basic lexer with regexs you listed, which totally fine with me.About functions highlighted differently, I can't find different token about function in docs, just "Name.Function". Maybe should use "Name.Builtin" for internal functions.And it seems to need to write a new "Formatter" for feature "linked functions". Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now