Opened 12 years ago

Closed 8 years ago

[PATCH] TracLink for the PasteBin component

Reported by: Owned by: lars+trac-hacks.org@… Ryan J Ollos low TracPastePlugin normal Justin Rovang, David Fraser, Jan Beilicke, lkraav, Olemis Lang 0.11

Description

It would be great if one could easily link to pastes via TracLinks, e.g.

[paste:213 See this Paste]


comment:1 Changed 12 years ago by lars+trac-hacks.org@…

Ieek. Wanted a preview and sent it... Pastebin is really useful sometimes. Thanks!

comment:2 Changed 12 years ago by Ryan J Ollos

Summary: Integration with TracLink would be nice. → TracLink for the PasteBin component

A TracLink for the TracPastePlugin would definitely make it a more integrated and useful part of Trac. I'll have to look into it ... shouldn't be too hard right?

comment:3 Changed 12 years ago by jsalaz@…

I don't see any other manner of voting for features, so pardon this comment if it's undue. I would absolutely love to see wiki-style links to the pastebin. It's better than forgetting that your external visitors can't access TRAC resources via an internal link.

Is there an easy way to achieve this in the meantime before the plugin is updated?

comment:4 Changed 12 years ago by rovangju

Cc: Justin Rovang added; anonymous removed

I'd like to see this very much too - as well as a way to get the list of recent pastes and move it to another page to increase visibility - kinda like a TOC index.

comment:5 follow-up:  12 Changed 11 years ago by anonymous

Referencing pastes by some [paste:N] syntax would be great, as would some sort of [[RecentPastes(N)]] macro to display a list elsewhere.

comment:6 Changed 11 years ago by Pontus Enmark

Attached a patch which adds support for pastebin:123 wiki links

comment:8 Changed 11 years ago by David Fraser

Summary: TracLink for the PasteBin component → [PATCH] TracLink for the PasteBin component

Tested and this works nicely with penmark's patch.

comment:9 Changed 11 years ago by Ryan J Ollos

Adding TracLinks may cause issues if #4265 is not fixed, and if #5695 is implemented. In those cases we may end up with links pointing to the wrong pastes and dangling links.

comment:11 Changed 9 years ago by Ryan J Ollos

The patch look good, but I think the content of get_wiki_syntax is redundant with the implementation of get_link_resolvers. Someone please correct me if I'm wrong about that.

get_link_resolvers allows a TracLink of the form realm:id to be implemented. get_wiki_syntax only needs to return a non-empty list if you wish to implement another syntax, as is done for ticket links in the Trac core with #N. So, for instance, if we wanted a syntax such as @N to point to pastes, we'd have to implement get_wiki_syntax, but I can't think of a use for adding wiki syntax in this plugin.

comment:12 in reply to:  5 Changed 9 years ago by Ryan J Ollos

Owner: changed from Michael Renzmann to Ryan J Ollos new → assigned

... as would some sort of [[RecentPastes(N)]] macro to display a list elsewhere.

=> #10121

comment:13 Changed 9 years ago by Ryan J Ollos

(In [11689]) Refs #5773:

• Added a paste TracLink. Thanks to penmark for the initial patch.
• Added framework for unit tests, following osimons implementation for the TagsPlugin in [10670]. The copyrights for all copied files have been retained. All the unit tests are dummy tests, so far.
• Added license info to each file, and a COPYING file containing the contents of the license.

comment:14 follow-up:  16 Changed 8 years ago by Olemis Lang

Should this ticket be closed ?

@rjollos : btw , maintainer info is not up to date in plugin's setup.py file .

comment:15 Changed 8 years ago by Ryan J Ollos

(In [13143]) Refs #5773: Updated maintainer info.

comment:16 in reply to:  14 Changed 8 years ago by Ryan J Ollos

Resolution: → fixed assigned → closed

Should this ticket be closed ?

Yes, it should. Thanks olemis.

Modify Ticket

Change Properties