Tweets

söndag 23 oktober 2011

Using syntax highlighting for AutoHotKey in Blogger

  1. In Blogger, go to the Design tab and then Edit HTML.
  2. Click the link Download Full Template to backup your current Blogger template.
  3. Edit the template by adding the code before </head>. The following is the minimum you need to be able to have syntax highlighting for your AutoHotKey code:<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCoreDefault.css' rel='stylesheet' type='text/css'/><script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script><script src='http://www.undermyhat.org/blog/wp-content/uploads/2009/09/shBrushAhk.js' type='text/javascript'></script><script language='javascript' type='text/javascript'>SyntaxHighlighter.all();</script>
  4. To be sure you didn't break your nice template, preview it before saving it.
  5. Create a new post and chose to edith the HTML. Start with <pre class="brush: ahk;">
  6. Write/paste your AHK code
  7. Close it all with </pre>

And the result:
; Oh my!
IfWinExist Untitled - Notepad
{
    WinActivate
}
else
{
    Run Notepad
    WinWait Untitled - Notepad
    WinActivate
}

Inga kommentarer:

Skicka en kommentar