preload

Blog maintenance ahead – source code formatting

Posted by Albert Gareev on Dec 04, 2009 | Categories: MessagesMy blog

Blog maintenance ahead – source code formatting

Thanks for the new plugin implemented in Alex Gorbatchev’s SyntaxHighlighter project.

The all pages containing code examples will be updated.

New Look

The example below is taken from my Text File Compare sample solution.


Set FSO = CreateObject("Scripting.FileSystemObject")
boolRC = FSO.FileExists(sFile1)
If Not boolRC Then
    TextFileCompare = ""
    Set FSO = Nothing
    Exit Function
End If

New Convenience

  • Code lines – easier to scan through, each line of code easier to read
  • Line numbering – easier to refer to each line while explaining; additionally, you may define the start number
  • Line highlighting
  • Syntax highlighting – supports over 20 languages
  • Toolbar – appears on right-top when you hover over the code block (view plane source / copy to clipboard / etc)
  • Collapsible – large blocks of code could be collapsed into a single line in default view
  • Auto-indent – if your text editor formatted text with spaces, formatting will be retained

References

WordPress Support – Posting Source Code


  • One response to "Blog maintenance ahead – source code formatting"

  • Steven Rossi
    5th December 2009 at 15:39

    I’m a big fan of SyntaxHighlighter. It does the job well. Didn’t realize WordPress.com had incorporated it…that’s pretty cool.

Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported
This work by Albert Gareev is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.