Edgewall Software

Ticket #3895 (new enhancement)

Opened 2 years ago

Last modified 5 months ago

Provide Trac API for returning all outbound links in a page

Reported by: anonymous Owned by: jonas
Priority: normal Milestone: experimental
Component: general Version: 0.10
Severity: major Keywords: links xref
Cc:

Description

I have a suggestion that could kill a lot of birds with one stone.

I see a lot of people asking for functionality in Trac that relates to connections between pages (Backlink, Orphaned Pages, and MissingLinks? among them). I see some attempts by the community to provide that functionality. I also see that those attempts are:

1) Very poor, and 2) getting poorer by the day.

The reason they are getting poorer is that Trac already matches on a large array of patterns. The bar is set fairly high, and the current plugins do not meet it. Also, the Trac development team routinely introduces new additions/changes that increase the number of ways to connect two pages. There is really no way for the plugin community to catch up.

Instead of asking us to do so, I ask you to help us help you: Please provide (and document) an API function that takes some sort of reference to a Trac document (name perhaps) and returns a set of all outbound links from that page. This functionality should identically match (or perhaps replace?) the functionality Trac uses to generate and HTML page. As new patterns are added to the system, plugins would then automatically detect the new links. With this function as a basis, a host of other functions could be provided, correctly, by the community.

If and when Trac tracks links between pages, the API could be modified to use the stored information, rather than calculating it on the fly.

Attachments

Change History

Changed 2 years ago by cboos

  • keywords xref added
  • severity changed from blocker to major
  • milestone set to 1.0

Er, you mean something like TracCrossReferences?

For a start, the Backlink, Orphaned Pages, and MissingLinks were all implemented on top of this (see the source:sandbox/trac-xref/trac/xref/macros.py)

This is still on my TODO list ;)

Changed 2 years ago by anonymous

  • summary changed from Provide Trac API for returning all outbound links in a page to Followup

Oh, so you guys are still working on that? All of the links I'd found to it before were broken. When is it going to see the light of day? I think you guys underestimate how important it is for a working (work as in 'day job', not 'functioning') Wiki to have this sort of functionality.

I have concerns that the cross reference mechanism commits the sin of double-data entry. I already knew two pages were related, that's why I put a CamelCase reference on one page to the other. Why do I have to add something extra to get the Wiki to understand it?

Really, all I need is for the Wiki's own page parser to be able to tell ME what it determined as the outbound links from a page, that way all of the tools at least agree on what constitutes a link, and Edgewall is then free to tweak the rules with every single release without people getting miffed.

I'm willing to scan the entire 'wiki' table if needs be in order to sort out who's linked to whom (and who isn't linked to whom). Does it scale? On a large Wiki, obviously a database-driven solution is far superior. But most working Wikis (or at least, those without a blog built-in) aren't so big that you can't scan the entire thing in a handful of seconds.

Changed 2 years ago by anonymous

  • summary changed from Followup to Provide Trac API for returning all outbound links in a page

Summary correction.

Changed 5 months ago by cboos

  • milestone changed from 1.0 to experimental

This is essentially the API side of #1242, which also included an UI for that.

Add/Change #3895 (Provide Trac API for returning all outbound links in a page)

Author



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