CodeExample plugin for Trac version 1.0 has been released

The CodeExample renders a code example box that supports syntax highlighting. It support three types of examples: simple, correct, and incorrect.

I've made the major changes to the plugin and now it is fully compatible with Trac 0.11 and Trac 0.12.

Changelog from version 0.3:

  • Support for multiply repositories (Trac 0.12 and upper) has been added.
  • Collapsing/expanding code blocks have been implemented.
  • Ability to change title has been added.
  • Options using has been reimplemented.

Two examples (the first gets source from repository, the second contains the code inside):

## type = good
## title = GPGData sample code
## repo = MacGPGME
## path=GPGData.m
## regex="static void releaseCallback\(.*"
## lines=4

## type = bad
fibs = 0 : 1 : [ a + b | a <- fibs | b <- tail fibs ]

These will be rendered as:

See details on trac-hacks CodeExampleMacro page.


Popular posts from this blog

DIY: Business cards in LaTeX

Python vs JS vs PHP for embedded systems

Web application framework comparison by memory consumption