Opened 5 years ago

Last modified 3 years ago

#9235 assigned enhancement

Allow the line numbers to be specified using TracLinks syntax

Reported by: rjollos Owned by: rjollos
Priority: normal Component: CodeExampleMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11


Matching a regex is pretty error prone and there are several characters that prevent a match from occurring, probably because they are not property escaped in the CodeExampleMacro code (e.g. //, but these errors should be the subject of a different ticket).

For this ticket, I'm requesting the ability to skip the regex and just provide a start index and number of lines, using TracLinks#source:links syntax.

The syntax would be, e.g.: path=/path/to/file.cpp@1678:10-20, to show lines 10-20 of file.cpp at revision 1678. Alternatively, it could look like path=/path/to/file.cpp@1678#L10 or path=/path/to/file.cpp@1678#L10-20, since there is not necessarily an obvious relationship between TracLinks syntax and that which would be used by this macro. Using the syntax in one of the latter examples would also leave open the possibility of using the :10-20 syntax for highlighting a section of code within the code block displayed by this macro.

Attachments (0)

Change History (1)

comment:1 Changed 3 years ago by rjollos

  • Owner changed from nuald to rjollos
  • Status changed from new to assigned

Add Comment

Modify Ticket

as assigned The owner will remain rjollos.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.