Prints code listings with line numbers

Notice: The functionality of this plugin has been added to Trac in release 1.2. See trac:#10834.


This macro produces colored code listings with line numbers.

Bugs/Feature Requests

Existing bugs and feature requests for LinenoMacro are here.

If you have any issues, create a new ticket.


Download the zipped source from here.


You can check out LinenoMacro from here using Subversion, or browse the source with Trac.


Simple java listing with included Lineno macro:

class A {
  public static void main(String[] args) {



To install:

sudo easy_install <dir with macro sources>

To enable:

lineno.linenomacro.* = enabled

Recent Changes

16197 by rjollos on 2017-01-21 23:01:56
1.2: Set Trac version requirement
11954 by rjollos on 2012-09-07 23:22:19
Refs #10292: (1.2dev) Modified generation of anchor ids to ensure that the id associated with each line number will be unique for the resource. The ids are of the form a\d-L\d (e.g. a1-L1).
11945 by rjollos on 2012-09-07 01:46:02
Follow-on to [11944]. Modified match for compatibility with Trac 0.11 and Trac 0.12+, which was necessary after the change to use WikiProcessor._processor_re, which differs between Trac versions.


Author: adamansky
Maintainer: none (deprecated)

Last modified 7 years ago Last modified on May 14, 2017, 6:09:11 PM

Attachments (1)

Download all attachments as: .zip