Opened 20 years ago
Last modified 9 years ago
#1520 new enhancement
Highlight TracLinks in browser
Reported by: | shad | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | next-major-releases |
Component: | wiki system | Version: | 0.8.1 |
Severity: | normal | Keywords: | mimeview postprocessing pygments comment |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
It would be nice to highlight TracLinks in browser file view.
For example to display ticket links when viewing source:trunk/ChangeLog@latest.
This is already possible by specifying text/x-trac-wiki as the mimetype for this kind of files
Another example would be to wiki format the inline Wiki syntax present in comments (this needs some cooperation from the syntax highlighter, e.g. the Pygments renderer).
Attachments (0)
Change History (13)
comment:1 by , 20 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 20 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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.
comment:3 by , 20 years ago
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?
comment:4 by , 20 years ago
- 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.
- 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.
- If that approach is not correct, how would you have addressed this need, then?
comment:5 by , 20 years ago
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.
comment:6 by , 19 years ago
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).
comment:7 by , 19 years ago
Keywords: | mimeview postprocessing added |
---|---|
Milestone: | 0.9 |
Priority: | normal → low |
Resolution: | fixed |
Severity: | normal → enhancement |
Status: | closed → reopened |
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:
- Wiki links to code? (start of the thread)
- my reply
(actually, have a look at for some prior art :) ).
comment:9 by , 18 years ago
Milestone: | → 2.0 |
---|
comment:10 by , 18 years ago
Component: | browser → wiki |
---|
I'll find this one quicker next time I'll be looking for it ;-)
comment:12 by , 14 years ago
Description: | modified (diff) |
---|---|
Keywords: | pygments comment added |
Milestone: | triaging → next-major-0.1X |
Priority: | low → normal |
See also #2523.
comment:13 by , 9 years ago
Owner: | removed |
---|---|
Status: | reopened → new |
This could be achieved by setting the
svn:mime-type
of the file to something liketext/trac
orapplication/x-trac
…Then, a mimeprocessor doing a
wiki_to_html()
could be used for rendering the file.