Modify

Opened 5 years ago

Closed 18 months ago

#5773 closed enhancement (fixed)

[PATCH] TracLink for the PasteBin component

Reported by: lars+trac-hacks.org@… Owned by: rjollos
Priority: low Component: TracPastePlugin
Severity: normal Keywords:
Cc: thinice@…, davidf@…, jbeilicke, lkraav, olemis Trac Release: 0.11

Description

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

[paste:213 See this Paste]

Attachments (1)

pastebin-wikilinks.patch (2.3 KB) - added by penmark 4 years ago.
Patch for adding wikilinks support to TracPastebinPlugin

Download all attachments as: .zip

Change History (17)

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

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

comment:2 Changed 5 years ago by rjollos

  • Summary changed from Integration with TracLink would be nice. to 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 5 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 5 years ago by rovangju

  • Cc thinice@… added

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: Changed 4 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.

Changed 4 years ago by penmark

Patch for adding wikilinks support to TracPastebinPlugin

comment:6 Changed 4 years ago by penmark

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

comment:7 Changed 4 years ago by davidfraser

  • Cc davidf@… added

comment:8 Changed 4 years ago by davidfraser

  • Summary changed from TracLink for the PasteBin component to [PATCH] TracLink for the PasteBin component

Tested and this works nicely with penmark's patch.

comment:9 Changed 4 years ago by rjollos

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:10 Changed 4 years ago by jbeilicke

  • Cc jbeilicke added

comment:11 Changed 2 years ago by rjollos

  • Cc lkraav added

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 2 years ago by rjollos

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

Replying to anonymous:

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

=> #10121

comment:13 Changed 2 years ago by rjollos

(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: Changed 18 months ago by olemis

  • Cc olemis added

Should this ticket be closed ?

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

comment:15 Changed 18 months ago by rjollos

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

comment:16 in reply to: ↑ 14 Changed 18 months ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

Replying to olemis:

Should this ticket be closed ?

Yes, it should. Thanks olemis.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.