Edgewall Software

Ticket #1520 (reopened enhancement)

Opened 4 years ago

Last modified 23 months ago

Highlight TracLinks in browser

Reported by: shad Owned by: cboos
Priority: low Milestone: 2.0
Component: wiki system Version: 0.8.1
Severity: normal Keywords: mimeview postprocessing
Cc:

Description

It would be nice to highlight TracLinks in browser file view, for example to display ticket links when viewing source:trunk/ChangeLog#latest.

Attachments

Change History

Changed 4 years ago by cboos

  • owner changed from jonas to cboos
  • status changed from new to assigned

This could be achieved by setting the svn:mime-type of the file to something like text/trac or application/x-trac...

Then, a mimeprocessor doing a wiki_to_html() could be used for rendering the file.

Changed 4 years ago by cboos

  • status changed from assigned to closed
  • resolution set to fixed

Idea above implemented in [1611]. This should be enough to correctly handle files like source:trunk/ChangeLog#latest.

Trying to detect TracLinks in all files would certainly be overkill...

However, one could add a post-processing step for enscript and/or ClearSilver highlighting, in order to look for TracLinks in the comments only. But this corresponds to a separate ticket, so I'm closing this one.

Changed 4 years ago by cmlenz

First, I don't think [1611] really addresses the request raised here. Are you expecting people to set the content type of their ChangeLog file to "text/x-trac-wiki" so that the ticket references get hyperlinked? Wouldn't that probably mess up the formatting of the change log?

Second, I don't see much value in the TracWikiRenderer personally, i.e. I don't really understand the use case. While the implementation surely is simple enough, I feel that it might be better provided by an option plugin, as opposed to part of the core functionality. But maybe you have some use cases in mind that I can't think of?

Changed 4 years ago by cboos

1. Is it really such a problem to set the mime-type on a file

in order to have it correctly highlighted? I can't see the problem here.

1. The use case is pretty simple: most of the projects contain

text documents like README, INSTALL.txt or such. Once developers are used to Trac's Wiki markup (because they are using the Trac Wiki for documentation purpose), they also tend naturally to use these conventions in other text documents. Then, while browsing those documents in Trac, it's also natural that they get formatted the expected way.

1. If that approach is not correct, how would you have addressed

this need, then?

Changed 4 years ago by cmlenz

The problem isn't setting the svn:mime-type property. The problem is that the files in question, for example README, ChangeLog or README.txt, are formatted as plain text. Treating them as if they contained Trac Wiki syntax will probably mess up the formatting. You argue that people will get used to using the Trac Wiki syntax and extend its use to the above files, which I doubt myself.

I'm not saying that I know a better solution to this request. I'm also not sure it's solvable in a "correct" way.

Changed 4 years ago by shad

I haven't tryed setting the svn:mime-type yet (simple and elegant solution), but I think cmlenz is right - we don't need full power of wiki in text-files (though it could mess the formatting of plain text file), just a link highlighting is required.

For simple plaintext files like ChangeLog there should be enough svn:mime-type property (someting like text/x-trac-links), but what about source files (c++ in my case) - sources often contain links to tickets in comments. So I think it should be configurable (through TracIni) to allow parsing of TracLinks before showing any text-like file in the repository (through Browser.py).

Changed 4 years ago by cboos

  • status changed from closed to reopened
  • severity changed from normal to enhancement
  • priority changed from normal to low
  • milestone 0.9 deleted
  • keywords mimeview postprocessing added
  • resolution fixed deleted

The text/x-trac-links idea is a good one. I also like the idea of TracLinks highlighting in C++ code comment.

There's also some material on the Mailing List on that issue:

(actually, have a look at for some prior art :) ).

Changed 3 years ago by cboos

See also #1292

Changed 2 years ago by cboos

  • milestone set to 2.0

Changed 23 months ago by cboos

  • component changed from browser to wiki

I'll find this one quicker next time I'll be looking for it ;-)

Add/Change #1520 (Highlight TracLinks in browser)

Author



Change Properties
<Author field>
Action
as reopened
as The resolution will be set. Next status will be 'closed'
to The owner will change from cboos. Next status will be 'new'
 
Note: See TracTickets for help on using tickets.